Skip to content

Commit 25e4ae0

Browse files
committed
fixed saving runtime_data for palace/tax collector
1 parent b89c166 commit 25e4ae0

4 files changed

+14
-0
lines changed

src/building/building_palace.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ bool building_palace::draw_ornaments_and_animations_height(painter &ctx, vec2i p
148148
return true;
149149
}
150150

151+
void building_palace::bind_dynamic(io_buffer *iob, size_t version) {
152+
auto &d = runtime_data();
153+
154+
iob->bind(BIND_SIGNATURE_INT16, &d.tax_income_or_storage);
155+
}
156+
151157
bvariant building_palace::get_property(const xstring &domain, const xstring &name) const {
152158
auto &d = runtime_data();
153159
if (domain == tags().building && name == tags().tax_income_or_storage) {

src/building/building_palace.h

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class building_palace : public building_impl {
1919
virtual void update_graphic() override;
2020
virtual void draw_tooltip(tooltip_context *c) override;
2121
virtual bool draw_ornaments_and_animations_height(painter &ctx, vec2i point, tile2i tile, color mask) override;
22+
virtual void bind_dynamic(io_buffer *iob, size_t version) override;
2223

2324
virtual bvariant get_property(const xstring &domain, const xstring &name) const override;
2425

src/building/building_tax_collector.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ void building_tax_collector::spawn_figure() {
5959
}
6060
}
6161

62+
void building_tax_collector::bind_dynamic(io_buffer *iob, size_t version) {
63+
auto &d = runtime_data();
64+
65+
iob->bind(BIND_SIGNATURE_INT16, &d.tax_income_or_storage);
66+
}
67+
6268
void building_tax_collector::update_month() {
6369
if (!config_get(CONFIG_GP_CH_NEW_TAX_COLLECTION_SYSTEM)) {
6470
return;

src/building/building_tax_collector.h

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class building_tax_collector : public building_impl {
2020
virtual e_sound_channel_city sound_channel() const override { return SOUND_CHANNEL_CITY_TAX_COLLECTOR; }
2121
virtual const static_params &params() const override;
2222
virtual bvariant get_property(const xstring &domain, const xstring &name) const override;
23+
virtual void bind_dynamic(io_buffer *iob, size_t version) override;
2324

2425
int16_t deben_storage() const { return base.deben_storage; }
2526
int16_t tax_storage() const { return runtime_data().tax_income_or_storage; }

0 commit comments

Comments
 (0)