fix: savegame playtime was calculated wrongly

This commit is contained in:
minjaesong
2024-03-03 03:15:35 +09:00
parent f19a27065e
commit 514a972bcf
2 changed files with 8 additions and 1 deletions

View File

@@ -439,7 +439,7 @@ open class IngameInstance(val batch: FlippingSpriteBatch, val isMultiplayer: Boo
}
open fun saveTheGame(onSuccessful: () -> Unit, onError: (Throwable) -> Unit) {
loadedTime_t = App.getTIME_T()
}
/**

View File

@@ -495,6 +495,8 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
App.savegameWorlds[world.worldIndex] = SavegameCollection.collectFromBaseFilename(File(worldsDir), worldSavefileName)
App.savegameWorldsName[world.worldIndex] = worldName
loadedTime_t = App.getTIME_T()
}
}
}
@@ -1184,6 +1186,8 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
// return to normal state
onSuccessful()
loadedTime_t = App.getTIME_T()
}
}
}
@@ -1414,6 +1418,9 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
val timeDiff = System.nanoTime() - start
debugTimers.put("Last Autosave Duration", timeDiff)
printdbg(this, "Last Autosave Duration: ${(timeDiff) / 1000000000} s")
loadedTime_t = App.getTIME_T()
}
}