Surrounded command chain with region boxes

Changed doWarp() to handle in implicit, in-zone only warps

Might have issues with instanced zones, untested
This commit is contained in:
TheManii 2016-04-07 12:25:28 -07:00
parent b17d193a59
commit ecc61ea5f9
2 changed files with 154 additions and 83 deletions

View file

@ -372,26 +372,35 @@ namespace FFXIVClassic_Map_Server
}
//Add player to new zone and update
Area newArea;
if (destinationPrivateArea == null)
newArea = GetZone(destinationZoneId);
Area newArea;
if (destinationZoneId != 0)
{
if (destinationPrivateArea == null)
newArea = GetZone(destinationZoneId);
else
newArea = GetZone(destinationZoneId).getPrivateArea(destinationPrivateArea, 0);
}
else
newArea = GetZone(destinationZoneId).getPrivateArea(destinationPrivateArea, 0);
{
if (destinationPrivateArea == null)
newArea = GetZone(player.zoneId);
else
newArea = GetZone(player.zoneId).getPrivateArea(destinationPrivateArea, 0);
}
//This server does not contain that zoneId
if (newArea == null)
return;
newArea.addActorToZone(player);
//Update player actor's properties
player.zoneId = newArea.actorId;
player.zone = newArea;
player.positionX = spawnX;
player.positionY = spawnY;
player.positionZ = spawnZ;
player.rotation = spawnRotation;
newArea.addActorToZone(player);
//Update player actor's properties
player.zoneId = newArea.actorId;
player.zone = newArea;
player.positionX = spawnX;
player.positionY = spawnY;
player.positionZ = spawnZ;
player.rotation = spawnRotation;
//Send packets
player.playerSession.queuePacket(DeleteAllActorsPacket.buildPacket(player.actorId), true, false);