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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user