mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 10:01:00 +01:00
Merge pull request #4025 from rommapp/fix/player-resume-source
fix(player): skip the save load a state immediately discards
This commit is contained in:
@@ -432,12 +432,15 @@ window.EJS_onGameStart = async () => {
|
||||
if (!ready) {
|
||||
console.warn("Game manager not ready for save/state injection");
|
||||
} else {
|
||||
if (props.save) await loadSave(props.save);
|
||||
// A state restores the whole machine, SRAM included, so a save applied
|
||||
// alongside it would be discarded: the state wins when both are set.
|
||||
if (props.state) {
|
||||
await new Promise((resolve) =>
|
||||
setTimeout(resolve, STATE_APPLY_SETTLE_MS),
|
||||
);
|
||||
await loadState(props.state);
|
||||
} else if (props.save) {
|
||||
await loadSave(props.save);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user