Skip to content

Commit

Permalink
Merge pull request CleverRaven#71161 from rtxyd/fix-aftershock-migration
Browse files Browse the repository at this point in the history
Fix Aftershock bionic migration conflict
  • Loading branch information
akrieger authored Jan 22, 2024
2 parents 1c310e7 + 866a589 commit 751aac4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions data/mods/Aftershock/migration.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"replace": "quilt_patchwork"
},
{
"id": [ "bio_microgen" ],
"id": [ "bio_trickle" ],
"type": "MIGRATION",
"//": "obsoleted from base game as part of https://github.com/CleverRaven/Cataclysm-DDA/pull/70989",
"replace": "bio_trickle"
"replace": "bio_microgen"
},
{
"id": [ "bio_microgen" ],
"to": "bio_microgen",
"type": "bionic_migration",
"//": "obsoleted from base game as part of https://github.com/CleverRaven/Cataclysm-DDA/pull/70989",
"replace": "bio_trickle"
"from": "bio_trickle"
}
]
6 changes: 6 additions & 0 deletions src/bionics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,12 @@ void bionic_data::load_bionic_migration( const JsonObject &jo, const std::string
? bionic_id( jo.get_string( "to" ) )
: bionic_id::NULL_ID();
migrations.emplace( from, to );
// if delete bionics id before migration, cant migration
// if key showed once, and its null, delete previous null one
auto iter = migrations.find( from );
if( iter != migrations.end() && ( *iter ).second.is_null() ) {
migrations.erase( iter );
}
}

void bionic_data::finalize_bionic()
Expand Down

0 comments on commit 751aac4

Please sign in to comment.