Add isNullAction() method to fix compiler warning

pull/1/head
scrawl 9 years ago
parent 7a30ef5cc1
commit 844cbc5a14

@ -132,9 +132,12 @@ namespace MWGui
&& !base.get<ESM::Book>()->mBase->mData.mIsScroll)
return false;
if ((mFilter & Filter_OnlyUsableItems) && typeid(*base.getClass().use(base)) == typeid(MWWorld::NullAction)
&& base.getClass().getScript(base).empty())
return false;
if ((mFilter & Filter_OnlyUsableItems) && base.getClass().getScript(base).empty())
{
boost::shared_ptr<MWWorld::Action> actionOnUse = base.getClass().use(base);
if (!actionOnUse || actionOnUse->isNullAction())
return false;
}
return true;
}

@ -32,6 +32,9 @@ namespace MWWorld
virtual ~Action();
virtual bool isNullAction() { return false; }
///< Is running this action a no-op? (default false)
void execute (const Ptr& actor);
void setSound (const std::string& id);

@ -9,6 +9,8 @@ namespace MWWorld
class NullAction : public Action
{
virtual void executeImp (const Ptr& actor) {}
virtual bool isNullAction() { return true; }
};
}

Loading…
Cancel
Save