mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-20 12:40:21 +02:00
CLOSES #998, CLOSES #1472, CLOSES #1526, CLOSES #1529, CLOSES #1530, CLOSES #1532, CLOSES #1534, CLOSES #1547, CLOSES #1549, CLOSES #1550, CLOSES #1551
This commit is contained in:
@@ -35,6 +35,13 @@ local WILD_SONG = Data.audio.battle.wild
|
||||
-- every song request in order: "the theme was never restored" and "the theme
|
||||
-- was never started" have to read differently. Music.playMap still sets the
|
||||
-- state Music.restoreMap reads, so the real restore path is under test.
|
||||
-- singletons this file stands doubles on; the originals go back at the tail,
|
||||
-- or a later suite in the same process inherits them (a stubbed startWarpTo
|
||||
-- eats every warp after this one)
|
||||
local realPlay, realPlayBattle = Music.play, Music.playBattle
|
||||
local realStartWarpTo = OW.startWarpTo
|
||||
local realEvents = Runtime.events
|
||||
|
||||
local songs = {}
|
||||
Music.play = function(_, song) songs[#songs + 1] = song end
|
||||
local function lastSong() return songs[#songs] end
|
||||
@@ -160,4 +167,8 @@ eq(labResult, "lose", "it still finishes as a loss")
|
||||
eq(Game.save.money, 3000, "no money is lost in the lab")
|
||||
eq(warp, nil, "and the player stays in the lab for OaksLabRivalEndBattleScript")
|
||||
|
||||
OW.startWarpTo = realStartWarpTo
|
||||
Music.play, Music.playBattle = realPlay, realPlayBattle
|
||||
Runtime.install(realEvents, Runtime.hooks)
|
||||
|
||||
S.finish()
|
||||
|
||||
Reference in New Issue
Block a user