From b4b90465c2d233ddc6c40c941efbda4dbda89a7b Mon Sep 17 00:00:00 2001 From: Japa Date: Mon, 2 Nov 2015 23:22:58 +0530 Subject: [PATCH 1/3] Added building direction to remotefortressreader.cpp for those buildings that have it in a meaningful way. --- plugins/proto/RemoteFortressReader.proto | 3 + plugins/remotefortressreader.cpp | 155 ++++++++++++++++++++++- 2 files changed, 157 insertions(+), 1 deletion(-) diff --git a/plugins/proto/RemoteFortressReader.proto b/plugins/proto/RemoteFortressReader.proto index 1094f4ad4..aa4c26adf 100644 --- a/plugins/proto/RemoteFortressReader.proto +++ b/plugins/proto/RemoteFortressReader.proto @@ -132,6 +132,7 @@ message BuildingInstance optional uint32 building_flags = 10; optional bool is_room = 11; optional BuildingExtents room = 12; + optional int32 direction = 13; //Doesn't mean anything forall buildings } message MapBlock @@ -331,6 +332,8 @@ message WorldMap optional int32 center_x = 17; optional int32 center_y = 18; optional int32 center_z = 19; + optional int32 cur_year = 20; + optional int32 cur_year_tick = 21; } message RegionMaps diff --git a/plugins/remotefortressreader.cpp b/plugins/remotefortressreader.cpp index 100fe6413..239675b7c 100644 --- a/plugins/remotefortressreader.cpp +++ b/plugins/remotefortressreader.cpp @@ -32,6 +32,12 @@ #include "df/building_def_workshopst.h" #include "df/building_def_furnacest.h" #include "df/building_wellst.h" +#include "df/building_water_wheelst.h" +#include "df/building_screw_pumpst.h" +#include "df/building_axle_horizontalst.h" +#include "df/building_windmillst.h" +#include "df/building_siegeenginest.h" +#include "df/building_rollersst.h" #include "df/descriptor_color.h" #include "df/descriptor_pattern.h" @@ -61,6 +67,7 @@ #include "modules/Items.h" #include "modules/Buildings.h" #include "modules/Units.h" +#include "modules/World.h" #include "TileTypes.h" #include "MiscUtils.h" @@ -223,7 +230,8 @@ void CopyBuilding(int buildingIndex, RemoteFortressReader::BuildingInstance * re remote_build->set_pos_z_max(local_build->z); auto buildingType = remote_build->mutable_building_type(); - buildingType->set_building_type(local_build->getType()); + auto type = local_build->getType(); + buildingType->set_building_type(type); buildingType->set_building_subtype(local_build->getSubtype()); buildingType->set_building_custom(local_build->getCustomType()); @@ -245,6 +253,148 @@ void CopyBuilding(int buildingIndex, RemoteFortressReader::BuildingInstance * re room->add_extents(local_build->room.extents[i]); } } + + remote_build->set_direction(0); + + switch (type) + { + case df::enums::building_type::NONE: + break; + case df::enums::building_type::Chair: + break; + case df::enums::building_type::Bed: + break; + case df::enums::building_type::Table: + break; + case df::enums::building_type::Coffin: + break; + case df::enums::building_type::FarmPlot: + break; + case df::enums::building_type::Furnace: + break; + case df::enums::building_type::TradeDepot: + break; + case df::enums::building_type::Shop: + break; + case df::enums::building_type::Door: + break; + case df::enums::building_type::Floodgate: + break; + case df::enums::building_type::Box: + break; + case df::enums::building_type::Weaponrack: + break; + case df::enums::building_type::Armorstand: + break; + case df::enums::building_type::Workshop: + break; + case df::enums::building_type::Cabinet: + break; + case df::enums::building_type::Statue: + break; + case df::enums::building_type::WindowGlass: + break; + case df::enums::building_type::WindowGem: + break; + case df::enums::building_type::Well: + break; + case df::enums::building_type::Bridge: + break; + case df::enums::building_type::RoadDirt: + break; + case df::enums::building_type::RoadPaved: + break; + case df::enums::building_type::SiegeEngine: + { + auto actual = strict_virtual_cast(local_build); + if (actual) + remote_build->set_direction(actual->facing); + } + break; + case df::enums::building_type::Trap: + break; + case df::enums::building_type::AnimalTrap: + break; + case df::enums::building_type::Support: + break; + case df::enums::building_type::ArcheryTarget: + break; + case df::enums::building_type::Chain: + break; + case df::enums::building_type::Cage: + break; + case df::enums::building_type::Stockpile: + break; + case df::enums::building_type::Civzone: + break; + case df::enums::building_type::Weapon: + break; + case df::enums::building_type::Wagon: + break; + case df::enums::building_type::ScrewPump: + { + auto actual = strict_virtual_cast(local_build); + if (actual) + remote_build->set_direction(actual->direction); + } + break; + case df::enums::building_type::Construction: + break; + case df::enums::building_type::Hatch: + break; + case df::enums::building_type::GrateWall: + break; + case df::enums::building_type::GrateFloor: + break; + case df::enums::building_type::BarsVertical: + break; + case df::enums::building_type::BarsFloor: + break; + case df::enums::building_type::GearAssembly: + break; + case df::enums::building_type::AxleHorizontal: + { + auto actual = strict_virtual_cast(local_build); + if (actual) + remote_build->set_direction(actual->is_vertical); + } + break; + case df::enums::building_type::AxleVertical: + break; + case df::enums::building_type::WaterWheel: + { + auto actual = strict_virtual_cast(local_build); + if (actual) + remote_build->set_direction(actual->is_vertical); + } + break; + case df::enums::building_type::Windmill: + { + auto actual = strict_virtual_cast(local_build); + if (actual) + remote_build->set_direction(actual->orient_angle); + } + break; + case df::enums::building_type::TractionBench: + break; + case df::enums::building_type::Slab: + break; + case df::enums::building_type::Nest: + break; + case df::enums::building_type::NestBox: + break; + case df::enums::building_type::Hive: + break; + case df::enums::building_type::Rollers: + { + auto actual = strict_virtual_cast(local_build); + if (actual) + remote_build->set_direction(actual->direction); + } + break; + default: + break; + } } RemoteFortressReader::TiletypeMaterial TranslateMaterial(df::tiletype_material material) @@ -1422,6 +1572,9 @@ static command_result GetWorldMap(color_ostream &stream, const EmptyMessage *in, out->set_center_x(pos_x); out->set_center_y(pos_y); out->set_center_z(pos_z); + + out->set_cur_year(World::ReadCurrentYear()); + out->set_cur_year_tick(World::ReadCurrentTick()); return CR_OK; } From 5e727b301d762dff2fede625b201cba786d96db6 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Mon, 2 Nov 2015 10:51:23 -0800 Subject: [PATCH 2/3] minor typo fix --- scripts/gaydar.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/gaydar.lua b/scripts/gaydar.lua index 1aca8cdbe..4513bec14 100644 --- a/scripts/gaydar.lua +++ b/scripts/gaydar.lua @@ -32,7 +32,7 @@ orientation filters: -notStraight shows only creatures who are not strictly straight -gayOnly - shows only creatures who are strictly gayOnly + shows only creatures who are strictly gay -biOnly shows only creatures who can get into romances with both sexes @@ -187,4 +187,4 @@ else for k,v in ipairs(orientations) do print(v) end -end \ No newline at end of file +end From 923ce3632309d331cbf504ed5f733371c6f6f31d Mon Sep 17 00:00:00 2001 From: DoctorVanGogh Date: Tue, 3 Nov 2015 03:55:04 +0100 Subject: [PATCH 3/3] zone: Fix typo in help text --- plugins/zone.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/zone.cpp b/plugins/zone.cpp index b9044b6fd..c1901b06e 100644 --- a/plugins/zone.cpp +++ b/plugins/zone.cpp @@ -149,7 +149,7 @@ const string zone_help_filters = " caged - in a built cage\n" " own - from own civilization\n" " war - trained war creature\n" - " tamed - tamed\n" + " tame - tamed\n" " named - has name or nickname\n" " can be used to mark named units for slaughter\n" " merchant - is a merchant / belongs to a merchant\n"