1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00
vcmi/test/mock
Toney Sui dca5d86e7a
Fix bug: LandMine is not exploding to enemies. (#630)
* The reason is,

the mine has attribute hidden=true;
when enemy unit moves, the code in BattleInfo.cpp MoveUnit() (line 817) will update the revealed to true;
then in the CGameHandler.cpp handleDamageFromObstacle() (line 4846) is checking , and the condition battleIsObstacleVisibleForSide() will return true, so the effect will not be triggerred.

Resolution:
1. Remove the "revealed=true" in moveUnit(), and in handleDamageFromObstacle, remove the "const" restrict for obstacle, and then update revealed to true;
2. After the takeDamage function, add a pack "BattleObstaclesChanged" to update the obstacle to be "revealed=true".
2020-02-12 20:12:12 +03:00
..
mock_battle_IBattleState.h Fix bug: LandMine is not exploding to enemies. (#630) 2020-02-12 20:12:12 +03:00
mock_battle_Unit.h Fixed https://bugs.vcmi.eu/view.php?id=2904 2018-03-04 11:15:24 +03:00
mock_BonusBearer.cpp Make bonus stacking configurable + fix duplicate propagation/inheritance (#433) 2018-03-27 14:54:58 +07:00
mock_BonusBearer.h Spells configuration version 2 (effect-based) 2018-02-08 11:37:21 +03:00
mock_CPSICallback.cpp [c::b] Updated projects, applied fixes 2018-07-29 22:07:40 +03:00
mock_CPSICallback.h [c::b] Updated projects, applied fixes 2018-07-29 22:07:40 +03:00
mock_IGameCallback.cpp CGameHandler: rename CPackForClient argument and add network logging 2018-04-04 14:24:32 +07:00
mock_IGameCallback.h [c::b] Updated projects, applied fixes 2018-07-29 22:07:40 +03:00
mock_MapService.cpp Throw std::runtime_exception instead of a pointer to new one 2018-10-31 07:27:54 +01:00
mock_MapService.h Spells configuration version 2 (effect-based) 2018-02-08 11:37:21 +03:00
mock_spells_Mechanics.h Spells configuration version 2 (effect-based) 2018-02-08 11:37:21 +03:00
mock_spells_Problem.h Spells configuration version 2 (effect-based) 2018-02-08 11:37:21 +03:00
mock_spells_Spell.h Issue2888 (#421) 2018-03-02 13:22:51 +03:00
mock_UnitEnvironment.h Spells configuration version 2 (effect-based) 2018-02-08 11:37:21 +03:00
mock_UnitInfo.h Spells configuration version 2 (effect-based) 2018-02-08 11:37:21 +03:00
mock_vstd_RNG.h Spells configuration version 2 (effect-based) 2018-02-08 11:37:21 +03:00