mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Dimension door movement points fix
When hero with one move point make dimension doors then he can have on graphics full move points. Caused by substraction that make unsigned variable < 0.
This commit is contained in:
parent
c7fbbb1248
commit
f331386b6f
@ -322,7 +322,10 @@ ESpellCastResult DimensionDoorMechanics::applyAdventureEffects(const SpellCastEn
|
||||
{
|
||||
SetMovePoints smp;
|
||||
smp.hid = parameters.caster->id;
|
||||
smp.val = std::max<ui32>(0, parameters.caster->movement - movementCost);
|
||||
if(movementCost < parameters.caster->movement)
|
||||
smp.val = parameters.caster->movement - movementCost;
|
||||
else
|
||||
smp.val = 0;
|
||||
env->sendAndApply(&smp);
|
||||
}
|
||||
return ESpellCastResult::OK;
|
||||
|
Loading…
Reference in New Issue
Block a user