Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

Invalid or misplaced field name "baby_type" in JSON data

Open alef opened this issue 1 year ago • 2 comments

Describe the bug

Invalid or misplaced field name "baby_type" in JSON data when loading a game.

Maybe #76266 ?

Attach save file

N/A

Steps to reproduce

Load any game.

Expected behavior

No errors.

Screenshots

See debug.log

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19045.4780 (22H2)
  • Game Version: 6dc777e2c [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], Portal Storms Ignore NPCs [personal_portal_storms], Slowdown Fungal Growth [no_fungal_growth] ]

Additional context

debug.log

alef avatar Sep 10 '24 19:09 alef

Your version of the game is from 3 days ago, 76266 was merged only 17 hours ago Seems to be mismatch between your code and your json

GuardianDll avatar Sep 11 '24 06:09 GuardianDll

There is something wrong in master (and I don't really care which PR brought it in). This is from the failure of "General build matrix / Basic Build and Test (Clang 10, Ubuntu, Curses) (pull_request)" of #76340: Error: (all_mods)=> Invalid or misplaced field name "baby_egg" in JSON data

"anger_triggers": [ "STALK", "PLAYER_WEAK", "HURT", "PLAYER_CLOSE" ],
"flags": [ "SEES", "SMELLS", "HEARS", "CLIMBS", "PATH_AVOID_FIRE", "PATH_AVOID_FALL" ],
"reproduction": { "baby_egg": "caff_gum", "baby_count": 10, "baby_timer": 5 },
                            ▲▲▲
"armor": { "bash": 4, "cut": 8, "bullet": 6 }

},

(all_mods)=> 23:44:54.498 INFO : Game data loaded, running Catch2 session: (all_mods)=> Filters: [force_load_game]

It can be noted that the code compiled for that PR did not fail on load, and the above malformed JSON does not exist in the branch uploaded to that PR.

It can be noted all the 152 instances of "baby_egg" in that branch's JSON follow this pattern: "reproduction": { "baby_type": { "baby_egg": "egg_vocal_frog" }, "baby_count": 12, "baby_timer": 20 }, i.e. a "baby_type" entry enclosing the "baby_egg" one.

Edit: A master from a couple of hours ago does not contain this issue, so I would assume it has been fixed.

PatrikLundell avatar Sep 11 '24 10:09 PatrikLundell

it fixed somehow in b35342fa or earlier

alef avatar Sep 14 '24 15:09 alef

in #76349

GuardianDll avatar Sep 14 '24 16:09 GuardianDll