From f6491c0fe576e53090ad361a81a381db0c1c8144 Mon Sep 17 00:00:00 2001 From: mark1145 Date: Sun, 22 Oct 2023 20:07:14 +0100 Subject: [PATCH] fix: Fixes mana vampire creating mana from thin air (#1561) --- Projects/UOContent/Spells/Seventh/ManaVampire.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Projects/UOContent/Spells/Seventh/ManaVampire.cs b/Projects/UOContent/Spells/Seventh/ManaVampire.cs index 02b07b385..f98d330b7 100644 --- a/Projects/UOContent/Spells/Seventh/ManaVampire.cs +++ b/Projects/UOContent/Spells/Seventh/ManaVampire.cs @@ -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) {