feat: 50 игр на Lua + импорт Roblox для всех + поддержка Lua в плеере #39

Merged
min merged 215 commits from feat/lua-50-games-bundle into main 2026-06-09 21:59:25 +00:00
Showing only changes of commit 701125d17b - Show all commits

View File

@ -1698,8 +1698,21 @@ export function registerRobloxShim(lua, opts) {
function __rbxl_yield_frame()
coroutine.yield(0.05)
end
if type(task) == 'table' then
task.wait = rbx_wait
-- task JS-object из shim ('userdata'/'table'). Сохраняем
-- существующие методы (delay/spawn/defer) и добавляем wait.
if type(task) == 'table' or type(task) == 'userdata' then
local existing = task
local jsDelay = existing.delay
local jsSpawn = existing.spawn
local jsDefer = existing.defer
task = {
wait = rbx_wait,
delay = jsDelay or function(_, fn) if fn then fn() end end,
spawn = jsSpawn or function(fn) if fn then fn() end end,
defer = jsDefer or function(fn) if fn then fn() end end,
synchronize = function() end,
desynchronize = function() end,
}
else
task = { wait = rbx_wait }
end