devilutionX icon indicating copy to clipboard operation
devilutionX copied to clipboard

Check missile source type to determine death reason

Open StephenCWills opened this issue 1 year ago • 0 comments

This resolves an issue where Runes could be used to PK another player and have them drop their equipment as if they had been killed by a trap or monster.


TARGET_BOTH is only used for a handful of missiles:

  • Fire Wall
  • Lightning Wall
  • Ring of Fire
  • Runes
  • Phasing

For Fire Wall, Lightning Wall, and Ring of Fire, we were already checking missile.IsTrap() which is equivalent to missile.sourceType() == MissileSource::Trap. Therefore, the behavior after the change should match what we were doing before. Phasing is harmless, so the only real change is that Rune missiles will now also use DeathReason::Player.

This logic also just makes more sense compared to the special case for Fire Wall and Lightning Wall.

StephenCWills avatar Oct 19 '24 18:10 StephenCWills