diff options
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/being.cpp | 3 | ||||
-rw-r--r-- | src/being/being.h | 7 | ||||
-rw-r--r-- | src/being/localplayer.cpp | 11 |
3 files changed, 8 insertions, 13 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 49a044150..179e64635 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -41,6 +41,7 @@ #include "enums/being/attributes.h" #include "enums/being/beingdirection.h" +#include "enums/being/reachable.h" #include "enums/net/packettypes.h" @@ -201,7 +202,7 @@ Being::Being(const BeingId id, mHP(0), mMaxHP(0), mDistance(0), - mIsReachable(REACH_UNKNOWN), + mIsReachable(Reachable::REACH_UNKNOWN), mGoodStatus(-1), mMoveTime(0), mAttackTime(0), diff --git a/src/being/being.h b/src/being/being.h index 1837f9cbe..ead24af3f 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -91,13 +91,6 @@ class Being notfinal : public ActorSprite, friend class BeingEquipBackend; friend class LocalPlayer; - enum Reachable - { - REACH_UNKNOWN = 0, - REACH_YES = 1, - REACH_NO = 2 - }; - /** * Constructor. * diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 5c47c55a8..6c8bd5ea6 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -42,6 +42,7 @@ #include "enums/being/attributes.h" #include "enums/being/beingdirection.h" +#include "enums/being/reachable.h" #include "enums/net/packettypes.h" @@ -1375,14 +1376,14 @@ bool LocalPlayer::isReachable(Being *const being, if (!being || !mMap) return false; - if (being->isReachable() == Being::REACH_NO) + if (being->isReachable() == Reachable::REACH_NO) return false; if (being->getTileX() == mX && being->getTileY() == mY) { being->setDistance(0); - being->setIsReachable(Being::REACH_YES); + being->setIsReachable(Reachable::REACH_YES); return true; } else if (being->getTileX() - 1 <= mX @@ -1391,7 +1392,7 @@ bool LocalPlayer::isReachable(Being *const being, && being->getTileY() + 1 >= mY) { being->setDistance(1); - being->setIsReachable(Being::REACH_YES); + being->setIsReachable(Reachable::REACH_YES); return true; } @@ -1405,12 +1406,12 @@ bool LocalPlayer::isReachable(Being *const being, being->setDistance(static_cast<int>(debugPath.size())); if (!debugPath.empty()) { - being->setIsReachable(Being::REACH_YES); + being->setIsReachable(Reachable::REACH_YES); return true; } else { - being->setIsReachable(Being::REACH_NO); + being->setIsReachable(Reachable::REACH_NO); return false; } } |