From: SmallJoker Date: Wed, 16 May 2018 17:36:30 +0000 (+0200) Subject: Minimal: Fix HP change crash (#7344) X-Git-Tag: 5.0.0~407 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2edeafb97b40f643e559bd347b9846d98eb09f63;p=oweals%2Fminetest.git Minimal: Fix HP change crash (#7344) --- diff --git a/games/minimal/mods/test/init.lua b/games/minimal/mods/test/init.lua index 3141b4cf3..4806ba4fc 100644 --- a/games/minimal/mods/test/init.lua +++ b/games/minimal/mods/test/init.lua @@ -27,6 +27,10 @@ local function run_hpchangereason_tests(player) assert(expect == nil) end minetest.register_on_player_hpchange(function(player, hp, reason) + if not expect then + return + end + for key, value in pairs(reason) do assert(expect[key] == value) end