Browse Source

Adjusted the distance check for players in player's path, effectively making the collision area of players larger. This can be changed in Bounds PlayerCollisionPoint method by increasing or decreasing the minDistance var.

playercollision-1
Preston 1 month ago
parent
commit
962bebab6c
  1. 2
      src/engine/math/Bounds.java
  2. 4
      src/engine/objects/PlayerCharacter.java

2
src/engine/math/Bounds.java

@ -279,7 +279,7 @@ public class Bounds { @@ -279,7 +279,7 @@ public class Bounds {
// Now check for player collisions
HashSet<AbstractWorldObject> nearbyPlayers = WorldGrid.getObjectsInRangePartial(player, distance + 2, MBServerStatics.MASK_PLAYER);
float minDistance = 1.0f; // Minimum distance between players
float minDistance = 5.0f; // Minimum distance between players
for (AbstractWorldObject awo : nearbyPlayers) {
PlayerCharacter otherPlayer = (PlayerCharacter) awo;

4
src/engine/objects/PlayerCharacter.java

@ -205,9 +205,6 @@ public class PlayerCharacter extends AbstractCharacter { @@ -205,9 +205,6 @@ public class PlayerCharacter extends AbstractCharacter {
this.guildStatus = new AtomicInteger(0);
this.bindBuildingID = -1;
Vector3fImmutable center = new Vector3fImmutable(0, 0, 0);
Vector3fImmutable extents = new Vector3fImmutable(0.5f, 1.0f, 0.5f);
}
/**
@ -5359,7 +5356,6 @@ public class PlayerCharacter extends AbstractCharacter { @@ -5359,7 +5356,6 @@ public class PlayerCharacter extends AbstractCharacter {
moveToMsg.setSourceType(GameObjectType.PlayerCharacter.ordinal());
moveToMsg.setSourceID(this.getObjectUUID());
ChatManager.chatSystemInfo(this, "This is a test");
Dispatch dispatch = Dispatch.borrow(this, moveToMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);

Loading…
Cancel
Save