mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-12 08:21:02 +02:00
Squadhing som bug (#130)
* squashy squash * squassshheee CLOSES #128 CLOSES #114 CLOSES #113 CLOSES #111 CLOSES #110 CLOSES #109 CLOSES #107 CLOSES #106 CLOSES #105 CLOSES #90 CLOSES #103 * brock guy fix CLOSES #39
This commit is contained in:
@@ -536,6 +536,32 @@ do
|
||||
"newGame starts an empty modData")
|
||||
check(plain.meta.format == Version.saveFormat and #plain.meta.mods == 0,
|
||||
"newGame stamps a vanilla meta")
|
||||
check(plain.pcItems and plain.pcItems.POTION == 1,
|
||||
"unhooked newGame seeds 1 Potion in pcItems (issue #109)")
|
||||
end
|
||||
|
||||
-- issue #109: loading a pre-fix save that never had pcItems must not
|
||||
-- invent a free Potion (player may already have withdrawn/tossed it, or
|
||||
-- the empty PC is intentional). Seeding is New Game only.
|
||||
do
|
||||
local files = {}
|
||||
love.filesystem = memfs(files)
|
||||
local legacy = {
|
||||
meta = { format = Version.saveFormat, mods = {} },
|
||||
player = { map = "PALLET_TOWN", x = 5, y = 6, facing = "down",
|
||||
name = "RED", rival = "BLUE", id = 1 },
|
||||
flags = {}, inventory = {}, party = {}, box = {}, money = 3000,
|
||||
defeatedTrainers = {}, pokedex = { seen = {}, owned = {} },
|
||||
lastHeal = { map = "PALLET_TOWN", x = 5, y = 6 },
|
||||
options = SaveData.defaultOptions(),
|
||||
}
|
||||
check(legacy.pcItems == nil, "fixture omits pcItems on purpose")
|
||||
check(SaveData.save(legacy), "legacy save without pcItems writes")
|
||||
local loaded = SaveData.load()
|
||||
check(loaded ~= nil, "legacy save loads")
|
||||
check(loaded.pcItems == nil or loaded.pcItems.POTION == nil,
|
||||
"load does not invent a PC Potion for existing saves")
|
||||
love.filesystem = realFS
|
||||
end
|
||||
|
||||
-- a throwing mod migration is skipped, never fatal: an uncaught error here
|
||||
|
||||
Reference in New Issue
Block a user