From 80792e881942a1cdbc10050177df888bbad44a9e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 8 Nov 2017 23:40:50 +0300 Subject: Add npc option for allow equipment. New option: allowEquipment Default value: false --- src/being/being.cpp | 4 +++- src/being/being.h | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/being') diff --git a/src/being/being.cpp b/src/being/being.cpp index 4f115a6d3..429201cf2 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -272,7 +272,8 @@ Being::Being(const BeingId id, mAway(false), mInactive(false), mNeedPosUpdate(true), - mBotAi(true) + mBotAi(true), + mAllowNpcEquipment(false) { for (int f = 0; f < 20; f ++) { @@ -462,6 +463,7 @@ void Being::setSubtype(const BeingTypeId subtype, DisplayType::Item, std::string()); mYDiff = mInfo->getSortOffsetY(); + mAllowNpcEquipment = mInfo->getAllowEquipment(); } break; case ActorType::Avatar: diff --git a/src/being/being.h b/src/being/being.h index 775c875f9..feb686740 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -1097,6 +1097,9 @@ class Being notfinal : public ActorSprite, void fixDirectionOffsets(int &offsetX, int &offsetY) const; + bool getAllowNpcEquipment() const noexcept2 A_WARN_UNUSED + { return mAllowNpcEquipment; } + static Being *createBeing(const BeingId id, const ActorTypeT type, const BeingTypeId subtype, @@ -1377,6 +1380,7 @@ class Being notfinal : public ActorSprite, bool mInactive; bool mNeedPosUpdate; bool mBotAi; + bool mAllowNpcEquipment; }; extern std::list beingInfoCache; -- cgit v1.2.3-60-g2f50