Core/DBLayer: Proper code style on recently refactored code
This commit is contained in:
@@ -693,25 +693,25 @@ void WorldSession::HandleUnstablePet(WorldPacket & recv_data)
|
|||||||
_unstablePetCallback.SetFutureResult(CharacterDatabase.AsyncQuery(stmt));
|
_unstablePetCallback.SetFutureResult(CharacterDatabase.AsyncQuery(stmt));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleUnstablePetCallback(PreparedQueryResult result, uint32 petnumber)
|
void WorldSession::HandleUnstablePetCallback(PreparedQueryResult result, uint32 petId)
|
||||||
{
|
{
|
||||||
if (!GetPlayer())
|
if (!GetPlayer())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32 creature_id = 0;
|
uint32 petEntry = 0;
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
Field* fields = result->Fetch();
|
Field* fields = result->Fetch();
|
||||||
creature_id = fields[0].GetUInt32();
|
petEntry = fields[0].GetUInt32();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!creature_id)
|
if (!petEntry)
|
||||||
{
|
{
|
||||||
SendStableResult(STABLE_ERR_STABLE);
|
SendStableResult(STABLE_ERR_STABLE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creature_id);
|
CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(petEntry);
|
||||||
if (!creatureInfo || !creatureInfo->isTameable(_player->CanTameExoticPets()))
|
if (!creatureInfo || !creatureInfo->isTameable(_player->CanTameExoticPets()))
|
||||||
{
|
{
|
||||||
// if problem in exotic pet
|
// if problem in exotic pet
|
||||||
@@ -733,11 +733,11 @@ void WorldSession::HandleUnstablePetCallback(PreparedQueryResult result, uint32
|
|||||||
if (pet)
|
if (pet)
|
||||||
_player->RemovePet(pet, PET_SAVE_AS_DELETED);
|
_player->RemovePet(pet, PET_SAVE_AS_DELETED);
|
||||||
|
|
||||||
Pet* newpet = new Pet(_player, HUNTER_PET);
|
Pet* newPet = new Pet(_player, HUNTER_PET);
|
||||||
if (!newpet->LoadPetFromDB(_player, creature_id, petnumber))
|
if (!newPet->LoadPetFromDB(_player, petEntry, petId))
|
||||||
{
|
{
|
||||||
delete newpet;
|
delete newPet;
|
||||||
newpet = NULL;
|
newPet = NULL;
|
||||||
SendStableResult(STABLE_ERR_STABLE);
|
SendStableResult(STABLE_ERR_STABLE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -587,7 +587,7 @@ class WorldSession
|
|||||||
void HandleStablePet(WorldPacket& recvPacket);
|
void HandleStablePet(WorldPacket& recvPacket);
|
||||||
void HandleStablePetCallback(PreparedQueryResult result);
|
void HandleStablePetCallback(PreparedQueryResult result);
|
||||||
void HandleUnstablePet(WorldPacket& recvPacket);
|
void HandleUnstablePet(WorldPacket& recvPacket);
|
||||||
void HandleUnstablePetCallback(PreparedQueryResult result, uint32 petnumber);
|
void HandleUnstablePetCallback(PreparedQueryResult result, uint32 petId);
|
||||||
void HandleBuyStableSlot(WorldPacket& recvPacket);
|
void HandleBuyStableSlot(WorldPacket& recvPacket);
|
||||||
void HandleStableRevivePet(WorldPacket& recvPacket);
|
void HandleStableRevivePet(WorldPacket& recvPacket);
|
||||||
void HandleStableSwapPet(WorldPacket& recvPacket);
|
void HandleStableSwapPet(WorldPacket& recvPacket);
|
||||||
|
|||||||
Reference in New Issue
Block a user