aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
Diffstat (limited to 'games')
-rw-r--r--games/minimal/mods/test/init.lua4
1 files changed, 4 insertions, 0 deletions
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