Commit ccdc3d12 authored by gentlespoon's avatar gentlespoon Committed by Melledy
Browse files

Only handle motion notify for current entity.

parent f0aa8c2c
...@@ -243,16 +243,17 @@ public class StaminaManager { ...@@ -243,16 +243,17 @@ public class StaminaManager {
cachedEntity = entity; cachedEntity = entity;
MotionInfo motionInfo = moveInfo.getMotionInfo(); MotionInfo motionInfo = moveInfo.getMotionInfo();
MotionState motionState = motionInfo.getState(); MotionState motionState = motionInfo.getState();
boolean isReliable = moveInfo.getIsReliable(); int notifyEntityId = entity.getId();
Grasscutter.getLogger().trace("" + motionState + "\t" + (isReliable ? "reliable" : "")); int currentAvatarEntityId = session.getPlayer().getTeamManager().getCurrentAvatarEntity().getId();
if (isReliable) { if (notifyEntityId != currentAvatarEntityId) {
return;
}
currentState = motionState; currentState = motionState;
Vector posVector = motionInfo.getPos(); Vector posVector = motionInfo.getPos();
Position newPos = new Position(posVector.getX(), posVector.getY(), posVector.getZ()); Position newPos = new Position(posVector.getX(), posVector.getY(), posVector.getZ());
if (newPos.getX() != 0 && newPos.getY() != 0 && newPos.getZ() != 0) { if (newPos.getX() != 0 && newPos.getY() != 0 && newPos.getZ() != 0) {
currentCoordinates = newPos; currentCoordinates = newPos;
} }
}
startSustainedStaminaHandler(); startSustainedStaminaHandler();
handleImmediateStamina(session, motionInfo, motionState, entity); handleImmediateStamina(session, motionInfo, motionState, entity);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment