From 73a1aaf5e08413e2654cb5fad2c556b8325b894e Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 7 Oct 2026 12:30:05 +1300 Subject: [PATCH] fix: MeteorSwarm resist halves that target's damage, not the shared pool (#2691) ## Summary Pre-AOS, a Meteor Swarm target that resists should take half of its share of the damage. Instead the resist branch halves the **shared** `damage` variable: ```csharp var toDeal = damage; if (!Core.AOS && CheckResisted(m)) { damage *= 0.5; // should be toDeal ``` `toDeal` has already been copied, so: - the target that resisted takes **full** damage, and - every target processed after it is halved, once per earlier resist, so a group where several resist ends up taking a fraction of the intended damage for reasons unrelated to their own resist. `ChainLightning` already handles this correctly (`toDeal *= 0.5;`), and this change makes Meteor Swarm match it. The AOS path is unaffected, since resist checks only run pre-AOS. The bug predates ModernUO (it was carried over from RunUO in the first alpha). ## Testing - `dotnet build Projects/UOContent/UOContent.csproj`: 0 warnings, 0 errors. - No unit test: the per-target damage sits inside `Target()`'s queue loop alongside a random resist roll, so testing it would mean refactoring the spell for a one-word fix. Happy to factor out a helper and add one if preferred. --- Projects/UOContent/Spells/Seventh/MeteorSwarm.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/UOContent/Spells/Seventh/MeteorSwarm.cs b/Projects/UOContent/Spells/Seventh/MeteorSwarm.cs index f73fb3111..fd70ea273 100644 --- a/Projects/UOContent/Spells/Seventh/MeteorSwarm.cs +++ b/Projects/UOContent/Spells/Seventh/MeteorSwarm.cs @@ -86,7 +86,7 @@ namespace Server.Spells.Seventh if (!Core.AOS && CheckResisted(m)) { - damage *= 0.5; + toDeal *= 0.5; m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy. }