فهرست منبع

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.
FeniksFire 8 سال پیش
والد
کامیت
f331386b6f
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      lib/spells/AdventureSpellMechanics.cpp

+ 4 - 1
lib/spells/AdventureSpellMechanics.cpp

@@ -322,7 +322,10 @@ ESpellCastResult DimensionDoorMechanics::applyAdventureEffects(const SpellCastEn
 	{
 	{
 		SetMovePoints smp;
 		SetMovePoints smp;
 		smp.hid = parameters.caster->id;
 		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);
 		env->sendAndApply(&smp);
 	}
 	}
 	return ESpellCastResult::OK;
 	return ESpellCastResult::OK;