Add check for 24th day completion

This commit is contained in:
Seth Posner 2022-12-24 01:00:21 -08:00
parent 03f6325704
commit 0c5f45548d

View file

@ -134,7 +134,8 @@ export async function loadSave(playerObj: Partial<PlayerData>): Promise<void> {
setInterval(() => { setInterval(() => {
if ( if (
player.autosave && player.autosave &&
(layers as any).main.days[(layers as any).main.day.value - 1].opened.value ((layers as any).main.day.value >= 25 ||
(layers as any).main.days[(layers as any).main.day.value - 1].opened.value)
) { ) {
save(); save();
} }
@ -142,7 +143,8 @@ setInterval(() => {
window.onbeforeunload = () => { window.onbeforeunload = () => {
if ( if (
player.autosave && player.autosave &&
((layers as any).main.days[(layers as any).main.day.value - 1].opened.value || ((layers as any).main.day.value >= 25 ||
(layers as any).main.days[(layers as any).main.day.value - 1].opened.value ||
import.meta.env.DEV) import.meta.env.DEV)
) { ) {
save(); save();