diff --git a/src/events/nonRandomEvent.js b/src/events/nonRandomEvent.js index ab955569109f2a9be4bfbc89159b5a6c2e057e57..d6e124fba5428d36a27a16fa2df1538d93652571 100644 --- a/src/events/nonRandomEvent.js +++ b/src/events/nonRandomEvent.js @@ -173,8 +173,8 @@ App.Events.playNonrandomEvent = function() { } d.append(App.Events.renderEventDebugger()); } else { - // pick the next scheduled, nonrandom, or queued event, if there is one - const event = App.Events.getNextNonrandomEvent() || App.Events.dequeueNextQueuedEvent(); + // pick the next scheduled or nonrandom event, if there is one + const event = App.Events.getNextNonrandomEvent(); if (event) { // record the chosen event in 'current' (pre-play!) history as well as current state so that it will serialize out correctly if saved from this passage // WARNING: THIS IS ***NOT*** THE ACTIVE STATE PAGE! @@ -183,8 +183,16 @@ App.Events.playNonrandomEvent = function() { event.execute(d); V.passageSwitchHandler = clearEvent; } else { - // no more events for this week, move on to random events (or ordinary Nonrandom for now, until we get rid of globalThis.nonRandomEvent) - setTimeout(() => Engine.play("Nonrandom Event"), Engine.minDomActionDelay); + // play the next queued event, if there is one + const qEvent = App.Events.dequeueNextQueuedEvent(); + if (qEvent) { + // we don't need to alter history when playing queued events, because the event instance is deterministically at the head of the queue already + qEvent.execute(d); + V.passageSwitchHandler = clearEvent; + } else { + // no more events for this week, move on to random events (or ordinary Nonrandom for now, until we get rid of globalThis.nonRandomEvent) + setTimeout(() => Engine.play("Nonrandom Event"), Engine.minDomActionDelay); + } } } }