fix(content): gate duel-death branch on the dying player's own state

The player_death queue decided a death was a duel death by looking up the
challenged opponent (%duel2accept) and checking *their* position. That varp
is set on Challenge and never cleared when you walk away, so a death anywhere
jumped to player_death_duel, which no-ops outside a fight pit — skipping item
loss and respawn entirely. Now mirror the label's own guard: the dying player
must be in a fight pit with an unfinished duel.

Fixes #55

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
max bittkerandClaude committed 2026-08-19 18:04:15 -04:00
1 parent 831c8d215a
commit c4880dc82e
1 file changed
+5 -1
@@ -8,7 +8,11 @@ p_delay(3);
%death = ^false;
[queue,player_death]
if (.finduid(%duel2accept) = true & ~.in_duel_arena(.coord) = true) {
// gate on the dying player's own duel state (mirrors the label's guard). The old
// check (.finduid(%duel2accept) & ~.in_duel_arena(.coord)) looked at the
// challenged player's position, and %duel2accept is set on Challenge and can go
// stale, so a death anywhere could skip item loss + respawn. See issue #55.
if (~in_duel_arena(coord) = true & %duelstatus < ^duelstatus_lost) {
@player_death_duel;
}
~player_death;