From 9cf563fa7f4059bfddd82efdaa89df2ed07a6d7c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 20 Oct 2013 18:11:57 +0300 Subject: Remove setMap from being constructor. --- src/actormanager.cpp | 4 ++-- src/being/being.cpp | 4 +--- src/being/being.h | 4 +--- src/being/localplayer.cpp | 2 +- src/gui/windows/charcreatedialog.cpp | 3 +-- src/gui/windows/npcdialog.cpp | 2 +- 6 files changed, 7 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/actormanager.cpp b/src/actormanager.cpp index f37cc9a18..694b1de36 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -238,8 +238,8 @@ Being *ActorManager::createBeing(const int id, const ActorSprite::Type type, const uint16_t subtype) { - Being *const being = new Being(id, type, subtype, mMap); - + Being *const being = new Being(id, type, subtype); + being->setMap(mMap); mActors.insert(being); return being; } diff --git a/src/being/being.cpp b/src/being/being.cpp index fdd706bbe..4745f516e 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -99,8 +99,7 @@ std::list beingInfoCache; typedef std::map::const_iterator GuildsMapCIter; typedef std::map::const_iterator IntMapCIter; -Being::Being(const int id, const Type type, const uint16_t subtype, - Map *const map) : +Being::Being(const int id, const Type type, const uint16_t subtype) : ActorSprite(id), mNextSound(), mInfo(BeingInfo::unknown), @@ -190,7 +189,6 @@ Being::Being(const int id, const Type type, const uint16_t subtype, mSpriteHide[f] = 0; } - setMap(map); setSubtype(subtype, 0); if (mType == PLAYER) diff --git a/src/being/being.h b/src/being/being.h index 6e9d55768..79f5ebafb 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -155,10 +155,8 @@ class Being : public ActorSprite, public ConfigListener * * @param id a unique being id * @param subtype partly determines the type of the being - * @param map the map the being is on */ - Being(const int id, const Type type, const uint16_t subtype, - Map *const map); + Being(const int id, const Type type, const uint16_t subtype); A_DELETE_COPY(Being) diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 6df48dec7..17424e6a8 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -88,7 +88,7 @@ extern MiniStatusWindow *miniStatusWindow; extern SkillDialog *skillDialog; LocalPlayer::LocalPlayer(const int id, const int subtype) : - Being(id, PLAYER, subtype, nullptr), + Being(id, PLAYER, subtype), mGMLevel(0), mInvertDirection(0), mCrazyMoveType(config.getIntValue("crazyMoveType")), diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index 5164c89b6..d23a40f7a 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -121,8 +121,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, mLook(0), mMinLook(CharDB::getMinLook()), mMaxLook(CharDB::getMaxLook()), - mPlayer(new Being(0, ActorSprite::PLAYER, static_cast(mRace), - nullptr)), + mPlayer(new Being(0, ActorSprite::PLAYER, static_cast(mRace))), mPlayerBox(new PlayerBox(mPlayer, "charcreate_playerbox.xml", "charcreate_selectedplayerbox.xml")), mHairStyle(0), diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index 3b5d0d772..9192b66b9 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -851,7 +851,7 @@ void NpcDialog::showAvatar(const uint16_t avatarId) if (needShow) { delete mAvatarBeing; - mAvatarBeing = new Being(0, ActorSprite::AVATAR, avatarId, nullptr); + mAvatarBeing = new Being(0, ActorSprite::AVATAR, avatarId); mPlayerBox->setPlayer(mAvatarBeing); if (!mAvatarBeing->empty()) { -- cgit v1.2.3-60-g2f50