mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-19 22:49:39 -04:00
Core/Phases: Preliminary work with correctly implementing the phase system in 4.3.4
Put here for peer review.
This commit is contained in:
@@ -152,12 +152,15 @@ public:
|
||||
GameObject* object = new GameObject;
|
||||
uint32 guidLow = sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT);
|
||||
|
||||
if (!object->Create(guidLow, objectInfo->entry, map, player->GetPhaseMgr().GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
|
||||
if (!object->Create(guidLow, objectInfo->entry, map, player->GetPhaseMask(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
|
||||
{
|
||||
delete object;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto phase : player->GetPhases())
|
||||
object->SetInPhase(phase, false, true);
|
||||
|
||||
if (spawntimeSecs)
|
||||
{
|
||||
uint32 value = atoi((char*)spawntimeSecs);
|
||||
@@ -165,7 +168,7 @@ public:
|
||||
}
|
||||
|
||||
// fill the gameobject data and save to the db
|
||||
object->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), player->GetPhaseMgr().GetPhaseMaskForSpawn());
|
||||
object->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), player->GetPhaseMask());
|
||||
// delete the old object and do a clean load from DB with a fresh new GameObject instance.
|
||||
// this is required to avoid weird behavior and memory leaks
|
||||
delete object;
|
||||
|
||||
Reference in New Issue
Block a user