diff options
author | rubenwardy <rw@rubenwardy.com> | 2018-04-04 18:39:06 +0100 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2018-04-04 18:39:06 +0100 |
commit | f7956d97e2e3071718cff9562b86d332b48e6570 (patch) | |
tree | 0c8fdf802f6cef5d1abe8aa6f56d8cd505177f88 | |
parent | cca278024d2f665d60111192b744ef61c030088d (diff) |
Add default_def for trigger prototype
-rw-r--r-- | api.lua | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -52,7 +52,9 @@ function awards.player_or_nil(name) return awards.players[name] end -local function run_trigger_callbacks(self, player, data, table_func) +local default_def = {} + +function default_def:run_callbacks(player, data, table_func) for i = 1, #self.on do local res = nil local entry = self.on[i] @@ -73,7 +75,9 @@ function awards.register_trigger(tname, tdef) "Passing a callback to register_trigger is not supported in 3.0") tdef.name = tname - tdef.run_callbacks = run_trigger_callbacks + for key, value in pairs(default_def) do + tdef[key] = value + end if tdef.type == "counted" then local old_reg = tdef.on_register |