Skip to content

Commit

Permalink
Reset existing monster groups with bad destinations
Browse files Browse the repository at this point in the history
  • Loading branch information
RenechCDDA committed May 24, 2024
1 parent 1d5a3e0 commit 20b7841
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/savegame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down

0 comments on commit 20b7841

Please sign in to comment.