From 336ebaa24a4fdf899becf6e2a54f3bc3f2f1194a Mon Sep 17 00:00:00 2001 From: Vinolentus Date: Sun, 7 Aug 2011 00:48:34 +0400 Subject: [PATCH] [11771] Avoid happines overflow in HandlePetAbandon :) Signed-off-by: VladimirMangos --- src/game/PetHandler.cpp | 5 +---- src/shared/revision_nr.h | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index 53ae9776b..730096723 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -553,10 +553,7 @@ void WorldSession::HandlePetAbandon(WorldPacket& recv_data) if (pet->IsPet()) { if (pet->GetObjectGuid() == _player->GetPetGuid()) - { - uint32 feelty = pet->GetPower(POWER_HAPPINESS); - pet->SetPower(POWER_HAPPINESS, (feelty - 50000) > 0 ? (feelty - 50000) : 0); - } + pet->ModifyPower(POWER_HAPPINESS, -50000); ((Pet*)pet)->Unsummon(PET_SAVE_AS_DELETED, _player); } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 60f125407..c5edc8c6e 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11770" + #define REVISION_NR "11771" #endif // __REVISION_NR_H__