mirror of
https://github.com/vcmi/vcmi.git
synced 2026-06-19 22:57:37 +02:00
Clear stale special action before assigning battle node action
Battle nodes may be reused or updated without receiving a new special action from the destination node. Reset specialAction first so stale actions from a previous node state are not accidentally preserved. This keeps generated battle paths from executing unrelated special actions.
This commit is contained in:
@@ -331,6 +331,8 @@ namespace AIPathfinding
|
||||
|
||||
if(loss < actualArmyValue)
|
||||
{
|
||||
battleNode->specialAction = nullptr;
|
||||
|
||||
if(destNode->specialAction)
|
||||
{
|
||||
battleNode->specialAction = destNode->specialAction;
|
||||
|
||||
Reference in New Issue
Block a user