Minimal: Fix HP change crash (#7344)

master
SmallJoker 2018-05-16 19:36:30 +02:00
parent a1868e8f6c
commit 2edeafb97b
1 changed files with 4 additions and 0 deletions

View File

@ -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