Skip to content

fix: soul drain death check for StatusEffect upfront damage#316

Merged
mokn merged 1 commit intomainfrom
hotfix/soul-drain-death-check
Mar 29, 2026
Merged

fix: soul drain death check for StatusEffect upfront damage#316
mokn merged 1 commit intomainfrom
hotfix/soul-drain-death-check

Conversation

@mokn
Copy link
Copy Markdown
Collaborator

@mokn mokn commented Mar 29, 2026

Summary

  • Adds missing death check in CombatSystem's StatusEffect branch after upfront spell damage
  • Without this, damage_debuff spells (Soul Drain, Marked Shot, Expose Weakness, Entangle) bring enemies to 0 HP but never set the died flag — creating unkillable zombie enemies
  • Includes regression test

Root Cause

_calculateStatusEffect applies upfront spell damage and clamps HP to 0, but the StatusEffect branch never sets actionOutcomeData.defenderDied = true. The PhysicalDamage and MagicDamage branches both had this check; StatusEffect was missing it.

Test plan

  • forge build passes (exit 0)
  • All 55 SpellCombatUnit tests pass
  • Deployed and verified on beta (0xDc34...5678)
  • Regression test (SoulDrainKill.integration.t.sol) — needs local devnode

🤖 Generated with Claude Code

…path

StatusEffect branch in CombatSystem applied upfront spell damage (via
_calculateStatusEffect) but never checked if it killed the defender.
PhysicalDamage and MagicDamage branches both had `if (currentHp <= 0)
defenderDied = true` but StatusEffect was missing it entirely.

This caused damage_debuff spells (Soul Drain, Marked Shot, Expose Weakness,
Entangle) to bring enemies to 0 HP without triggering the death flag,
creating unkillable zombie enemies that fight forever.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Mar 29, 2026 4:16pm
ud Error Error Mar 29, 2026 4:16pm
ud-api Error Error Mar 29, 2026 4:16pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ud-api-beta Ignored Ignored Mar 29, 2026 4:16pm

Request Review

@mokn mokn merged commit 3a78266 into main Mar 29, 2026
6 of 9 checks passed
@mokn mokn deleted the hotfix/soul-drain-death-check branch March 29, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant