Fixed not been able to attack doors.

This commit is contained in:
MobiusDev
2018-09-02 23:20:49 +00:00
parent 8cbb988bea
commit 118ca0d877
16 changed files with 72 additions and 31 deletions

View File

@@ -635,6 +635,12 @@ public class L2DoorInstance extends L2Character
{
broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.THE_CASTLE_GATE_HAS_BEEN_DESTROYED));
}
// Correct position in case pathfinding moved player to a restricted location, since door coordinates can be behind objects.
if (killer.isPlayer())
{
killer.setLocation(killer.getActingPlayer().getLastServerPosition());
}
return true;
}

View File

@@ -65,9 +65,6 @@ public class L2DoorTemplate extends L2CharTemplate implements IIdentifiable
// position
final String[] pos = set.getString("pos").split(";");
_posX = Integer.parseInt(pos[0]);
_posY = Integer.parseInt(pos[1]);
_posZ = Integer.parseInt(pos[2]);
_height = set.getInt("height");
_nodeZ = set.getInt("nodeZ");
_nodeX = new int[4]; // 4 * x
@@ -78,6 +75,9 @@ public class L2DoorTemplate extends L2CharTemplate implements IIdentifiable
_nodeX[i] = Integer.parseInt(split[0]);
_nodeY[i] = Integer.parseInt(split[1]);
}
_posX = Integer.parseInt(pos[0]);
_posY = Integer.parseInt(pos[1]);
_posZ = Math.min(Integer.parseInt(pos[2]), _nodeZ);
// optional
_emmiter = set.getInt("emitter_id", 0);