mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-30 17:41:34 +00:00
Merge branch 'lua_fix' into 'master'
Bugfix: add missing type validation in mwlua/objectvariant.hpp See merge request OpenMW/openmw!2963
This commit is contained in:
commit
8e8a539cb7
1 changed files with 3 additions and 1 deletions
|
@ -18,8 +18,10 @@ namespace MWLua
|
|||
mVariant.emplace<SelfObject*>(obj.as<SelfObject*>());
|
||||
else if (obj.is<LObject>())
|
||||
mVariant.emplace<LObject>(obj.as<LObject>());
|
||||
else
|
||||
else if (obj.is<GObject>())
|
||||
mVariant.emplace<GObject>(obj.as<GObject>());
|
||||
else
|
||||
throw std::runtime_error("Expected game object, got: " + LuaUtil::toString(obj));
|
||||
}
|
||||
|
||||
bool isSelfObject() const { return std::holds_alternative<SelfObject*>(mVariant); }
|
||||
|
|
Loading…
Reference in a new issue