Jump to content

[11771] avoid happines overflow in HandlePetAbandon :)


Guest Vinolentus

Recommended Posts

diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp
index 3f5a0d9..79b7ecf 100644
--- a/src/game/PetHandler.cpp
+++ b/src/game/PetHandler.cpp
@@ -399,7 +399,7 @@ void WorldSession::HandlePetAbandon(WorldPacket& recv_data)
            if(pet->GetObjectGuid() == GetPlayer()->GetPetGuid())
            {
                uint32 feelty = pet->GetPower(POWER_HAPPINESS);
-                pet->SetPower(POWER_HAPPINESS, (feelty - 50000) > 0 ? (feelty - 50000) : 0);
+                pet->SetPower(POWER_HAPPINESS, feelty > 50000 ? feelty - 50000 : 0);
            }

            GetPlayer()->RemovePet(PET_SAVE_AS_DELETED);

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use