diff --git a/src/map.cpp b/src/map.cpp index f9ab7c3f9dadc..d449d169aac18 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -7925,8 +7925,7 @@ void map::copy_grid( const tripoint &to, const tripoint &from ) } } -void map::spawn_monsters_submap_group( const tripoint &gp, mongroup &group, - const tripoint_abs_sm &submap_pos, bool ignore_sight ) +void map::spawn_monsters_submap_group( const tripoint &gp, mongroup &group, bool ignore_sight ) { Character &player_character = get_player_character(); const int s_range = std::min( HALF_MAPSIZE_X, @@ -8041,7 +8040,6 @@ void map::spawn_monsters_submap_group( const tripoint &gp, mongroup &group, } // Find horde's target submap - tripoint_abs_sm horde_target = submap_pos + ( group.target - group.pos ); for( monster &tmp : group.monsters ) { for( int tries = 0; tries < 10 && !locations.empty(); tries++ ) { const tripoint local_pos = random_entry_removed( locations ); @@ -8051,8 +8049,8 @@ void map::spawn_monsters_submap_group( const tripoint &gp, mongroup &group, } if( group.horde ) { // Give monster a random point near horde's expected destination - const point_rel_ms pos_in_sm( rng( 0, SEEX ), rng( 0, SEEY ) ); - const tripoint_abs_ms rand_dest = project_to( horde_target ) + pos_in_sm; + const tripoint_sm_ms pos_in_sm( rng( 0, SEEX ), rng( 0, SEEY ), local_pos.z ); + const tripoint_abs_ms rand_dest = project_combine( group.target, pos_in_sm ); const int turns = rl_dist( abs_pos, rand_dest ) + group.interest; tmp.wander_to( rand_dest, turns ); add_msg_debug( debugmode::DF_MAP, "%s targeting %s", tmp.disp_name(), @@ -8077,9 +8075,9 @@ void map::spawn_monsters_submap( const tripoint &gp, bool ignore_sight ) // Load unloaded monsters overmap_buffer.spawn_monster( submap_pos ); // Only spawn new monsters after existing monsters are loaded. - auto groups = overmap_buffer.groups_at( submap_pos ); + std::vector groups = overmap_buffer.groups_at( submap_pos ); for( mongroup *&mgp : groups ) { - spawn_monsters_submap_group( gp, *mgp, submap_pos, ignore_sight ); + spawn_monsters_submap_group( gp, *mgp, ignore_sight ); } submap *const current_submap = get_submap_at_grid( gp ); diff --git a/src/map.h b/src/map.h index 832f78dbdd9fa..3eca5632f1426 100644 --- a/src/map.h +++ b/src/map.h @@ -1742,7 +1742,7 @@ class map void spawn_monsters_submap( const tripoint &gp, bool ignore_sight ); // Helper #2 - spawns monsters on one submap and from one group on this submap void spawn_monsters_submap_group( const tripoint &gp, mongroup &group, - const tripoint_abs_sm &submap_pos, bool ignore_sight ); + bool ignore_sight ); protected: void saven( const tripoint &grid ); diff --git a/src/mongroup.h b/src/mongroup.h index c2befd6b872f8..d1b3c0951be8f 100644 --- a/src/mongroup.h +++ b/src/mongroup.h @@ -111,12 +111,11 @@ struct mongroup { mongroup_id type; // Note: position is not saved as such in the json // Instead, a vector of positions is saved for - tripoint_om_sm pos; tripoint_abs_sm abs_pos; // position of the mongroup in absolute submap coordinates unsigned int radius = 1; unsigned int population = 1; - tripoint_om_sm target; // location the horde is interested in. - tripoint_abs_sm nemesis_target; // abs target for nemesis hordes + point_abs_sm target; // location the horde is interested in. + point_abs_sm nemesis_target; // abs target for nemesis hordes int interest = 0; //interest to target in percents bool dying = false; bool horde = false; @@ -134,32 +133,30 @@ struct mongroup { */ std::string horde_behaviour; bool diffuse = false; // group size ind. of dist. from center and radius invariant - mongroup( const mongroup_id &ptype, const tripoint &ppos, + mongroup( const mongroup_id &ptype, const tripoint_abs_sm &ppos, unsigned int prad, unsigned int ppop ) : type( ptype ) - , pos( ppos ) + , abs_pos( ppos ) , radius( prad ) , population( ppop ) { } - mongroup( const mongroup_id &ptype, const tripoint_om_sm &ppos, - unsigned int prad, unsigned int ppop ) : - // TODO: fix point types - mongroup( ptype, ppos.raw(), prad, ppop ) {} - mongroup( const std::string &ptype, tripoint ppos, unsigned int prad, unsigned int ppop, - tripoint ptarget, int pint, bool pdie, bool phorde, bool pdiff ) : - type( ptype ), pos( ppos ), radius( prad ), population( ppop ), target( ptarget ), + mongroup( const std::string &ptype, const tripoint_abs_sm &ppos, unsigned int prad, + unsigned int ppop, point_abs_sm ptarget, int pint, bool pdie, bool phorde, + bool pdiff ) : + type( ptype ), abs_pos( ppos ), radius( prad ), population( ppop ), target( ptarget ), interest( pint ), dying( pdie ), horde( phorde ), diffuse( pdiff ) { } mongroup() = default; bool is_safe() const; bool empty() const; void clear(); - void set_target( const point_om_sm &p ) { - target.x() = p.x(); - target.y() = p.y(); + tripoint_om_sm rel_pos() const { + return project_remain( abs_pos ).remainder_tripoint; } - void set_nemesis_target( const tripoint_abs_sm &p ) { - nemesis_target.x() = p.x(); - nemesis_target.y() = p.y(); + void set_target( const point_abs_sm &p ) { + target = p; + } + void set_nemesis_target( const point_abs_sm &p ) { + nemesis_target = p; } void wander( const overmap & ); void inc_interest( int inc ) { diff --git a/src/overmap.cpp b/src/overmap.cpp index e95b0195ece5c..3250bf723115f 100644 --- a/src/overmap.cpp +++ b/src/overmap.cpp @@ -2979,11 +2979,12 @@ bool overmap::is_explored( const tripoint_om_omt &p ) const bool overmap::mongroup_check( const mongroup &candidate ) const { - const auto matching_range = zg.equal_range( candidate.pos ); + tripoint_om_sm relp = candidate.rel_pos(); + const auto matching_range = zg.equal_range( relp ); return std::find_if( matching_range.first, matching_range.second, [candidate]( const std::pair &match ) { // This is extra strict since we're using it to test serialization. - return candidate.type == match.second.type && candidate.pos == match.second.pos && + return candidate.type == match.second.type && candidate.abs_pos == match.second.abs_pos && candidate.radius == match.second.radius && candidate.population == match.second.population && candidate.target == match.second.target && @@ -3643,10 +3644,11 @@ bool overmap::generate_sub( const int z ) for( city &i : cities ) { tripoint_om_omt omt_pos( i.pos, z ); tripoint_om_sm sm_pos = project_to( omt_pos ); + tripoint_abs_sm abs_pos = project_combine( pos(), sm_pos ); // Normal subways are present at z == -2, but filtering for the terrain would be much nicer if( z == -2 ) { spawn_mon_group( mongroup( GROUP_SUBWAY_CITY, - sm_pos, i.size * 2, i.size * i.size * 2 ) ); + abs_pos, i.size * 2, i.size * i.size * 2 ) ); } } @@ -3831,12 +3833,13 @@ void mongroup::wander( const overmap &om ) const city *target_city = nullptr; int target_distance = 0; + point_om_sm rel_p = rel_pos().xy(); + if( horde_behaviour == "city" ) { // Find a nearby city to return to.. for( const city &check_city : om.cities ) { // Check if this is the nearest city so far. - int distance = rl_dist( project_to( check_city.pos ), - pos.xy() ); + int distance = rl_dist( project_to( check_city.pos ), rel_p ); if( !target_city || distance < target_distance ) { target_distance = distance; target_city = &check_city; @@ -3848,12 +3851,14 @@ void mongroup::wander( const overmap &om ) // TODO: somehow use the same algorithm that distributes zombie // density at world gen to spread the hordes over the actual // city, rather than the center city tile - target.x() = target_city->pos.x() * 2 + rng( -target_city->size * 2, target_city->size * 2 ); - target.y() = target_city->pos.y() * 2 + rng( -target_city->size * 2, target_city->size * 2 ); + point_abs_sm target_abs = + project_to( project_combine( om.pos(), target_city->pos ) ); + int range = target_city->size * 2; + point delta( rng( -range, range ), rng( -range, range ) ); + target = target_abs + delta; interest = 100; } else { - target.x() = pos.x() + rng( -10, 10 ); - target.y() = pos.y() + rng( -10, 10 ); + target = abs_pos.xy() + point( rng( -10, 10 ), rng( -10, 10 ) ); interest = 30; } } @@ -3878,12 +3883,12 @@ void overmap::move_hordes() // Gradually decrease interest. mg.dec_interest( 1 ); - if( ( mg.pos.xy() == mg.target.xy() ) || mg.interest <= 15 ) { + if( ( mg.abs_pos.xy() == mg.target ) || mg.interest <= 15 ) { mg.wander( *this ); } // Decrease movement chance according to the terrain we're currently on. - const oter_id &walked_into = ter( project_to( mg.pos ) ); + const oter_id &walked_into = ter( project_to( mg.rel_pos() ) ); int movement_chance = 1; if( walked_into == oter_forest || walked_into == oter_forest_water ) { movement_chance = 3; @@ -3903,21 +3908,21 @@ void overmap::move_hordes() // or one space per 5 minutes. if( one_in( movement_chance ) && rng( 0, 100 ) < mg.interest && rng( 0, 200 ) < mg.avg_speed() ) { // TODO: Handle moving to adjacent overmaps. - if( mg.pos.x() > mg.target.x() ) { - mg.pos.x()--; + if( mg.abs_pos.x() > mg.target.x() ) { + mg.abs_pos.x()--; } - if( mg.pos.x() < mg.target.x() ) { - mg.pos.x()++; + if( mg.abs_pos.x() < mg.target.x() ) { + mg.abs_pos.x()++; } - if( mg.pos.y() > mg.target.y() ) { - mg.pos.y()--; + if( mg.abs_pos.y() > mg.target.y() ) { + mg.abs_pos.y()--; } - if( mg.pos.y() < mg.target.y() ) { - mg.pos.y()++; + if( mg.abs_pos.y() < mg.target.y() ) { + mg.abs_pos.y()++; } // Erase the group at it's old location, add the group with the new location - tmpzg.insert( std::pair( mg.pos, mg ) ); + tmpzg.emplace( mg.rel_pos(), mg ); zg.erase( it++ ); } else { ++it; @@ -3932,7 +3937,7 @@ void overmap::move_hordes() // Scan over monsters outside the player's view and place them back into hordes. auto monster_map_it = monster_map.begin(); while( monster_map_it != monster_map.end() ) { - const auto &p = monster_map_it->first; + const tripoint_om_sm &p = monster_map_it->first; monster &this_monster = monster_map_it->second; // Only zombies on z-level 0 may join hordes. @@ -3975,7 +3980,8 @@ void overmap::move_hordes() if( this_monster.will_join_horde( add_to_horde_size ) ) { // If there is no horde to add the monster to, create one. if( add_to_group == nullptr ) { - mongroup m( GROUP_ZOMBIE, p, 1, 0 ); + tripoint_abs_sm abs_pos = project_combine( pos(), p ); + mongroup m( GROUP_ZOMBIE, abs_pos, 1, 0 ); m.horde = true; m.monsters.push_back( this_monster ); m.interest = 0; // Ensures that we will select a new target. @@ -4039,13 +4045,10 @@ void overmap::move_nemesis() //if the nemesis horde is on the same overmap as its target //update the horde's om_sm coords from the abs_sm so it can spawn in correctly - if( project_to( mg.nemesis_target.xy() ) == omp ) { - - mg.pos.y() = local_sm.y(); - mg.pos.x() = local_sm.x(); + if( project_to( mg.nemesis_target ) == omp ) { // Erase the group at its old location, add the group with the new location - tmpzg.insert( std::pair( mg.pos, mg ) ); + tmpzg.emplace( mg.rel_pos(), mg ); zg.erase( it++ ); //there is only one nemesis horde, so we can stop looping after we move it @@ -4087,12 +4090,13 @@ bool overmap::remove_nemesis() void overmap::signal_hordes( const tripoint_rel_sm &p_rel, const int sig_power ) { tripoint_om_sm p( p_rel.raw() ); + tripoint_abs_sm absp = project_combine( pos(), p ); for( auto &elem : zg ) { mongroup &mg = elem.second; if( !mg.horde ) { continue; } - const int dist = rl_dist( p, mg.pos ); + const int dist = rl_dist( absp, mg.abs_pos ); if( sig_power < dist ) { continue; } @@ -4109,16 +4113,16 @@ void overmap::signal_hordes( const tripoint_rel_sm &p_rel, const int sig_power ) const int min_capped_inter = std::max( min_initial_inter, calculated_inter ); if( roll < min_capped_inter ) { //Rolling if horde interested in new signal // TODO: Z-coordinate for mongroup targets - const int targ_dist = rl_dist( p, mg.target ); + const int targ_dist = rl_dist( absp.xy(), mg.target ); // TODO: Base this on targ_dist:dist ratio. if( targ_dist < 5 ) { // If signal source already pursued by horde - mg.set_target( midpoint( mg.target.xy(), p.xy() ) ); + mg.set_target( midpoint( mg.target, absp.xy() ) ); const int min_inc_inter = 3; // Min interest increase to already targeted source const int inc_roll = rng( min_inc_inter, calculated_inter ); mg.inc_interest( inc_roll ); add_msg_debug( debugmode::DF_OVERMAP, "horde inc interest %d dist %d", inc_roll, dist ); } else { // New signal source - mg.set_target( p.xy() ); + mg.set_target( absp.xy() ); mg.set_interest( min_capped_inter ); add_msg_debug( debugmode::DF_OVERMAP, "horde set interest %d dist %d", min_capped_inter, dist ); } @@ -4128,20 +4132,13 @@ void overmap::signal_hordes( const tripoint_rel_sm &p_rel, const int sig_power ) void overmap::signal_nemesis( const tripoint_abs_sm &p_abs_sm ) { - //CONVERT ABS SM TO OM_SM - point_abs_om omp; - tripoint_om_sm local_sm; - std::tie( omp, local_sm ) = project_remain( p_abs_sm ); - // convert tripoint_om_sm to const point_om_sm !!! - const point_om_sm pos_om = local_sm.xy(); - for( std::pair &elem : zg ) { mongroup &mg = elem.second; if( mg.horde_behaviour == "nemesis" ) { // if the horde is a nemesis, we set its target directly on the player - mg.set_target( pos_om ); - mg.set_nemesis_target( p_abs_sm ); + mg.set_target( p_abs_sm.xy() ); + mg.set_nemesis_target( p_abs_sm.xy() ); } } @@ -6021,12 +6018,14 @@ std::vector overmap::place_special( if( spawns.group ) { const int pop = rng( spawns.population.min, spawns.population.max ); const int rad = rng( spawns.radius.min, spawns.radius.max ); - spawn_mon_group( mongroup( spawns.group, project_to( p ), rad, pop ) ); + spawn_mon_group( + mongroup( spawns.group, project_to( project_combine( pos(), p ) ), + rad, pop ) ); } // If it's a safe zone, remove existing spawns if( is_safe_zone ) { for( auto it = zg.begin(); it != zg.end(); ) { - tripoint_om_omt pos = project_to( it->second.pos ); + tripoint_om_omt pos = project_to( it->second.rel_pos() ); if( safe_at_worldgen.find( pos ) != safe_at_worldgen.end() ) { zg.erase( it++ ); } else { @@ -6278,9 +6277,14 @@ void overmap::place_mongroups() } } if( swamp_count >= 25 ) { + tripoint_om_omt p( x, y, 0 ); float norm_factor = std::abs( GROUP_SWAMP->freq_total / 1000.0f ); - spawn_mon_group( mongroup( GROUP_SWAMP, tripoint( x * 2, y * 2, 0 ), 3, - std::round( norm_factor * rng( swamp_count * 8, swamp_count * 25 ) ) ) ); + unsigned int pop = + std::round( norm_factor * rng( swamp_count * 8, swamp_count * 25 ) ); + spawn_mon_group( + mongroup( + GROUP_SWAMP, project_combine( pos(), project_to( p ) ), 3, + pop ) ); } } } @@ -6298,9 +6302,13 @@ void overmap::place_mongroups() } } if( river_count >= 25 ) { + tripoint_om_omt p( x, y, 0 ); float norm_factor = std::abs( GROUP_RIVER->freq_total / 1000.0f ); - spawn_mon_group( mongroup( GROUP_RIVER, tripoint( x * 2, y * 2, 0 ), 3, - std::round( norm_factor * rng( river_count * 8, river_count * 25 ) ) ) ); + unsigned int pop = + std::round( norm_factor * rng( river_count * 8, river_count * 25 ) ); + spawn_mon_group( + mongroup( GROUP_RIVER, project_combine( pos(), project_to( p ) ), + 3, pop ) ); } } } @@ -6309,23 +6317,20 @@ void overmap::place_mongroups() int numgroups = rng( 0, 3 ); for( int i = 0; i < numgroups; i++ ) { float norm_factor = std::abs( GROUP_WORM->freq_total / 1000.0f ); - spawn_mon_group( mongroup( GROUP_WORM, tripoint( rng( 0, OMAPX * 2 - 1 ), rng( 0, - OMAPY * 2 - 1 ), 0 ), - rng( 20, 40 ), std::round( norm_factor * rng( 30, 50 ) ) ) ); + tripoint_om_sm p( rng( 0, OMAPX * 2 - 1 ), rng( 0, OMAPY * 2 - 1 ), 0 ); + unsigned int pop = std::round( norm_factor * rng( 30, 50 ) ); + spawn_mon_group( + mongroup( GROUP_WORM, project_combine( pos(), p ), rng( 20, 40 ), pop ) ); } } void overmap::place_nemesis( const tripoint_abs_omt &p ) { tripoint_abs_sm pos_sm = project_to( p ); - point_abs_om omp; - tripoint_om_sm local_sm; - std::tie( omp, local_sm ) = project_remain( pos_sm ); - mongroup nemesis = mongroup( GROUP_NEMESIS, local_sm, 1, 1 ); + mongroup nemesis = mongroup( GROUP_NEMESIS, pos_sm, 1, 1 ); nemesis.horde = true; nemesis.horde_behaviour = "nemesis"; - nemesis.abs_pos = pos_sm; add_mon_group( nemesis ); } @@ -6408,7 +6413,7 @@ void overmap::save() const void overmap::spawn_mon_group( const mongroup &group ) { - tripoint_om_omt pos = project_to( group.pos ); + tripoint_om_omt pos = project_to( group.rel_pos() ); if( safe_at_worldgen.find( pos ) != safe_at_worldgen.end() ) { return; } @@ -6422,7 +6427,7 @@ void overmap::add_mon_group( const mongroup &group ) // makes the diffuse setting obsolete (as it only controls how the radius // is interpreted) - it's only used when adding monster groups with function. if( group.radius == 1 ) { - zg.insert( std::pair( group.pos, group ) ); + zg.emplace( group.rel_pos(), group ); return; } // diffuse groups use a circular area, non-diffuse groups use a rectangular area @@ -6468,7 +6473,7 @@ void overmap::add_mon_group( const mongroup &group ) // for a single-submap group. mongroup tmp( group ); tmp.radius = 1; - tmp.pos += point( x, y ); + tmp.abs_pos += point( x, y ); tmp.population = p; // This *can* create groups outside of the area of this overmap. // As this function is called during generating the overmap, the diff --git a/src/overmap_ui.cpp b/src/overmap_ui.cpp index 4ddbdd37996be..5d23511c33de8 100644 --- a/src/overmap_ui.cpp +++ b/src/overmap_ui.cpp @@ -800,12 +800,7 @@ static void draw_ascii( if( blink && uistate.overmap_debug_mongroup ) { // Check if this tile is the target of the currently selected group - // Convert to position within overmap - point_abs_om abs_om; - point_om_omt omp_in_om; - std::tie( abs_om, omp_in_om ) = project_remain( omp.xy() ); - if( mgroup && project_to( mgroup->target.xy() ) == - omp_in_om ) { + if( mgroup && project_to( mgroup->target ) == omp.xy() ) { ter_color = c_red; ter_sym = "x"; } else { @@ -1094,6 +1089,8 @@ static void draw_om_sidebar( } if( ( data.debug_editor && center_seen ) || data.debug_info ) { + mvwprintz( wbar, point( 1, ++lines ), c_white, + "abs_omt: %s", center.to_string() ); const oter_t &oter = overmap_buffer.ter( center ).obj(); mvwprintz( wbar, point( 1, ++lines ), c_white, "oter: %s (rot %d)", oter.id.str(), oter.get_rotation() ); @@ -1124,6 +1121,15 @@ static void draw_om_sidebar( io::enum_to_string( dir ), *join ); } } + + for( const mongroup *mg : overmap_buffer.monsters_at( center ) ) { + mvwprintz( wbar, point( 1, ++lines ), c_red, "mongroup %s (%zu/%u), %s %s%s%s", + mg->type.str(), mg->monsters.size(), mg->population, + mg->horde_behaviour, + mg->dying ? "x" : "", mg->horde ? "h" : "", mg->diffuse ? "d" : "" ); + mvwprintz( wbar, point( 1, ++lines ), c_red, "target: %s (%d)", + project_to( mg->target ).to_string(), mg->interest ); + } } if( has_target ) { diff --git a/src/overmapbuffer.cpp b/src/overmapbuffer.cpp index 9f72e86b89983..b3992bbd0f99f 100644 --- a/src/overmapbuffer.cpp +++ b/src/overmapbuffer.cpp @@ -140,15 +140,13 @@ void overmapbuffer::fix_mongroups( overmap &new_overmap ) continue; } // Inside the bounds of the overmap? - if( mg.pos.x() >= 0 && mg.pos.y() >= 0 && mg.pos.x() < OMAPX * 2 && - mg.pos.y() < OMAPY * 2 ) { + point_abs_om omp; + point_om_sm sm_rem; + std::tie( omp, sm_rem ) = project_remain( mg.abs_pos.xy() ); + if( omp == new_overmap.pos() ) { ++it; continue; } - point_abs_sm smabs = project_combine( new_overmap.pos(), mg.pos.xy() ); - point_abs_om omp; - point_om_sm sm_rem; - std::tie( omp, sm_rem ) = project_remain( smabs ); if( !has( omp ) ) { // Don't generate new overmaps, as this can be called from the // overmap-generating code. @@ -156,7 +154,6 @@ void overmapbuffer::fix_mongroups( overmap &new_overmap ) continue; } overmap &om = get( omp ); - mg.pos = tripoint_om_sm( sm_rem, mg.pos.z() ); om.spawn_mon_group( mg ); new_overmap.zg.erase( it++ ); } @@ -174,19 +171,17 @@ void overmapbuffer::fix_nemesis( overmap &new_overmap ) continue; } + point_abs_om omp; + point_om_sm sm_rem; + std::tie( omp, sm_rem ) = project_remain( mg.abs_pos.xy() ); //if the nemesis's abs coordinates put it in this overmap, it belongs here - if( project_to( mg.abs_pos.xy() ) == new_overmap.pos() ) { + if( omp == new_overmap.pos() ) { ++it; continue; } //otherwise, place it in the overmap that corresponds to its abs_sm coords - point_abs_om omp; - point_om_sm sm_rem; - std::tie( omp, sm_rem ) = project_remain( mg.abs_pos.xy() ); - overmap &om = get( omp ); - mg.pos = tripoint_om_sm( sm_rem, mg.pos.z() ); om.spawn_mon_group( mg ); new_overmap.zg.erase( it++ ); //there should only be one nemesis, so we can break after finding it diff --git a/src/savegame.cpp b/src/savegame.cpp index c3ae6f39bb1bf..331d0a977f632 100644 --- a/src/savegame.cpp +++ b/src/savegame.cpp @@ -499,7 +499,7 @@ void overmap::load_monster_groups( JsonIn &jsin ) tripoint_om_sm temp; while( !jsin.end_array() ) { temp.deserialize( jsin ); - new_group.pos = temp; + new_group.abs_pos = project_combine( pos(), temp ); add_mon_group( new_group ); } @@ -1135,7 +1135,7 @@ void overmap::save_monster_groups( JsonOut &jout ) const // The position is stored separately, in the list // TODO: Do it without the copy mongroup saved_group = group_bin.first; - saved_group.pos = tripoint_om_sm(); + saved_group.abs_pos = tripoint_abs_sm(); jout.write( saved_group ); jout.write( group_bin.second ); jout.end_array(); @@ -1344,15 +1344,14 @@ template void mongroup::io( Archive &archive ) { archive.io( "type", type ); - archive.io( "pos", pos, tripoint_om_sm() ); archive.io( "abs_pos", abs_pos, tripoint_abs_sm() ); archive.io( "radius", radius, 1u ); archive.io( "population", population, 1u ); archive.io( "diffuse", diffuse, false ); archive.io( "dying", dying, false ); archive.io( "horde", horde, false ); - archive.io( "target", target, tripoint_om_sm() ); - archive.io( "nemesis_target", nemesis_target, tripoint_abs_sm() ); + archive.io( "target", target, point_abs_sm() ); + archive.io( "nemesis_target", nemesis_target, point_abs_sm() ); archive.io( "interest", interest, 0 ); archive.io( "horde_behaviour", horde_behaviour, io::empty_default_tag() ); archive.io( "monsters", monsters, io::empty_default_tag() ); @@ -1378,8 +1377,6 @@ void mongroup::deserialize_legacy( JsonIn &json ) std::string name = json.get_member_name(); if( name == "type" ) { type = mongroup_id( json.get_string() ); - } else if( name == "pos" ) { - pos.deserialize( json ); } else if( name == "abs_pos" ) { abs_pos.deserialize( json ); } else if( name == "radius" ) {