From 7ef57227bb67026892771cebf34afffe9f099b6d Mon Sep 17 00:00:00 2001 From: rtxyd <65117312+rtxyd@users.noreply.github.com> Date: Sun, 13 Aug 2023 19:09:11 +0800 Subject: [PATCH 1/4] fix smoking racks delete calories --- src/iexamine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/iexamine.cpp b/src/iexamine.cpp index e36cc11b4982b..d2435520ec5a8 100644 --- a/src/iexamine.cpp +++ b/src/iexamine.cpp @@ -5927,7 +5927,7 @@ static void smoker_finalize( Character &, const tripoint &examp, const time_poin } else { it.calc_rot_while_processing( 6_hours ); - item result( it.get_comestible()->smoking_result, start_time + 6_hours, it.charges ); + item result( it.get_comestible()->smoking_result, start_time + 6_hours, it.count() ); // Set flag to tell set_relative_rot() to calc from bday not now result.set_flag( flag_PROCESSING_RESULT ); @@ -5944,7 +5944,7 @@ static void smoker_finalize( Character &, const tripoint &examp, const time_poin } result.components.add( it ); // Smoking is always 1:1, so these must be equal for correct kcal/vitamin calculation. - result.recipe_charges = it.charges; + result.recipe_charges = it.count(); result.set_flag_recursive( flag_COOKED ); } From ca66171d7a182a28a213a4ab31982f230781c537 Mon Sep 17 00:00:00 2001 From: rtxyd <65117312+rtxyd@users.noreply.github.com> Date: Mon, 22 Jan 2024 05:36:52 +0800 Subject: [PATCH 2/4] Update migration.json --- data/mods/Aftershock/migration.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/mods/Aftershock/migration.json b/data/mods/Aftershock/migration.json index fd0f076e66227..dbd0d9f9af3a2 100644 --- a/data/mods/Aftershock/migration.json +++ b/data/mods/Aftershock/migration.json @@ -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" } ] From 1a6a1a7acb0519453a9c036902a44093e140e162 Mon Sep 17 00:00:00 2001 From: rtxyd <65117312+rtxyd@users.noreply.github.com> Date: Mon, 22 Jan 2024 09:48:53 +0800 Subject: [PATCH 3/4] Update bionics.cpp --- src/bionics.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bionics.cpp b/src/bionics.cpp index 0b15308cb3a8f..d4dc6df8a4ca3 100644 --- a/src/bionics.cpp +++ b/src/bionics.cpp @@ -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() From 866a589a22e205a49073b0b65ad741627452cfbf Mon Sep 17 00:00:00 2001 From: rtxyd <65117312+rtxyd@users.noreply.github.com> Date: Mon, 22 Jan 2024 11:00:02 +0800 Subject: [PATCH 4/4] Update src/bionics.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/bionics.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bionics.cpp b/src/bionics.cpp index d4dc6df8a4ca3..8a1312ff1f502 100644 --- a/src/bionics.cpp +++ b/src/bionics.cpp @@ -484,9 +484,9 @@ void bionic_data::load_bionic_migration( const JsonObject &jo, const std::string 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); + auto iter = migrations.find( from ); + if( iter != migrations.end() && ( *iter ).second.is_null() ) { + migrations.erase( iter ); } }