fix: Fixes mana vampire creating mana from thin air (#1561)

This commit is contained in:
mark1145 2023-10-22 20:07:14 +01:00 committed by GitHub
parent 68f3e15e5b
commit f6491c0fe5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,8 +57,14 @@ namespace Server.Spells.Seventh
}
}
m.Mana -= Math.Clamp(toDrain, 0, Math.Min(m.Mana, Caster.ManaMax - Caster.Mana));
Caster.Mana += toDrain;
// Will not drain more than the target has currently and will not put the caster over his maximum mana
toDrain = Math.Clamp(toDrain, 0, Math.Min(m.Mana, Caster.ManaMax - Caster.Mana));
if (toDrain > 0)
{
m.Mana -= toDrain;
Caster.Mana += toDrain;
}
if (Core.AOS)
{