summaryrefslogtreecommitdiff
path: root/src/being/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-13 19:56:05 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-13 19:56:05 +0300
commit38873bb99dea8a8089f1056bc1b28a59ed1f83d3 (patch)
tree702b19cf37f846f8a777777b958122d2cb562359 /src/being/being.cpp
parentc4d8fa788e0f89d73ba5ae2b66b79ad0351c5fbf (diff)
downloadmanaplus-38873bb99dea8a8089f1056bc1b28a59ed1f83d3.tar.gz
manaplus-38873bb99dea8a8089f1056bc1b28a59ed1f83d3.tar.bz2
manaplus-38873bb99dea8a8089f1056bc1b28a59ed1f83d3.tar.xz
manaplus-38873bb99dea8a8089f1056bc1b28a59ed1f83d3.zip
Move virtual methods from Being constructor to postInit.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r--src/being/being.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 97492d431..e954a5e97 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -156,9 +156,7 @@ static const unsigned int SPEECH_MAX_TIME = 800;
FOR_EACH (std::vector<AnimatedSprite*>::const_iterator, it, name)
Being::Being(const BeingId id,
- const ActorTypeT type,
- const BeingTypeId subtype,
- Map *const map) :
+ const ActorTypeT type) :
ActorSprite(id),
mNextSound(),
mInfo(BeingInfo::unknown),
@@ -277,7 +275,11 @@ Being::Being(const BeingId id,
for_each_badges()
mBadges[f] = nullptr;
+}
+void Being::postInit(const BeingTypeId subtype,
+ Map *const map)
+{
setMap(map);
setSubtype(subtype, 0);
@@ -5359,3 +5361,15 @@ void Being::setLanguageId(const int lang) restrict2 noexcept2
mLanguageId = lang;
}
}
+
+Being *Being::createBeing(const BeingId id,
+ const ActorTypeT type,
+ const BeingTypeId subType,
+ Map *const map)
+{
+ Being *const being = new Being(id,
+ type);
+ being->postInit(subType,
+ map);
+ return being;
+}