aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/game/register.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/game/register.lua b/builtin/game/register.lua
index 5ce8caf3a..7b2b149e3 100644
--- a/builtin/game/register.lua
+++ b/builtin/game/register.lua
@@ -529,11 +529,11 @@ end
core.registered_on_player_hpchanges = { modifiers = { }, loggers = { } }
-function core.registered_on_player_hpchange(player, hp_change)
+function core.registered_on_player_hpchange(player, hp_change, reason)
local last = false
for i = #core.registered_on_player_hpchanges.modifiers, 1, -1 do
local func = core.registered_on_player_hpchanges.modifiers[i]
- hp_change, last = func(player, hp_change)
+ hp_change, last = func(player, hp_change, reason)
if type(hp_change) ~= "number" then
local debuginfo = debug.getinfo(func)
error("The register_on_hp_changes function has to return a number at " ..
@@ -544,7 +544,7 @@ function core.registered_on_player_hpchange(player, hp_change)
end
end
for i, func in ipairs(core.registered_on_player_hpchanges.loggers) do
- func(player, hp_change)
+ func(player, hp_change, reason)
end
return hp_change
end