From ce53ca5e59813465e306e5bac7477c891efdc5e1 Mon Sep 17 00:00:00 2001 From: Alexey Kim Date: Fri, 30 Sep 2022 14:51:03 +0300 Subject: [PATCH 1/4] Migrate only BIONIC_WEAPON and BIONIC_GUN --- src/savegame_json.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/savegame_json.cpp b/src/savegame_json.cpp index 8df4947f4c41c..90991283030a5 100644 --- a/src/savegame_json.cpp +++ b/src/savegame_json.cpp @@ -1122,6 +1122,7 @@ void Character::load( const JsonObject &data ) item_location weapon = get_wielded_item(); bool has_old_bionic_weapon = !is_using_bionic_weapon() && weapon && + ( weapon->has_flag( flag_BIONIC_WEAPON ) || weapon->has_flag( flag_BIONIC_GUN ) ) && weapon->has_flag( flag_NO_UNWIELD ) && !weapon->ethereal; const auto find_parent = [this]( bionic_id & bio_id ) { From 439dfcc4fdfb16c1c6470e9579ba55804cd349f8 Mon Sep 17 00:00:00 2001 From: Alexey Kim Date: Fri, 30 Sep 2022 14:53:43 +0300 Subject: [PATCH 2/4] Initialize starting_vehicle to null id --- src/avatar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/avatar.h b/src/avatar.h index 286b157191ff3..fc0bd607f1ed4 100644 --- a/src/avatar.h +++ b/src/avatar.h @@ -369,7 +369,7 @@ class avatar : public Character // amount of turns since last check for pocket noise time_point last_pocket_noise = time_point( 0 ); - vproto_id starting_vehicle; + vproto_id starting_vehicle = vproto_id::NULL_ID(); std::vector starting_pets; std::set follower_ids; From e4ab84c958b0749b8c6b99df09fa121b34d2747e Mon Sep 17 00:00:00 2001 From: Alexey Kim Date: Fri, 30 Sep 2022 14:55:22 +0300 Subject: [PATCH 3/4] Check is_avatar before dereferencing as_avatar --- src/player_display.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/player_display.cpp b/src/player_display.cpp index 8220149543566..befdc365c2d86 100644 --- a/src/player_display.cpp +++ b/src/player_display.cpp @@ -1281,7 +1281,9 @@ static bool handle_player_display_action( Character &you, unsigned int &line, ++info_line; ui_info.invalidate_ui(); } else if( action == "MEDICAL_MENU" ) { - you.as_avatar()->disp_medical(); + if( you.is_avatar() ) { + you.as_avatar()->disp_medical(); + } } return done; } From 1fa03b7fb666554eb6b1f006fdb719aa35e0c7fe Mon Sep 17 00:00:00 2001 From: Alexey Kim Date: Fri, 30 Sep 2022 14:56:45 +0300 Subject: [PATCH 4/4] Write dummy object for hacking_activity_actor::serialize --- src/activity_actor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/activity_actor.cpp b/src/activity_actor.cpp index 8e3a2de88c280..e2a8a20c59211 100644 --- a/src/activity_actor.cpp +++ b/src/activity_actor.cpp @@ -824,7 +824,10 @@ void hacking_activity_actor::finish( player_activity &act, Character &who ) act.set_to_null(); } -void hacking_activity_actor::serialize( JsonOut & ) const {} +void hacking_activity_actor::serialize( JsonOut &jsout ) const +{ + jsout.write_null(); +} std::unique_ptr hacking_activity_actor::deserialize( JsonValue & ) {