diff --git a/source/abstract/Character.cpp b/source/abstract/Character.cpp index 4b4e306..35d7f5c 100644 --- a/source/abstract/Character.cpp +++ b/source/abstract/Character.cpp @@ -160,11 +160,11 @@ Character::move() { } /** - * Returns true if the character is currently moving. + * Returns true if the path is empty. */ bool -Character::isMoving() const { - return !mPath.empty(); +Character::isPathEmpty() const { + return mPath.empty(); } /** diff --git a/source/abstract/Character.h b/source/abstract/Character.h index 3ffa635..1c317c5 100644 --- a/source/abstract/Character.h +++ b/source/abstract/Character.h @@ -46,7 +46,7 @@ protected: void pullTrigger(); void releaseTrigger(); bool setDestination(const Vector2f& destination); - bool isMoving() const; + bool isPathEmpty() const; bool isVisible(const Vector2f& target) const; std::vector > getCharacters() const; int getMagazineAmmo() const; diff --git a/source/sprites/Enemy.cpp b/source/sprites/Enemy.cpp index ecda42b..aa844b7 100644 --- a/source/sprites/Enemy.cpp +++ b/source/sprites/Enemy.cpp @@ -36,7 +36,7 @@ Enemy::onThink(int elapsed) { setDirection(target->getPosition() - getPosition()); pullTrigger(); } - else if (!isMoving()) + else if (isPathEmpty()) setDestination(target->getPosition()); } else {