Skip to content

Commit f11d1ca

Browse files
committed
refactor: native_meeting_center_id building property moved from subtype
1 parent 904456b commit f11d1ca

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

src/building/building.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,9 @@ class building {
168168
e_building_type type;
169169
union {
170170
e_house_level house_level;
171-
uint16_t data;
172-
// short workshop_type;
173-
short native_meeting_center_id;
171+
uint16_t data;
174172
} subtype;
173+
short native_meeting_center_id;
175174
unsigned short road_network_id;
176175
//unsigned short creation_sequence_index;
177176
short houses_covered;

src/city/city_buildings.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ io_buffer *iob_buildings = new io_buffer([] (io_buffer *iob, size_t version) {
244244
iob->bind(BIND_SIGNATURE_UINT16, &b->type);
245245
iob->bind(BIND_SIGNATURE_INT16, &b->subtype.data); // which union field we use does not matter
246246
iob->bind(BIND_SIGNATURE_UINT16, &b->road_network_id);
247-
iob->bind____skip(2); //iob->bind(BIND_SIGNATURE_UINT16, &b->creation_sequence_index);
247+
iob->bind(BIND_SIGNATURE_INT16, &b->native_meeting_center_id);
248248
iob->bind(BIND_SIGNATURE_INT16, &b->houses_covered);
249249
iob->bind(BIND_SIGNATURE_INT16, &b->percentage_houses_covered);
250250

src/figuretype/native.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void figure::indigenous_native_action() {
4444
wait_ticks = 0;
4545
if (!g_city.military.is_native_attack_active()) {
4646
int x_tile, y_tile;
47-
building* meeting = building_get(b->subtype.native_meeting_center_id);
47+
building* meeting = building_get(b->native_meeting_center_id);
4848
if (map_terrain_get_adjacent_road_or_clear_land(
4949
meeting->tile.x(), meeting->tile.y(), meeting->size, &x_tile, &y_tile)) {
5050
action_state = FIGURE_ACTION_156_NATIVE_GOING_TO_MEETING_CENTER;

src/grid/natives.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static void determine_meeting_center(void) {
6868
min_meeting_id = meetings[n];
6969
}
7070
}
71-
b->subtype.native_meeting_center_id = min_meeting_id;
71+
b->native_meeting_center_id = min_meeting_id;
7272
}
7373
}
7474
}

0 commit comments

Comments
 (0)