fix: Fixes mana drain crash on debug builds (#1413)

This commit is contained in:
vexyl 2023-06-21 00:22:47 -04:00 committed by GitHub
parent 5e16149b81
commit 8f26ad4ac1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,13 +62,9 @@ namespace Server.Spells.Fourth
{ {
m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy. m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
} }
else if (m.Mana >= 100) else if (m.Mana > 0)
{ {
m.Mana -= Utility.Random(1, 100); m.Mana -= Utility.Random(1, Math.Min(m.Mana, 100));
}
else
{
m.Mana -= Utility.Random(1, m.Mana);
} }
m.FixedParticles(0x374A, 10, 15, 5032, EffectLayer.Head); m.FixedParticles(0x374A, 10, 15, 5032, EffectLayer.Head);