summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-05 15:36:31 +0200
committerWuzzy <almikes@aol.com>2016-08-05 15:36:31 +0200
commitabbf00314547b5d523855798b92e7c22ac6ad5ed (patch)
treecde50b8696b4057ef47da2214a00023a6ffa6884
parent30b0b41e3e6bea1bf54b400d45bc01251d964a8e (diff)
Fix crash when poisoned player leaves server
-rw-r--r--hunger.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/hunger.lua b/hunger.lua
index b181c2e..bf0ae8f 100644
--- a/hunger.lua
+++ b/hunger.lua
@@ -50,6 +50,10 @@ end
-- Poison player
local function poisenp(tick, time, time_left, player)
+ -- First check if player is still there
+ if not player:is_player() then
+ return
+ end
time_left = time_left + tick
if time_left < time then
minetest.after(tick, poisenp, tick, time, time_left, player)