Jump to content

[11771] avoid happines overflow in HandlePetAbandon :)


Recommended Posts

Posted
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);

×
×
  • 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