Describe the bug
When there is a gravity force applied to a Creature, its location will be set on every update despite the new location being identical to the old one when the Creature is colliding with something. This breaks the idle animations for the creature since the "last moved" tick is always the last update and the Creature never goes idle.
To Reproduce
Steps to reproduce the behavior:
Apply a force to a Creature, e.g. Gravity.
Let the Creature collide with something while the Force is active
The Creature can't keep moving, but the position is continuously set to the identical position in every update.
The Creature's idle animation will never play because of this
Expected behavior
Creature.setLocation() should not do anything if the new location is identical to the old one
@Override
public void setLocation(final Point2D position) {
if (this.isDead() || position == null || position.equals(getLocation())) {
return;
}
...
}
PhysicsEngine.move() should not do anything if the target is identical to the entity's location
Describe the bug When there is a gravity force applied to a Creature, its location will be set on every update despite the new location being identical to the old one when the Creature is colliding with something. This breaks the idle animations for the creature since the "last moved" tick is always the last update and the Creature never goes idle.
To Reproduce Steps to reproduce the behavior:
Expected behavior
Creature.setLocation()
should not do anything if the new location is identical to the old onePhysicsEngine.move()
should not do anything if the target is identical to the entity's locationPhysicsEngine.move()