From b2aaa61286c1e3a107df7fcd8d63086b360aa0f6 Mon Sep 17 00:00:00 2001 From: mekolat Date: Thu, 30 Oct 2014 14:11:59 -0400 Subject: add global death handler --- world/map/npc/009-7/core.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'world/map/npc/009-7/core.txt') diff --git a/world/map/npc/009-7/core.txt b/world/map/npc/009-7/core.txt index a6c0c0f0..3a92a928 100644 --- a/world/map/npc/009-7/core.txt +++ b/world/map/npc/009-7/core.txt @@ -347,6 +347,7 @@ L_Return: function|script|fightclub_death|, // ** called by event handler whenever someone dies { if(@Duel_Fighter != 1) goto L_NoDuel; + if(($@Duel_CurrentDuel < 1) || ($@Duel_Started != 1)) goto L_Reset; if(@killerrid != 0) goto L_Murdered; goto L_Killed; @@ -396,11 +397,16 @@ L_Stranger: // the victim was not murdered by its adversary (wtf) if(debug) donpcevent "Debug#Duels::OnKillerNotInDuel"; callfunc "fightclub_EmergencyWipe"; - end; + return; L_NoDuel: if(debug) donpcevent "Debug#Duels::OnVictimNotInDuel"; - end; + return; + +L_Reset: // the player has duel_fighter but no duel is ongoing (happens if the player quit before fightclub_exit can be called) + if(debug) donpcevent "Debug#Duels::OnVictimInDuelNoDuel"; + callfunc "fightclub_DestroyMe"; // here we attempt to resume the interrupted procedure + return; } function|script|fightclub_enter|, // ** called every time a player enters the ring -- cgit v1.2.3-70-g09d2