Add support for site towers.

develop
Japa 2016-08-03 10:22:30 +05:30
parent 9189e3dc7e
commit 2fda01d90b
3 changed files with 50 additions and 1 deletions

@ -1 +1 @@
Subproject commit 84f5de34c1a269420204c81f3244a70843bb9c5c
Subproject commit 650adfc5a91fc3088568b297e170126942cf73db

@ -438,6 +438,36 @@ enum SiteRealizationBuildingType
tavern = 22;
}
message SiteRealizationBuildingWall
{
optional int32 start_x = 1;
optional int32 start_y = 2;
optional int32 start_z = 3;
optional int32 end_x = 4;
optional int32 end_y = 5;
optional int32 end_z = 6;
}
message SiteRealizationBuildingTower
{
optional int32 roof_z = 1;
optional bool round = 2;
optional bool goblin = 3;
}
message TrenchSpoke
{
optional int32 mound_start = 1;
optional int32 trench_start = 2;
optional int32 trench_end = 3;
optional int32 mound_end = 4;
}
message SiteRealizationBuildingTrenches
{
repeated TrenchSpoke spokes = 1;
}
message SiteRealizationBuilding
{
optional int32 id = 1;
@ -447,6 +477,9 @@ message SiteRealizationBuilding
optional int32 max_x = 5;
optional int32 max_y = 6;
optional MatPair material = 7;
optional SiteRealizationBuildingWall wall_info = 8;
optional SiteRealizationBuildingTower tower_info = 9;
optional SiteRealizationBuildingTrenches trench_info = 10;
}
message RegionTile

@ -64,6 +64,9 @@
#include "df/world_site.h"
#include "df/world_site_realization.h"
#include "df/site_realization_building.h"
#include "df/site_realization_building_info_castle_towerst.h"
#include "df/site_realization_building_info_castle_wallst.h"
#include "df/site_realization_building_info_trenchesst.h"
#include "df/unit.h"
#include "df/creature_raw.h"
@ -2347,6 +2350,19 @@ static void CopyLocalMap(df::world_data * worldData, df::world_region_details* w
auto mat = out_building->mutable_material();
mat->set_mat_type(in_building->item.mat_type);
mat->set_mat_index(in_building->item.mat_index);
STRICT_VIRTUAL_CAST_VAR(tower_info, df::site_realization_building_info_castle_towerst, in_building->building_info);
if (tower_info)
{
mat->set_mat_index(tower_info->wall_item.mat_index);
mat->set_mat_type(tower_info->wall_item.mat_type);
auto out_tower = out_building->mutable_tower_info();
out_tower->set_roof_z(tower_info->roof_z);
out_tower->set_round(tower_info->shape.bits.round);
out_tower->set_goblin(tower_info->shape.bits.goblin);
}
}
}