mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 09:23:53 +00:00
Add isNullAction() method to fix compiler warning
This commit is contained in:
parent
7a30ef5cc1
commit
844cbc5a14
3 changed files with 11 additions and 3 deletions
|
@ -132,9 +132,12 @@ namespace MWGui
|
||||||
&& !base.get<ESM::Book>()->mBase->mData.mIsScroll)
|
&& !base.get<ESM::Book>()->mBase->mData.mIsScroll)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ((mFilter & Filter_OnlyUsableItems) && typeid(*base.getClass().use(base)) == typeid(MWWorld::NullAction)
|
if ((mFilter & Filter_OnlyUsableItems) && base.getClass().getScript(base).empty())
|
||||||
&& base.getClass().getScript(base).empty())
|
{
|
||||||
return false;
|
boost::shared_ptr<MWWorld::Action> actionOnUse = base.getClass().use(base);
|
||||||
|
if (!actionOnUse || actionOnUse->isNullAction())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,9 @@ namespace MWWorld
|
||||||
|
|
||||||
virtual ~Action();
|
virtual ~Action();
|
||||||
|
|
||||||
|
virtual bool isNullAction() { return false; }
|
||||||
|
///< Is running this action a no-op? (default false)
|
||||||
|
|
||||||
void execute (const Ptr& actor);
|
void execute (const Ptr& actor);
|
||||||
|
|
||||||
void setSound (const std::string& id);
|
void setSound (const std::string& id);
|
||||||
|
|
|
@ -9,6 +9,8 @@ namespace MWWorld
|
||||||
class NullAction : public Action
|
class NullAction : public Action
|
||||||
{
|
{
|
||||||
virtual void executeImp (const Ptr& actor) {}
|
virtual void executeImp (const Ptr& actor) {}
|
||||||
|
|
||||||
|
virtual bool isNullAction() { return true; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue