mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
Fixes lua function SS13.wait. (#85427)
## About The Pull Request See title. It's broken because it's not resuming the proper yielded coroutine, it's getting the global next yield index. ## Why It's Good For The Game Fixes SS13.wait breaking if called more than once. ## Changelog 🆑 fix: Fixes SS13.wait not working when called multiple times before it finishes waiting. /🆑 Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
This commit is contained in:
co-authored by
Watermelon914
parent
134a84d824
commit
6577c58b94
+2
-1
@@ -60,8 +60,9 @@ __Timer_timer_process = function(seconds_per_tick)
|
||||
end
|
||||
|
||||
function Timer.wait(time)
|
||||
local yieldIndex = _exec.next_yield_index
|
||||
__add_internal_timer(function()
|
||||
SSlua:queue_resume(state.state, _exec.next_yield_index)
|
||||
SSlua:queue_resume(state.state, yieldIndex)
|
||||
end, time * 10, false)
|
||||
coroutine.yield()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user