Skip to content

Commit

Permalink
Fix savegame migration for Hazardous Waste Sarcophagus
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhilkinSerg authored and kevingranade committed Dec 31, 2019
1 parent 125ef83 commit 0e9401d
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 95 deletions.
16 changes: 16 additions & 0 deletions data/json/obsolete_terrains.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,22 @@
"haz_sar",
"haz_sar_entrance_b1",
"haz_sar_b1",
"haz_sar_entrance_north",
"haz_sar_north",
"haz_sar_entrance_b1_north",
"haz_sar_b1_north",
"haz_sar_entrance_east",
"haz_sar_east",
"haz_sar_entrance_b1_east",
"haz_sar_b1_east",
"haz_sar_entrance_south",
"haz_sar_south",
"haz_sar_entrance_b1_south",
"haz_sar_b1_south",
"haz_sar_entrance_west",
"haz_sar_west",
"haz_sar_entrance_b1_west",
"haz_sar_b1_west",
"house_base_north",
"house_base_south",
"house_base_east",
Expand Down
34 changes: 0 additions & 34 deletions data/json/overmap/overmap_terrain/overmap_terrain_waste_junk.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,40 +172,6 @@
"see_cost": 5,
"flags": [ "RISK_HIGH" ]
},
{
"type": "overmap_terrain",
"id": "haz_sar_entrance",
"name": "hazardous waste sarcophagus",
"sym": "X",
"color": "pink",
"see_cost": 5,
"flags": [ "RISK_HIGH" ]
},
{
"type": "overmap_terrain",
"id": "haz_sar",
"name": "hazardous waste sarcophagus",
"sym": "X",
"color": "pink",
"see_cost": 5
},
{
"type": "overmap_terrain",
"id": "haz_sar_entrance_b1",
"name": "hazardous waste sarcophagus",
"sym": "X",
"color": "pink",
"see_cost": 5,
"flags": [ "RISK_HIGH" ]
},
{
"type": "overmap_terrain",
"id": "haz_sar_b1",
"name": "hazardous waste sarcophagus",
"sym": "X",
"color": "pink",
"see_cost": 5
},
{
"type": "overmap_terrain",
"id": "sewer",
Expand Down
28 changes: 0 additions & 28 deletions data/mods/Graphical_Overmap/overmap_terrain.json
Original file line number Diff line number Diff line change
Expand Up @@ -22865,34 +22865,6 @@
"sym": "ó",
"color": "light_green"
},
{
"type": "overmap_terrain",
"id": "haz_sar_entrance",
"copy-from": "haz_sar_entrance",
"sym": "Õ",
"color": "green"
},
{
"type": "overmap_terrain",
"id": "haz_sar",
"copy-from": "haz_sar",
"sym": "Õ",
"color": "green"
},
{
"type": "overmap_terrain",
"id": "haz_sar_entrance_b1",
"copy-from": "haz_sar_entrance_b1",
"sym": "Õ",
"color": "green"
},
{
"type": "overmap_terrain",
"id": "haz_sar_b1",
"copy-from": "haz_sar_b1",
"sym": "Õ",
"color": "green"
},
{
"type": "overmap_terrain",
"id": "pump_station_1",
Expand Down
32 changes: 0 additions & 32 deletions data/mods/alt_map_key/overmap_terrain.json
Original file line number Diff line number Diff line change
Expand Up @@ -1882,38 +1882,6 @@
"sym": "t",
"color": "pink"
},
{
"type": "overmap_terrain",
"id": "haz_sar_entrance",
"copy-from": "haz_sar_entrance",
"name": "hazardous waste sarcophagus",
"sym": "H",
"color": "i_pink"
},
{
"type": "overmap_terrain",
"id": "haz_sar",
"copy-from": "haz_sar",
"name": "hazardous waste sarcophagus",
"sym": "h",
"color": "i_pink"
},
{
"type": "overmap_terrain",
"id": "haz_sar_entrance_b1",
"copy-from": "haz_sar_entrance_b1",
"name": "hazardous waste sarcophagus",
"sym": "H",
"color": "i_pink"
},
{
"type": "overmap_terrain",
"id": "haz_sar_b1",
"copy-from": "haz_sar_b1",
"name": "hazardous waste sarcophagus",
"sym": "h",
"color": "i_pink"
},
{
"type": "overmap_terrain",
"id": "cave",
Expand Down
47 changes: 46 additions & 1 deletion src/savegame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,6 @@ void overmap::convert_terrain( const std::unordered_map<tripoint, std::string> &
old.compare( 0, 5, "cabin" ) == 0 ||
old.compare( 0, 5, "pond_" ) == 0 ||
old.compare( 0, 6, "bandit" ) == 0 ||
old.compare( 0, 7, "haz_sar" ) == 0 || // remove after 0.E.
old.compare( 0, 7, "shelter" ) == 0 ||
old.compare( 0, 8, "campsite" ) == 0 ||
old.compare( 0, 9, "pwr_large" ) == 0 ||
Expand Down Expand Up @@ -786,6 +785,52 @@ void overmap::convert_terrain( const std::unordered_map<tripoint, std::string> &
} else {
debugmsg( "Malformed Megastore" );
}

} else if( old.compare( 0, 7, "haz_sar" ) == 0 ) {
if( old == "haz_sar_entrance" || old == "haz_sar_entrance_north" ) {
ter_set( pos, oter_id( "haz_sar_1_1_north" ) );
ter_set( pos + point_west, oter_id( "haz_sar_1_2_north" ) );
ter_set( pos + point_south, oter_id( "haz_sar_1_3_north" ) );
ter_set( pos + point_south_west, oter_id( "haz_sar_1_4_north" ) );
} else if( old == "haz_sar_entrance_south" ) {
ter_set( pos, oter_id( "haz_sar_1_1_south" ) );
ter_set( pos + point_north, oter_id( "haz_sar_1_2_south" ) );
ter_set( pos + point_west, oter_id( "haz_sar_1_3_south" ) );
ter_set( pos + point_north_west, oter_id( "haz_sar_1_4_south" ) );
} else if( old == "haz_sar_entrance_east" ) {
ter_set( pos, oter_id( "haz_sar_1_1_east" ) );
ter_set( pos + point_north, oter_id( "haz_sar_1_2_east" ) );
ter_set( pos + point_west, oter_id( "haz_sar_1_3_east" ) );
ter_set( pos + point_north_west, oter_id( "haz_sar_1_4_east" ) );
} else if( old == "haz_sar_entrance_west" ) {
ter_set( pos, oter_id( "haz_sar_1_1_west" ) );
ter_set( pos + point_south, oter_id( "haz_sar_1_2_west" ) );
ter_set( pos + point_east, oter_id( "haz_sar_1_3_west" ) );
ter_set( pos + point_south_east, oter_id( "haz_sar_1_4_west" ) );
}

if( old == "haz_sar_entrance_b1" || old == "haz_sar_entrance_b1_north" ) {
ter_set( pos, oter_id( "haz_sar_b_1_north" ) );
ter_set( pos + point_west, oter_id( "haz_sar_b_2_north" ) );
ter_set( pos + point_south, oter_id( "haz_sar_b_3_north" ) );
ter_set( pos + point_south_west, oter_id( "haz_sar_b_4_north" ) );
} else if( old == "haz_sar_entrance_b1_south" ) {
ter_set( pos, oter_id( "haz_sar_b_1_south" ) );
ter_set( pos + point_north, oter_id( "haz_sar_b_2_south" ) );
ter_set( pos + point_west, oter_id( "haz_sar_b_3_south" ) );
ter_set( pos + point_north_west, oter_id( "haz_sar_b_4_south" ) );
} else if( old == "haz_sar_entrance_b1_east" ) {
ter_set( pos, oter_id( "haz_sar_b_1_east" ) );
ter_set( pos + point_north, oter_id( "haz_sar_b_2_east" ) );
ter_set( pos + point_west, oter_id( "haz_sar_b_3_east" ) );
ter_set( pos + point_north_west, oter_id( "haz_sar_b_4_east" ) );
} else if( old == "haz_sar_entrance_b1_west" ) {
ter_set( pos, oter_id( "haz_sar_b_1_west" ) );
ter_set( pos + point_south, oter_id( "haz_sar_b_2_west" ) );
ter_set( pos + point_east, oter_id( "haz_sar_b_3_west" ) );
ter_set( pos + point_south_east, oter_id( "haz_sar_b_4_west" ) );
}

} else if( old == "house_base_north" ) {
ter_set( pos, oter_id( "house_north" ) );
} else if( old == "house_base_south" ) {
Expand Down

0 comments on commit 0e9401d

Please sign in to comment.