From c8b02fe512f8b16d9db5a6608229bccc6e3b844b Mon Sep 17 00:00:00 2001 From: Mark Langsdorf Date: Thu, 14 Nov 2019 18:34:59 -0600 Subject: [PATCH] basecamps: preserve rotation data for future upgrades Now that basecamps can be built in places that aren't fields, the basecamp overmap terrain id needs to include rotational data so that update_mapgen will correctly place upgrades on fire stations and evac shelters that are rotated. --- data/json/mapgen/faction_buildings.json | 2 +- .../overmap_terrain/overmap_terrain_faction_base.json | 9 +++++++++ src/basecamp.cpp | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/data/json/mapgen/faction_buildings.json b/data/json/mapgen/faction_buildings.json index 86ec86ddec864..051b7c25c071e 100644 --- a/data/json/mapgen/faction_buildings.json +++ b/data/json/mapgen/faction_buildings.json @@ -1,7 +1,7 @@ [ { "type": "mapgen", - "om_terrain": [ "faction_base_camp_0" ], + "om_terrain": [ "faction_base_camp_0", "faction_base_camp_new_0" ], "method": "json", "weight": 250, "object": { diff --git a/data/json/overmap/overmap_terrain/overmap_terrain_faction_base.json b/data/json/overmap/overmap_terrain/overmap_terrain_faction_base.json index ba2a52f1a3e92..58f367dbc327a 100644 --- a/data/json/overmap/overmap_terrain/overmap_terrain_faction_base.json +++ b/data/json/overmap/overmap_terrain/overmap_terrain_faction_base.json @@ -8,6 +8,15 @@ "see_cost": 5, "flags": [ "NO_ROTATE", "SOURCE_PEOPLE" ] }, + { + "type": "overmap_terrain", + "id": "faction_base_camp_new_0", + "name": "survivor camp", + "sym": "+", + "color": "white", + "see_cost": 5, + "flags": [ "SOURCE_PEOPLE" ] + }, { "type": "overmap_terrain", "id": "faction_base_camp_1", diff --git a/src/basecamp.cpp b/src/basecamp.cpp index d744a24c6f852..c6e89bfa5675d 100644 --- a/src/basecamp.cpp +++ b/src/basecamp.cpp @@ -18,6 +18,7 @@ #include "item_group.h" #include "map.h" #include "map_iterator.h" +#include "overmap.h" #include "overmapbuffer.h" #include "player.h" #include "npc.h" @@ -189,7 +190,8 @@ void basecamp::define_camp( const tripoint &p, const std::string &camp_type ) e.cur_level = -1; e.pos = omt_pos; expansions[base_camps::base_dir] = e; - overmap_buffer.ter_set( omt_pos, oter_id( "faction_base_camp_0" ) ); + overmap_buffer.ter_set( omt_pos, oter_id( "faction_base_camp_new_0" + + oter_get_rotation_string( omt_ref ) ) ); update_provides( base_camps::faction_encode_abs( e, 0 ), expansions[base_camps::base_dir] ); } else {