From 3790bff33c3a05c5895dab6c21761253f640a395 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 28 Dec 2016 23:52:14 +0300 Subject: Use templated parameters in Being::getOffset. --- src/being/being.cpp | 12 ++++++------ src/being/being.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/being') diff --git a/src/being/being.cpp b/src/being/being.cpp index 56d6aa9c6..f2a3f26e9 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1858,10 +1858,10 @@ void Being::logic() restrict2 if (mAction == BeingAction::MOVE || mNeedPosUpdate) { - const int xOffset = getOffset( - BeingDirection::LEFT, BeingDirection::RIGHT); - const int yOffset = getOffset( - BeingDirection::UP, BeingDirection::DOWN); + const int xOffset = getOffset(); + const int yOffset = getOffset(); int offset = xOffset; if (!offset) offset = yOffset; @@ -2343,8 +2343,8 @@ void Being::drawSpeech(const int offsetX, } } -int Being::getOffset(const signed char pos, - const signed char neg) const restrict2 +template +int Being::getOffset() const restrict2 { // Check whether we're walking in the requested direction if (mAction != BeingAction::MOVE || !(mDirection & (pos | neg))) diff --git a/src/being/being.h b/src/being/being.h index e1f97a08b..b35c550bd 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -1175,8 +1175,8 @@ class Being notfinal : public ActorSprite, * If walking in direction 'neg' the value is negated. * TODO: Used by eAthena only? */ - int getOffset(const signed char pos, - const signed char neg) const restrict2 A_WARN_UNUSED; + template + int getOffset() const restrict2 A_WARN_UNUSED; int searchSlotValue(const std::vector &restrict slotRemap, const int val) const restrict2 A_WARN_UNUSED; -- cgit v1.2.3-70-g09d2