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);

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);

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);

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);

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);

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);

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);

View File

@ -3056,7 +3056,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);

View File

@ -3056,7 +3056,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);

View File

@ -3056,7 +3056,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);

View File

@ -5106,7 +5106,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
{
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);

View File

@ -5152,7 +5152,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
{
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);

View File

@ -3991,7 +3991,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);

View File

@ -3993,7 +3993,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);

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);

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);

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);

View File

@ -3070,7 +3070,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);

View File

@ -3070,7 +3070,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);

View File

@ -3069,7 +3069,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);

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);

View File

@ -3072,7 +3072,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);

View File

@ -3079,7 +3079,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);