1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Proper fix for #1712 - Building requirement tests are now fixed

- added minimize() method in logical expressions that will remove excessive elements
- replaced forEach() with morph() that allows replacing types in variant
This commit is contained in:
Ivan Savenko
2014-08-07 19:40:22 +03:00
parent 4d6ab2c32d
commit d1dd7eef48
8 changed files with 115 additions and 55 deletions

View File

@@ -396,7 +396,7 @@ DLL_LINKAGE void RemoveObject::applyGs( CGameState *gs )
for (TriggeredEvent & event : gs->map->triggeredEvents)
{
auto patcher = [&](EventCondition & cond)
auto patcher = [&](EventCondition cond) -> EventExpression::Variant
{
if (cond.object == obj)
{
@@ -411,8 +411,9 @@ DLL_LINKAGE void RemoveObject::applyGs( CGameState *gs )
cond.value = 0; // destroyed object, from now on can not be fulfilled
}
}
return cond;
};
event.trigger.forEach(patcher);
event.trigger = event.trigger.morph(patcher);
}
gs->map->objects[id.getNum()].dellNull();