Additional door checks when moving.

This commit is contained in:
MobiusDevelopment
2021-03-28 14:59:52 +00:00
parent b72bef5c61
commit fb5a0626cd
23 changed files with 46 additions and 23 deletions

View File

@ -3057,7 +3057,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
final double distance = Math.hypot(dx, dy);
if (_cursorKeyMovement // In case of cursor movement, avoid moving through obstacles.
|| (distance > 3000)) // Stop movement when player has clicked far away and intersected with an obstacle.
|| (distance > 3000) // Stop movement when player has clicked far away and intersected with an obstacle.
|| ((getWorldRegion() != null) && !getWorldRegion().getDoors().isEmpty())) // Check for nearby doors.
{
final double angle = Util.convertHeadingToDegree(getHeading());
final double radian = Math.toRadians(angle);