1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-12-12 16:43:06 +00:00

Ignore missing global variables when filtering dialogue

This commit is contained in:
Evil Eye 2025-01-21 20:31:12 +01:00
parent a645ec0910
commit 7d2dd3422d

View file

@ -301,9 +301,13 @@ bool MWDialogue::Filter::testSelectStructNumeric(const SelectWrapper& select) co
switch (select.getFunction())
{
case ESM::DialogueCondition::Function_Global:
{
const auto& world = MWBase::Environment::get().getWorld();
if (world->getGlobalVariableType(select.getName()) == ' ')
return true; // ignore this filter if the global doesn't exist
// internally all globals are float :(
return select.selectCompare(MWBase::Environment::get().getWorld()->getGlobalFloat(select.getName()));
return select.selectCompare(world->getGlobalFloat(select.getName()));
}
case ESM::DialogueCondition::Function_Local:
{