1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Merge pull request #1778 from rilian-la-te/fix-obstacle-removal-mechanincs

Fix landmines staying on battlefield after trigger
This commit is contained in:
Ivan Savenko 2023-03-27 17:17:14 +03:00 committed by GitHub
commit e3b5db0ade
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 5 deletions

View File

@ -308,8 +308,6 @@ public:
RESET_STATE,
UPDATE,
REMOVE,
ACTIVATE_AND_UPDATE,
ACTIVATE_AND_REMOVE
};
JsonNode data;

View File

@ -2398,7 +2398,6 @@ void BattleObstaclesChanged::applyBattle(IBattleState * battleState)
case BattleChanges::EOperation::ADD:
battleState->addObstacle(change);
break;
case BattleChanges::EOperation::ACTIVATE_AND_UPDATE:
case BattleChanges::EOperation::UPDATE:
battleState->updateObstacle(change);
break;

View File

@ -5335,9 +5335,9 @@ bool CGameHandler::handleDamageFromObstacle(const CStack * curStack, bool stackI
ObstacleChanges changeInfo;
changeInfo.id = spellObstacle->uniqueID;
if (oneTimeObstacle)
changeInfo.operation = ObstacleChanges::EOperation::ACTIVATE_AND_REMOVE;
changeInfo.operation = ObstacleChanges::EOperation::REMOVE;
else
changeInfo.operation = ObstacleChanges::EOperation::ACTIVATE_AND_UPDATE;
changeInfo.operation = ObstacleChanges::EOperation::UPDATE;
SpellCreatedObstacle changedObstacle;
changedObstacle.uniqueID = spellObstacle->uniqueID;