forked from MagicBane/Server
Redone player collision by removing all refrences and usage of Bounds in PlayerCharacter.java. Added a new method PlayerCollisionPoint in Bounds.java mirroring PlayerBuildingCollisionPoint for other players instead of buildings. Added a new check in movement mirrioring the check for buildings but for players to ensure that PlayerCollisionPoint is called in each movement.
This commit is contained in:
@@ -88,7 +88,7 @@ public enum MovementManager {
|
||||
|
||||
// if (msg.getEndLat() < 0)
|
||||
// msg.setEndLat(0);
|
||||
//
|
||||
//
|
||||
// if (msg.getEndLon() > 0)
|
||||
// msg.setEndLon(0);
|
||||
|
||||
@@ -216,6 +216,16 @@ public enum MovementManager {
|
||||
|
||||
}
|
||||
|
||||
if (toMove.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
||||
Vector3fImmutable playerCollidePoint = Bounds.PlayerCollisionPoint((PlayerCharacter) toMove, toMove.getLoc(), endLocation);
|
||||
|
||||
if (playerCollidePoint != null) {
|
||||
msg.setEndCoord(playerCollidePoint);
|
||||
endLocation = playerCollidePoint;
|
||||
collide = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (toMove.getObjectType() == GameObjectType.PlayerCharacter && ((PlayerCharacter) toMove).isTeleportMode()) {
|
||||
toMove.teleport(endLocation);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user