From a1f692686ae1d6c55cbacbc26ce968b6e26d569c Mon Sep 17 00:00:00 2001 From: Japa Date: Sun, 7 May 2017 19:24:30 +0530 Subject: [PATCH] Use forward slashes instead of underscored to separate building subtypes --- .../remotefortressreader/building_reader.cpp | 18 +++++++++--------- .../remotefortressreader.cpp | 4 ---- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/plugins/remotefortressreader/building_reader.cpp b/plugins/remotefortressreader/building_reader.cpp index 4e31e0360..2b9f95390 100644 --- a/plugins/remotefortressreader/building_reader.cpp +++ b/plugins/remotefortressreader/building_reader.cpp @@ -54,7 +54,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_custom(-1); - bld->set_id(ENUM_KEY_STR(building_type, bt) + "_" + ENUM_KEY_STR(furnace_type, st)); + bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(furnace_type, st)); if (st == furnace_type::Custom) { @@ -66,7 +66,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_custom(cust->id); - bld->set_id(cust->code); + bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + cust->code); bld->set_name(cust->name); } } @@ -81,7 +81,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_custom(-1); - bld->set_id(ENUM_KEY_STR(building_type, bt) + "_" + ENUM_KEY_STR(shop_type, st)); + bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(shop_type, st)); } break; @@ -102,7 +102,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_custom(-1); - bld->set_id(ENUM_KEY_STR(building_type, bt) + "_" + ENUM_KEY_STR(workshop_type, st)); + bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(workshop_type, st)); if (st == workshop_type::Custom) { @@ -114,7 +114,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_custom(cust->id); - bld->set_id(cust->code); + bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + cust->code); bld->set_name(cust->name); } } @@ -143,7 +143,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_custom(-1); - bld->set_id(ENUM_KEY_STR(building_type, bt) + "_" + ENUM_KEY_STR(siegeengine_type, st)); + bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(siegeengine_type, st)); } break; @@ -154,7 +154,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_custom(-1); - bld->set_id(ENUM_KEY_STR(building_type, bt) + "_" + ENUM_KEY_STR(trap_type, st)); + bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(trap_type, st)); } break; @@ -177,7 +177,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_custom(-1); - bld->set_id(ENUM_KEY_STR(building_type, bt) + "_" + ENUM_KEY_STR(civzone_type, st)); + bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(civzone_type, st)); } break; @@ -194,7 +194,7 @@ DFHack::command_result GetBuildingDefList(DFHack::color_ostream &stream, const D bld->mutable_building_type()->set_building_type(bt); bld->mutable_building_type()->set_building_subtype(st); bld->mutable_building_type()->set_building_custom(-1); - bld->set_id(ENUM_KEY_STR(building_type, bt) + "_" + ENUM_KEY_STR(construction_type, st)); + bld->set_id(ENUM_KEY_STR(building_type, bt) + "/" + ENUM_KEY_STR(construction_type, st)); } break; diff --git a/plugins/remotefortressreader/remotefortressreader.cpp b/plugins/remotefortressreader/remotefortressreader.cpp index 507bd5349..ac06fd160 100644 --- a/plugins/remotefortressreader/remotefortressreader.cpp +++ b/plugins/remotefortressreader/remotefortressreader.cpp @@ -593,7 +593,6 @@ void CopyMat(RemoteFortressReader::MatPair * mat, int type, int index) map hashes; -//check if the tiletypes have changed bool IsTiletypeChanged(DFCoord pos) { uint16_t hash; @@ -612,7 +611,6 @@ bool IsTiletypeChanged(DFCoord pos) map waterHashes; -//check if the designations have changed bool IsDesignationChanged(DFCoord pos) { uint16_t hash; @@ -631,7 +629,6 @@ bool IsDesignationChanged(DFCoord pos) map buildingHashes; -//check if the designations have changed bool IsBuildingChanged(DFCoord pos) { df::map_block * block = Maps::getBlock(pos); @@ -652,7 +649,6 @@ bool IsBuildingChanged(DFCoord pos) map spatterHashes; -//check if map spatters have changed bool IsspatterChanged(DFCoord pos) { df::map_block * block = Maps::getBlock(pos);