Core/Phases: Preliminary work with correctly implementing the phase system in 4.3.4

Put here for peer review.
This commit is contained in:
Subv
2014-06-01 22:27:29 -05:00
parent 6bc62d730e
commit 48ec2df81f
40 changed files with 436 additions and 863 deletions
+5 -2
View File
@@ -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;