Skip to content

Commit 751aac4

Browse files
authored
Merge pull request CleverRaven#71161 from rtxyd/fix-aftershock-migration
Fix Aftershock bionic migration conflict
2 parents 1c310e7 + 866a589 commit 751aac4

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

data/mods/Aftershock/migration.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
"replace": "quilt_patchwork"
1111
},
1212
{
13-
"id": [ "bio_microgen" ],
13+
"id": [ "bio_trickle" ],
1414
"type": "MIGRATION",
1515
"//": "obsoleted from base game as part of https://github.com/CleverRaven/Cataclysm-DDA/pull/70989",
16-
"replace": "bio_trickle"
16+
"replace": "bio_microgen"
1717
},
1818
{
19-
"id": [ "bio_microgen" ],
19+
"to": "bio_microgen",
2020
"type": "bionic_migration",
2121
"//": "obsoleted from base game as part of https://github.com/CleverRaven/Cataclysm-DDA/pull/70989",
22-
"replace": "bio_trickle"
22+
"from": "bio_trickle"
2323
}
2424
]

src/bionics.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,12 @@ void bionic_data::load_bionic_migration( const JsonObject &jo, const std::string
482482
? bionic_id( jo.get_string( "to" ) )
483483
: bionic_id::NULL_ID();
484484
migrations.emplace( from, to );
485+
// if delete bionics id before migration, cant migration
486+
// if key showed once, and its null, delete previous null one
487+
auto iter = migrations.find( from );
488+
if( iter != migrations.end() && ( *iter ).second.is_null() ) {
489+
migrations.erase( iter );
490+
}
485491
}
486492

487493
void bionic_data::finalize_bionic()

0 commit comments

Comments
 (0)