mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
i.e. world update start
This commit is contained in:
committed by
Francesco Borzì
parent
1b7522ff0e
commit
51b8773528
@@ -8,6 +8,7 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "GameTime.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "Log.h"
|
||||
#include "Opcodes.h"
|
||||
@@ -128,7 +129,7 @@ uint8 WorldSession::HandleLoadPetFromDBFirstCallback(PreparedQueryResult result,
|
||||
Map* map = owner->GetMap();
|
||||
uint32 guid = sObjectMgr->GenerateLowGuid(HIGHGUID_PET);
|
||||
Pet* pet = new Pet(owner, pet_type);
|
||||
LoadPetFromDBQueryHolder* holder = new LoadPetFromDBQueryHolder(pet_number, current, uint32(time(NULL) - fields[14].GetUInt32()), fields[13].GetString(), savedhealth, savedmana);
|
||||
LoadPetFromDBQueryHolder* holder = new LoadPetFromDBQueryHolder(pet_number, current, uint32(GameTime::GetGameTime() - fields[14].GetUInt32()), fields[13].GetString(), savedhealth, savedmana);
|
||||
if (!pet->Create(guid, map, owner->GetPhaseMask(), petentry, pet_number) || !holder->Initialize())
|
||||
{
|
||||
delete pet;
|
||||
@@ -198,7 +199,7 @@ uint8 WorldSession::HandleLoadPetFromDBFirstCallback(PreparedQueryResult result,
|
||||
break;
|
||||
}
|
||||
|
||||
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped here
|
||||
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(GameTime::GetGameTime())); // cast can't be helped here
|
||||
pet->SetCreatorGUID(owner->GetGUID());
|
||||
owner->SetMinion(pet, true);
|
||||
|
||||
@@ -552,7 +553,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
|
||||
|
||||
// pussywizard:
|
||||
if (Creature* creaturePet = pet->ToCreature())
|
||||
if (!creaturePet->_CanDetectFeignDeathOf(TargetUnit) || !creaturePet->CanCreatureAttack(TargetUnit) || creaturePet->isTargetNotAcceptableByMMaps(TargetUnit->GetGUID(), sWorld->GetGameTime(), TargetUnit))
|
||||
if (!creaturePet->_CanDetectFeignDeathOf(TargetUnit) || !creaturePet->CanCreatureAttack(TargetUnit) || creaturePet->isTargetNotAcceptableByMMaps(TargetUnit->GetGUID(), GameTime::GetGameTime(), TargetUnit))
|
||||
return;
|
||||
|
||||
// Not let attack through obstructions
|
||||
@@ -1191,7 +1192,7 @@ void WorldSession::HandlePetRename(WorldPacket & recvData)
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
||||
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped
|
||||
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(GameTime::GetGameTime())); // cast can't be helped
|
||||
}
|
||||
|
||||
void WorldSession::HandlePetAbandon(WorldPacket & recvData)
|
||||
|
||||
Reference in New Issue
Block a user