mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 02:54:04 +09:00
fix: savegame playtime was calculated wrongly
This commit is contained in:
@@ -439,7 +439,7 @@ open class IngameInstance(val batch: FlippingSpriteBatch, val isMultiplayer: Boo
|
|||||||
}
|
}
|
||||||
|
|
||||||
open fun saveTheGame(onSuccessful: () -> Unit, onError: (Throwable) -> Unit) {
|
open fun saveTheGame(onSuccessful: () -> Unit, onError: (Throwable) -> Unit) {
|
||||||
|
loadedTime_t = App.getTIME_T()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -495,6 +495,8 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
|||||||
|
|
||||||
App.savegameWorlds[world.worldIndex] = SavegameCollection.collectFromBaseFilename(File(worldsDir), worldSavefileName)
|
App.savegameWorlds[world.worldIndex] = SavegameCollection.collectFromBaseFilename(File(worldsDir), worldSavefileName)
|
||||||
App.savegameWorldsName[world.worldIndex] = worldName
|
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
|
// return to normal state
|
||||||
onSuccessful()
|
onSuccessful()
|
||||||
|
|
||||||
|
loadedTime_t = App.getTIME_T()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1414,6 +1418,9 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
|||||||
val timeDiff = System.nanoTime() - start
|
val timeDiff = System.nanoTime() - start
|
||||||
debugTimers.put("Last Autosave Duration", timeDiff)
|
debugTimers.put("Last Autosave Duration", timeDiff)
|
||||||
printdbg(this, "Last Autosave Duration: ${(timeDiff) / 1000000000} s")
|
printdbg(this, "Last Autosave Duration: ${(timeDiff) / 1000000000} s")
|
||||||
|
|
||||||
|
|
||||||
|
loadedTime_t = App.getTIME_T()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user