CLOSES #2411, CLOSES #2418, CLOSES #2420, CLOSES #2422, CLOSES #2423, CLOSES #2424

This commit is contained in:
bryanthaboi
2026-09-23 05:51:05 -04:00
parent 18661d45a1
commit ebbf4709c8
230 changed files with 11607 additions and 3514 deletions
+11 -3
View File
@@ -636,7 +636,7 @@ function Commands.hide_object(ctx, mapId, objName)
end
function Commands.play_sound(ctx, soundId)
require("src.core.Sound").play(ctx.game.data, soundId)
ctx.lastSfxSrc = require("src.core.Sound").play(ctx.game.data, soundId)
end
-- wait_sound: WaitForSoundToFinish (home/delay.asm:15), the drain that
@@ -646,12 +646,20 @@ local WAIT_SOUND_CEILING = 600
function Commands.wait_sound(ctx)
local Sound = require("src.core.Sound")
if not Sound.sfxBusy() then return end
local src = ctx.lastSfxSrc
ctx.lastSfxSrc = nil
local function busy()
if Sound.sfxBusy() then return true end
if not src then return false end
local ok, playing = pcall(function() return src:isPlaying() end)
return ok and playing and true or false
end
if not busy() then return end
local runner = ctx.runner
local left = WAIT_SOUND_CEILING
runner.waitingCheck = function()
left = left - 1
return left <= 0 or not Sound.sfxBusy()
return left <= 0 or not busy()
end
runner:yield()
end