Update of /cvsroot/wpdev/wolfpack/ai
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18456/ai
Modified Files:
ai_humans.cpp
Log Message:
Stabling animals now removes them from the pet list
Index: ai_humans.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ai/ai_humans.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** ai_humans.cpp 16 Oct 2004 04:53:23 -0000 1.25
--- ai_humans.cpp 27 Oct 2004 10:56:12 -0000 1.26
***************
*** 139,147 ****
if ( pPet )
{
! pPet->free = false;
! // we need this for db saves
! pPet->setStablemasterSerial( INVALID_SERIAL );
! pPet->moveTo( m_npc->pos() );
! pPet->resend();
}
( *it )->remove();
--- 139,152 ----
if ( pPet )
{
! if (pTalker->pets().count() + pPet->controlSlots() > pTalker->maxControlSlots()) {
! m_npc->talk(1049612, pPet->name());
! } else {
! pPet->free = false;
! // we need this for db saves
! pPet->setStablemasterSerial( INVALID_SERIAL );
! pPet->setOwner( pTalker ); // This is important...
! pPet->moveTo( m_npc->pos() );
! pPet->resend();
! }
}
( *it )->remove();
***************
*** 152,155 ****
--- 157,162 ----
pPack->update();
m_npc->talk( 1042559 ); // Here you go... and good day to you!;
+ } else {
+ m_npc->talk( 502671 ); // But I have no animals stabled with me at the moment!
}
}
***************
*** 179,183 ****
if ( !pPet )
{
! m_npc->talk( 1048053 ); // You can't stable that!
}
else if ( pPet->owner() != player )
--- 186,190 ----
if ( !pPet )
{
! m_npc->talk( 502672 ); // HA HA HA! Sorry, I am not an inn.
}
else if ( pPet->owner() != player )
***************
*** 215,218 ****
--- 222,226 ----
MapObjects::instance()->remove( pPet );
pPet->setStablemasterSerial( this->m_npc->serial() );
+ pPet->setOwner(0); // Remove ownership from this player since it's stabled
pPet->removeFromView();
m_npc->talk( 502679 ); // Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed!
|