From 69137c9ebaf0b7a6abfe7c4da7f944d8e9cd1cb7 Mon Sep 17 00:00:00 2001 From: xxyheaven <1433191064@qq.com> Date: Sun, 13 Aug 2023 01:40:08 +0800 Subject: [PATCH] Update death.lua (#247) --- lua/server/events/death.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lua/server/events/death.lua b/lua/server/events/death.lua index 6230bb0b..e0fce3cf 100644 --- a/lua/server/events/death.lua +++ b/lua/server/events/death.lua @@ -23,12 +23,20 @@ GameEvent.functions[GameEvent.Dying] = function(self) end logic:trigger(fk.AskForPeachesDone, dyingPlayer, dyingStruct) end +end - if not dyingPlayer.dead and dyingPlayer.dying then +GameEvent.exit_funcs[GameEvent.Dying] = function(self) + local room = self.room + local logic = room.logic + local dyingStruct = self.data[1] + + local dyingPlayer = room:getPlayerById(dyingStruct.who) + + if dyingPlayer.dying then dyingPlayer.dying = false room:broadcastProperty(dyingPlayer, "dying") end - logic:trigger(fk.AfterDying, dyingPlayer, dyingStruct) + logic:trigger(fk.AfterDying, dyingPlayer, dyingStruct, self.interrupted) end GameEvent.prepare_funcs[GameEvent.Death] = function(self)