fixed a bug where a dynamic item would not get saved/loaded at all

This commit is contained in:
minjaesong
2022-02-22 17:12:49 +09:00
parent 1787ad7cdd
commit df6950c0b8
30 changed files with 206 additions and 89 deletions

View File

@@ -2,6 +2,7 @@ package net.torvald.terrarum.savegame
import net.torvald.terrarum.App.printdbg
import net.torvald.terrarum.serialise.Common
import java.io.File
import java.io.IOException
import java.nio.charset.Charset
import java.util.*
@@ -125,8 +126,12 @@ val specversion = 254.toByte()
class VirtualDisk(
/** capacity of 0 makes the disk read-only */
var capacity: Long,
var diskName: ByteArray = ByteArray(NAME_LENGTH)
var diskName: ByteArray = ByteArray(NAME_LENGTH),
var origin: File? = null
): SimpleFileSystem {
override fun getBackingFile() = origin
var extraInfoBytes = ByteArray(16)
val entries = HashMap<EntryID, DiskEntry>()
var isReadOnly: Boolean