diff options
Diffstat (limited to 'src/server/game/Handlers/NPCHandler.cpp')
| -rw-r--r-- | src/server/game/Handlers/NPCHandler.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 776643af0a9..ad7cb112a29 100644 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -41,11 +41,12 @@ enum StableResultCode { STABLE_ERR_MONEY = 0x01, // "you don't have enough money" - STABLE_ERR_STABLE = 0x06, // currently used in most fail cases + STABLE_ERR_INVALID_SLOT = 0x03, // "That slot is locked" STABLE_SUCCESS_STABLE = 0x08, // stable success STABLE_SUCCESS_UNSTABLE = 0x09, // unstable/swap success STABLE_SUCCESS_BUY_SLOT = 0x0A, // buy slot success - STABLE_ERR_EXOTIC = 0x0C // "you are unable to control exotic creatures" + STABLE_ERR_EXOTIC = 0x0B, // "you are unable to control exotic creatures" + STABLE_ERR_STABLE = 0x0C, // "Internal pet error" }; void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket& recvData) @@ -655,14 +656,13 @@ void WorldSession::HandleStablePetCallback(PreparedQueryResult result) while (result->NextRow()); } - WorldPacket data(SMSG_STABLE_RESULT, 1); if (freeSlot > 0 && freeSlot <= GetPlayer()->m_stableSlots) { _player->RemovePet(_player->GetPet(), PetSaveMode(freeSlot)); SendStableResult(STABLE_SUCCESS_STABLE); } else - SendStableResult(STABLE_ERR_STABLE); + SendStableResult(STABLE_ERR_INVALID_SLOT); } void WorldSession::HandleUnstablePet(WorldPacket& recvData) @@ -844,13 +844,15 @@ void WorldSession::HandleStableSwapPetCallback(PreparedQueryResult result, uint3 } CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(petEntry); - if (!creatureInfo || !creatureInfo->IsTameable(_player->CanTameExoticPets())) + if (!creatureInfo || !creatureInfo->IsTameable(true)) { - // if problem in exotic pet - if (creatureInfo && creatureInfo->IsTameable(true)) - SendStableResult(STABLE_ERR_EXOTIC); - else - SendStableResult(STABLE_ERR_STABLE); + SendStableResult(STABLE_ERR_STABLE); + return; + } + + if (!creatureInfo->IsTameable(_player->CanTameExoticPets())) + { + SendStableResult(STABLE_ERR_EXOTIC); return; } |
