From 1579c47a584e2aeeb3bbbd71bafd2277e11d402f Mon Sep 17 00:00:00 2001 From: 4Evergreen4 <4Evergreen4@users.noreply.github.com> Date: Thu, 20 Mar 2014 10:25:56 -0400 Subject: [PATCH] Change drowning detection to player:get_breath() --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index dcae4a4..cc19322 100644 --- a/init.lua +++ b/init.lua @@ -57,7 +57,7 @@ if RANDOM_MESSAGES == true then if node.groups.lava ~= nil then minetest.chat_send_all(player_name .. messages.lava[math.random(1,#messages.lava)] ) -- Death by drowning - elseif node.groups.water ~= nil then + elseif player:get_breath() == 0 then minetest.chat_send_all(player_name .. messages.water[math.random(1,#messages.water)] ) -- Death by fire elseif node.name == "fire:basic_flame" then @@ -80,7 +80,7 @@ else if node.groups.lava ~= nil then minetest.chat_send_all(player_name .. " melted into a ball of fire") -- Death by drowning - elseif node.groups.water ~= nil then + elseif player:get_breath() == 0 then minetest.chat_send_all(player_name .. " ran out of air.") -- Death by fire elseif node.name == "fire:basic_flame" then