From 20b7841e362f4c08edea3c9e5d0ee764ad2fdb47 Mon Sep 17 00:00:00 2001 From: RenechCDDA <84619419+RenechCDDA@users.noreply.github.com> Date: Fri, 24 May 2024 14:56:43 -0400 Subject: [PATCH] Reset existing monster groups with bad destinations --- src/savegame.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/savegame.cpp b/src/savegame.cpp index 9ab7dc6f55fdb..562abee000f50 100644 --- a/src/savegame.cpp +++ b/src/savegame.cpp @@ -368,12 +368,19 @@ void overmap::load_monster_groups( const JsonArray &jsin ) for( JsonArray mongroup_with_tripoints : jsin ) { mongroup new_group; new_group.deserialize( mongroup_with_tripoints.next_object() ); + bool reset_target = false; + if( new_group.target == point_abs_sm() ) { // Remove after 0.I + reset_target = true; + } JsonArray tripoints_json = mongroup_with_tripoints.next_array(); tripoint_om_sm temp; for( JsonValue tripoint_json : tripoints_json ) { temp.deserialize( tripoint_json ); new_group.abs_pos = project_combine( pos(), temp ); + if( reset_target ) { // Remove after 0.I + new_group.set_target( new_group.abs_pos.xy() ); + } add_mon_group( new_group ); }