Core/Phases:
- fixed packet structure, thanks to Shauren for the notice - fixed .mod phase command - implemented world map area swaps for swapped terrain
This commit is contained in:
1 parent
d77bb02e88
commit
2583661703
5 files changed
+26
-19
No files matched your search
@@ -2940,15 +2940,4 @@ void WorldObject::RebuildTerrainSwaps()
|
||||
_terrainSwaps.insert(swap);
|
||||
}
|
||||
}
|
||||
|
||||
// Now insert the map terrain swaps
|
||||
std::list<uint32>& mapSwaps = sObjectMgr->GetMapTerrainSwaps(GetMapId());
|
||||
|
||||
for (auto swap : mapSwaps)
|
||||
{
|
||||
conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_TERRAIN_SWAP, swap);
|
||||
|
||||
if (sConditionMgr->IsObjectMeetToConditions(this, conditions))
|
||||
_terrainSwaps.insert(swap);
|
||||
}
|
||||
}
|
||||
@@ -27993,7 +27993,15 @@ void Player::SendUpdatePhasing()
|
||||
if (!IsInWorld())
|
||||
return;
|
||||
|
||||
std::set<uint32> worldAreaSwaps; // @ToDo
|
||||
std::set<uint32> worldAreaSwaps;
|
||||
|
||||
for (uint32 terrain : GetTerrainSwaps())
|
||||
{
|
||||
for (uint32 map : sObjectMgr->GetMapTerrainSwaps(terrain))
|
||||
{
|
||||
worldAreaSwaps.insert(map);
|
||||
}
|
||||
}
|
||||
GetSession()->SendSetPhaseShift(GetPhases(), GetTerrainSwaps(), worldAreaSwaps);
|
||||
}
|
||||
|
||||
|
||||
@@ -1787,7 +1787,7 @@ void WorldSession::SendSetPhaseShift(std::set<uint32> const& phaseIds, std::set<
|
||||
data.WriteByteSeq(guid[7]);
|
||||
data.WriteByteSeq(guid[4]);
|
||||
|
||||
data << uint32(worldMapAreaSwaps.size());
|
||||
data << uint32(worldMapAreaSwaps.size()) * 2;
|
||||
for (auto mapSwap : worldMapAreaSwaps)
|
||||
data << uint16(mapSwap); // WorldMapArea.dbc id (controls map display)
|
||||
|
||||
|
||||
@@ -958,6 +958,7 @@ public:
|
||||
|
||||
char* t = strtok((char*)args, " ");
|
||||
char* p = strtok(NULL, " ");
|
||||
char* m = strtok(NULL, " ");
|
||||
|
||||
if (!t)
|
||||
return false;
|
||||
@@ -966,10 +967,16 @@ public:
|
||||
std::set<uint32> phaseId;
|
||||
std::set<uint32> worldMapSwap;
|
||||
|
||||
terrainswap.insert((uint32)atoi(t));
|
||||
if (uint32 ut = (uint32)atoi(t))
|
||||
terrainswap.insert(ut);
|
||||
|
||||
if (p)
|
||||
phaseId.insert((uint32)atoi(p));
|
||||
if (uint32 up = (uint32)atoi(p))
|
||||
phaseId.insert(up);
|
||||
|
||||
if (m)
|
||||
if (uint32 um = (uint32)atoi(m))
|
||||
worldMapSwap.insert(um);
|
||||
|
||||
handler->GetSession()->SendSetPhaseShift(phaseId, terrainswap, worldMapSwap);
|
||||
return true;
|
||||
|
||||
@@ -1277,10 +1277,13 @@ public:
|
||||
uint32 phase = (uint32)atoi((char*)args);
|
||||
|
||||
Unit* target = handler->getSelectedUnit();
|
||||
if (target)
|
||||
target->SetInPhase(phase, true, !target->IsInPhase(phase));
|
||||
else
|
||||
handler->GetSession()->GetPlayer()->SetInPhase(phase, true, !handler->GetSession()->GetPlayer()->IsInPhase(phase));
|
||||
if (!target)
|
||||
target = handler->GetSession()->GetPlayer();
|
||||
|
||||
target->SetInPhase(phase, true, !target->IsInPhase(phase));
|
||||
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->ToPlayer()->SendUpdatePhasing();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user