Skip to content

Commit

Permalink
basecamps: preserve rotation data for future upgrades
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mlangsdorf committed Nov 15, 2019
1 parent bb3648e commit c8b02fe
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/json/mapgen/faction_buildings.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion src/basecamp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit c8b02fe

Please sign in to comment.