mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-04 00:15:53 +02:00
Fix possibilities to get outdated movement points info due to creature types
This commit is contained in:
parent
4e927d6417
commit
96b18b1b8e
@ -228,6 +228,7 @@ void ApplyClientNetPackVisitor::visitSetStackType(SetStackType & pack)
|
||||
void ApplyClientNetPackVisitor::visitEraseStack(EraseStack & pack)
|
||||
{
|
||||
dispatchGarrisonChange(cl, pack.army, ObjectInstanceID());
|
||||
cl.invalidatePaths(); //it is possible to remove last non-native unit for current terrain and lose movement penalty
|
||||
}
|
||||
|
||||
void ApplyClientNetPackVisitor::visitSwapStacks(SwapStacks & pack)
|
||||
@ -243,6 +244,9 @@ void ApplyClientNetPackVisitor::visitInsertNewStack(InsertNewStack & pack)
|
||||
void ApplyClientNetPackVisitor::visitRebalanceStacks(RebalanceStacks & pack)
|
||||
{
|
||||
dispatchGarrisonChange(cl, pack.srcArmy, pack.dstArmy);
|
||||
|
||||
if(pack.srcArmy != pack.dstArmy)
|
||||
cl.invalidatePaths(); // adding/removing units may change terrain type penalty based on creature native terrains
|
||||
}
|
||||
|
||||
void ApplyClientNetPackVisitor::visitBulkRebalanceStacks(BulkRebalanceStacks & pack)
|
||||
@ -253,6 +257,9 @@ void ApplyClientNetPackVisitor::visitBulkRebalanceStacks(BulkRebalanceStacks & p
|
||||
? ObjectInstanceID()
|
||||
: pack.moves[0].dstArmy;
|
||||
dispatchGarrisonChange(cl, pack.moves[0].srcArmy, destArmy);
|
||||
|
||||
if(pack.moves[0].srcArmy != destArmy)
|
||||
cl.invalidatePaths(); // adding/removing units may change terrain type penalty based on creature native terrains
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user