Sfoglia il codice sorgente

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 anni fa
parent
commit
f331386b6f
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      lib/spells/AdventureSpellMechanics.cpp

+ 4 - 1
lib/spells/AdventureSpellMechanics.cpp

@@ -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;