Accept a ConstPtr in getBaseGold

openmw-38
scrawl 9 years ago
parent da7ebfde99
commit 5b082be79f

@ -735,7 +735,7 @@ namespace MWClass
customData.mCreatureStats.writeState (state2.mCreatureStats);
}
int Creature::getBaseGold(const MWWorld::Ptr& ptr) const
int Creature::getBaseGold(const MWWorld::ConstPtr& ptr) const
{
return ptr.get<ESM::Creature>()->mBase->mData.mGold;
}

@ -122,7 +122,7 @@ namespace MWClass
virtual void writeAdditionalState (const MWWorld::ConstPtr& ptr, ESM::ObjectState& state) const;
///< Write additional state from \a ptr into \a state.
virtual int getBaseGold(const MWWorld::Ptr& ptr) const;
virtual int getBaseGold(const MWWorld::ConstPtr& ptr) const;
virtual void respawn (const MWWorld::Ptr& ptr) const;

@ -1192,9 +1192,9 @@ namespace MWClass
static_cast<const MWMechanics::CreatureStats&> (customData.mNpcStats).writeState (state2.mCreatureStats);
}
int Npc::getBaseGold(const MWWorld::Ptr& ptr) const
int Npc::getBaseGold(const MWWorld::ConstPtr& ptr) const
{
MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
const MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
if(ref->mBase->mNpdtType != ESM::NPC::NPC_WITH_AUTOCALCULATED_STATS)
return ref->mBase->mNpdt52.mGold;
else

@ -148,7 +148,7 @@ namespace MWClass
const;
///< Write additional state from \a ptr into \a state.
virtual int getBaseGold(const MWWorld::Ptr& ptr) const;
virtual int getBaseGold(const MWWorld::ConstPtr& ptr) const;
virtual bool isClass(const MWWorld::Ptr& ptr, const std::string &className) const;

@ -399,7 +399,7 @@ namespace MWWorld
void Class::writeAdditionalState (const MWWorld::ConstPtr& ptr, ESM::ObjectState& state) const {}
int Class::getBaseGold(const MWWorld::Ptr& ptr) const
int Class::getBaseGold(const MWWorld::ConstPtr& ptr) const
{
throw std::runtime_error("class does not support base gold");
}

@ -320,7 +320,7 @@ namespace MWWorld
static void registerClass (const std::string& key, boost::shared_ptr<Class> instance);
virtual int getBaseGold(const MWWorld::Ptr& ptr) const;
virtual int getBaseGold(const MWWorld::ConstPtr& ptr) const;
virtual bool isClass(const MWWorld::Ptr& ptr, const std::string &className) const;

Loading…
Cancel
Save