mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-21 00:19:29 +02:00
- if special victory condition is present AND there is only one player normal victory condition will be disabled - added new triggered condition, constant value - if target of CONTROL/DESTROY condition is removed from map, triggered condition will be replaced with constant - fixed randomization of armies with random stacks
This commit is contained in:
@ -358,6 +358,27 @@ DLL_LINKAGE void RemoveObject::applyGs( CGameState *gs )
|
||||
}
|
||||
}
|
||||
|
||||
for (TriggeredEvent & event : gs->map->triggeredEvents)
|
||||
{
|
||||
auto patcher = [&](EventCondition & cond)
|
||||
{
|
||||
if (cond.object == obj)
|
||||
{
|
||||
if (cond.condition == EventCondition::DESTROY)
|
||||
{
|
||||
cond.condition = EventCondition::CONST_VALUE;
|
||||
cond.value = 1; // destroyed object, from now on always fulfilled
|
||||
}
|
||||
if (cond.condition == EventCondition::CONTROL)
|
||||
{
|
||||
cond.condition = EventCondition::CONST_VALUE;
|
||||
cond.value = 0; // destroyed object, from now on can not be fulfilled
|
||||
}
|
||||
}
|
||||
};
|
||||
event.trigger.forEach(patcher);
|
||||
}
|
||||
|
||||
gs->map->objects[id.getNum()].dellNull();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user