diff options
| author | joschiwald <joschiwald.trinity@gmail.com> | 2018-01-06 19:56:11 +0100 |
|---|---|---|
| committer | joschiwald <joschiwald.trinity@gmail.com> | 2018-01-06 19:56:11 +0100 |
| commit | 5e3e4182c892413d02efc78af9f231dcb1a05c79 (patch) | |
| tree | 3046ec110dc88e4972f21d5312473d846909d572 /src/server/scripts/Commands | |
| parent | 769db08a67db67e2dca7910c23277fa94d98fe7f (diff) | |
Core/Entities: Extended SpawnMask to 64 bit
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_debug.cpp | 11 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_gobject.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_npc.cpp | 9 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_wp.cpp | 8 |
4 files changed, 14 insertions, 16 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 5646cac033a..417e8aeb7bd 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1470,13 +1470,10 @@ public: return false; } - if (target->GetTypeId() == TYPEID_UNIT) - { - if (target->ToCreature()->GetDBPhase() > 0) - handler->PSendSysMessage("Target creature's PhaseId in DB: %d", target->ToCreature()->GetDBPhase()); - else if (target->ToCreature()->GetDBPhase() < 0) - handler->PSendSysMessage("Target creature's PhaseGroup in DB: %d", abs(target->ToCreature()->GetDBPhase())); - } + if (target->GetDBPhase() > 0) + handler->PSendSysMessage("Target creature's PhaseId in DB: %d", target->GetDBPhase()); + else if (target->GetDBPhase() < 0) + handler->PSendSysMessage("Target creature's PhaseGroup in DB: %d", abs(target->GetDBPhase())); std::stringstream phases; diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 4c454ce37c2..c7611d7e3f4 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -159,7 +159,7 @@ public: } // fill the gameobject data and save to the db - object->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), player->GetPhaseMask()); + object->SaveToDB(map->GetId(), UI64LIT(1) << map->GetSpawnMode()); ObjectGuid::LowType spawnId = object->GetSpawnId(); // delete the old object and do a clean load from DB with a fresh new GameObject instance. diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index b877ce90e91..719fd6a5992 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -296,15 +296,15 @@ public: ObjectGuid::LowType guid = map->GenerateLowGuid<HighGuid::Creature>(); CreatureData& data = sObjectMgr->NewOrExistCreatureData(guid); data.id = id; - data.phaseMask = chr->GetPhaseMask(); data.posX = chr->GetTransOffsetX(); data.posY = chr->GetTransOffsetY(); data.posZ = chr->GetTransOffsetZ(); data.orientation = chr->GetTransOffsetO(); + /// @todo: add phases Creature* creature = trans->CreateNPCPassenger(guid, &data); - creature->SaveToDB(trans->GetGOInfo()->moTransport.SpawnMap, 1 << map->GetSpawnMode(), chr->GetPhaseMask()); + creature->SaveToDB(trans->GetGOInfo()->moTransport.SpawnMap, UI64LIT(1) << map->GetSpawnMode()); sObjectMgr->AddCreatureToGrid(guid, &data); return true; @@ -317,7 +317,8 @@ public: return false; } - creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMask()); + creature->CopyPhaseFrom(chr); + creature->SaveToDB(map->GetId(), UI64LIT(1) << map->GetSpawnMode()); ObjectGuid::LowType db_guid = creature->GetSpawnId(); @@ -769,7 +770,7 @@ public: if (CreatureData const* data = sObjectMgr->GetCreatureData(target->GetSpawnId())) { - handler->PSendSysMessage(LANG_NPCINFO_PHASES, data->phaseid, data->phaseGroup); + handler->PSendSysMessage(LANG_NPCINFO_PHASES, data->phaseId, data->phaseGroup); if (data->phaseGroup) { std::set<uint32> _phases = target->GetPhases(); diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index e72437c9bd2..e58b15ece40 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -674,7 +674,7 @@ public: } wpCreature->CopyPhaseFrom(chr); - wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMask()); + wpCreature->SaveToDB(map->GetId(), UI64LIT(1) << map->GetSpawnMode()); // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells(); /// @todo Should we first use "Create" then use "LoadFromDB"? if (!wpCreature->LoadCreatureFromDB(wpCreature->GetSpawnId(), map)) @@ -887,7 +887,7 @@ public: } wpCreature->CopyPhaseFrom(chr); - wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMask()); + wpCreature->SaveToDB(map->GetId(), UI64LIT(1) << map->GetSpawnMode()); // Set "wpguid" column to the visual waypoint stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_DATA_WPGUID); @@ -951,8 +951,8 @@ public: } creature->CopyPhaseFrom(chr); + creature->SaveToDB(map->GetId(), UI64LIT(1) << map->GetSpawnMode()); - creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMask()); if (!creature->LoadCreatureFromDB(creature->GetSpawnId(), map)) { handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id); @@ -1002,8 +1002,8 @@ public: } creature->CopyPhaseFrom(chr); + creature->SaveToDB(map->GetId(), UI64LIT(1) << map->GetSpawnMode()); - creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMask()); if (!creature->LoadCreatureFromDB(creature->GetSpawnId(), map)) { handler->PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id); |
