File tree Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -6109,16 +6109,27 @@ end
6109
6109
6110
6110
do
6111
6111
local inProgress = {}
6112
+ local vars = {}
6112
6113
6113
- ns . callHook = function ( hook , ... )
6114
- if not class . hooks [ hook ] or inProgress [ hook ] then return ... end
6115
- local vars = { ... }
6114
+ local function load_args ( ... )
6115
+ local count = select ( " # " , ... )
6116
+ if count == 0 then return end
6116
6117
6117
- inProgress [ hook ] = true
6118
- for _ , h in ipairs ( class .hooks [ hook ] ) do
6119
- vars = { h ( unpack ( vars ) ) }
6118
+ for i = 1 , count do
6119
+ vars [ i ] = select ( i , ... )
6120
6120
end
6121
- inProgress [ hook ] = nil
6121
+ end
6122
+
6123
+ ns .callHook = function ( event , ... )
6124
+ if not class .hooks [ event ] or inProgress [ event ] then return ... end
6125
+ wipe ( vars )
6126
+ load_args ( ... )
6127
+
6128
+ inProgress [ event ] = true
6129
+ for i , hook in ipairs ( class .hooks [ event ] ) do
6130
+ load_args ( hook ( unpack ( vars ) ) )
6131
+ end
6132
+ inProgress [ event ] = nil
6122
6133
6123
6134
return unpack ( vars )
6124
6135
end
Original file line number Diff line number Diff line change @@ -6909,7 +6909,7 @@ function state.advance( time )
6909
6909
end
6910
6910
end ]]
6911
6911
6912
- ns .callHook ( " advance_end" , time )
6912
+ time = ns .callHook ( " advance_end" , time ) or time
6913
6913
6914
6914
return time
6915
6915
end
You can’t perform that action at this time.
0 commit comments