Skip to content

Commit f228641

Browse files
committed
refactor: market good option moved to market section
1 parent 1ad914f commit f228641

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/building/building.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ class building {
171171
uint16_t data;
172172
e_resource warehouse_resource_id;
173173
// short workshop_type;
174-
short native_meeting_center_id;
175-
short market_goods;
174+
short native_meeting_center_id;
176175
} subtype;
177176
unsigned short road_network_id;
178177
//unsigned short creation_sequence_index;
@@ -241,6 +240,7 @@ class building {
241240
short linen_demand;
242241
short beer_demand;
243242
short fetch_inventory_id;
243+
short market_goods;
244244
} market;
245245
struct granary_t {
246246
short resource_stored[16];

src/building/building_bazaar.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,16 @@ int building_bazaar::max_goods_stock() {
8585

8686
bool building_bazaar::is_good_accepted(int index) {
8787
int goods_bit = 1 << index;
88-
return !(base.subtype.market_goods & goods_bit);
88+
return !(data.market.market_goods & goods_bit);
8989
}
9090

9191
void building_bazaar::toggle_good_accepted(int index) {
9292
int goods_bit = (1 << index);
93-
base.subtype.market_goods ^= goods_bit;
93+
data.market.market_goods ^= goods_bit;
9494
}
9595

9696
void building_bazaar::unaccept_all_goods() {
97-
base.subtype.market_goods = (short)0xFFFF;
97+
data.market.market_goods = (short)0xFFFF;
9898
}
9999

100100
building *building_bazaar::get_storage_destination() {
@@ -245,7 +245,7 @@ void building_bazaar::update_graphic() {
245245
}
246246

247247
void building_bazaar::on_create(int orientation) {
248-
base.subtype.market_goods = 0;
248+
data.market.market_goods = 0;
249249
base.fancy_state = efancy_normal;
250250
}
251251

@@ -317,7 +317,7 @@ bool building_bazaar::draw_ornaments_and_animations_height(painter &ctx, vec2i p
317317
}
318318

319319
void building_bazaar::bind_dynamic(io_buffer *iob, size_t version) {
320-
iob->bind____skip(2);
320+
iob->bind(BIND_SIGNATURE_INT16, &data.market.market_goods);
321321
iob->bind(BIND_SIGNATURE_INT16, &data.market.pottery_demand);
322322
iob->bind(BIND_SIGNATURE_INT16, &data.market.luxurygoods_demand);
323323
iob->bind(BIND_SIGNATURE_INT16, &data.market.linen_demand);

0 commit comments

Comments
 (0)