summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-07-12 19:54:41 +0300
committerAndrei Karas <akaras@inbox.ru>2017-07-12 21:12:24 +0300
commita366d82dad85389c9562fdfdd3a981894603fa07 (patch)
tree37a254b8e65d0324624f42520a7ed3943cab2e28
parent03948f9bc58477100c61c11651290bee372dab5f (diff)
downloadmv-a366d82dad85389c9562fdfdd3a981894603fa07.tar.gz
mv-a366d82dad85389c9562fdfdd3a981894603fa07.tar.bz2
mv-a366d82dad85389c9562fdfdd3a981894603fa07.tar.xz
mv-a366d82dad85389c9562fdfdd3a981894603fa07.zip
Move group id from localplayer to being.
-rw-r--r--src/being/being.cpp1
-rw-r--r--src/being/being.h7
-rw-r--r--src/being/localplayer.cpp3
-rw-r--r--src/being/localplayer.h7
4 files changed, 10 insertions, 8 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index b281919f3..ff8593c11 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -189,6 +189,7 @@ Being::Being(const BeingId id,
mSpeechTime(0),
mAttackSpeed(350),
mLevel(0),
+ mGroupId(0),
mAttackRange(1),
mLastAttackX(0),
mLastAttackY(0),
diff --git a/src/being/being.h b/src/being/being.h
index 3d21311b7..8bba7548d 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -1070,6 +1070,12 @@ class Being notfinal : public ActorSprite,
uint16_t getTeamId() const restrict2 noexcept2 A_WARN_UNUSED
{ return mTeamId; }
+ virtual void setGroupId(const int id)
+ { mGroupId = id; }
+
+ int getGroupId() const noexcept2 A_WARN_UNUSED
+ { return mGroupId; }
+
void serverRemove() restrict2 noexcept2;
void addCast(const int dstX,
@@ -1193,6 +1199,7 @@ class Being notfinal : public ActorSprite,
int mAttackSpeed; /**< Attack speed */
int mLevel;
+ int mGroupId;
int mAttackRange;
int mLastAttackX;
int mLastAttackY;
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index a5b5ce5fc..68d39f08f 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -117,7 +117,6 @@ LocalPlayer::LocalPlayer(const BeingId id,
AttributeListener(),
PlayerDeathListener(),
StatListener(),
- mGroupId(0),
mMoveState(0),
mLastTargetX(0),
mLastTargetY(0),
@@ -418,7 +417,7 @@ void LocalPlayer::setAction(const BeingActionT &action,
void LocalPlayer::setGroupId(const int id)
{
- mGroupId = id;
+ Being::setGroupId(id);
if (id > 0)
{
diff --git a/src/being/localplayer.h b/src/being/localplayer.h
index 7e77f5322..76a8c913b 100644
--- a/src/being/localplayer.h
+++ b/src/being/localplayer.h
@@ -114,10 +114,7 @@ class LocalPlayer final : public Being,
void attack2(Being *const target = nullptr, const bool keep = false,
const bool dontChangeEquipment = false);
- void setGroupId(const int id);
-
- int getGroupId() const noexcept2 A_WARN_UNUSED
- { return mGroupId; }
+ void setGroupId(const int id) override final;
void stopAttack(const bool keepAttack = false);
@@ -454,8 +451,6 @@ class LocalPlayer final : public Being,
void loadHomes();
- int mGroupId;
-
// move state. used if mMoveType == 2
unsigned int mMoveState;