[11771] Avoid happines overflow in HandlePetAbandon :)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Vinolentus 2011-08-07 00:48:34 +04:00 committed by VladimirMangos
parent cb685b3214
commit 336ebaa24a
2 changed files with 2 additions and 5 deletions

View file

@ -553,10 +553,7 @@ void WorldSession::HandlePetAbandon(WorldPacket& recv_data)
if (pet->IsPet()) if (pet->IsPet())
{ {
if (pet->GetObjectGuid() == _player->GetPetGuid()) if (pet->GetObjectGuid() == _player->GetPetGuid())
{ pet->ModifyPower(POWER_HAPPINESS, -50000);
uint32 feelty = pet->GetPower(POWER_HAPPINESS);
pet->SetPower(POWER_HAPPINESS, (feelty - 50000) > 0 ? (feelty - 50000) : 0);
}
((Pet*)pet)->Unsummon(PET_SAVE_AS_DELETED, _player); ((Pet*)pet)->Unsummon(PET_SAVE_AS_DELETED, _player);
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11770" #define REVISION_NR "11771"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__