Skip to content

Commit 56590f4

Browse files
committed
building: water left saves orientation in data
1 parent 3c3b827 commit 56590f4

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/building/building_water_lift.cpp

+8-4
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
#include "widget/city/ornaments.h"
99
#include "graphics/elements/ui.h"
1010

11-
buildings::model_t<building_water_lift> water_lift_m;
11+
building_water_lift::static_params water_lift_m;
12+
13+
void building_water_lift::static_params::load(archive arch) {
1214

13-
ANK_REGISTER_CONFIG_ITERATOR(config_load_building_water_lift);
14-
void config_load_building_water_lift() {
15-
water_lift_m.load();
1615
}
1716

1817
void building_water_lift::window_info_background(object_info &c) {
@@ -103,3 +102,8 @@ void building_water_lift::update_map_orientation(int orientation) {
103102
int image_id = water_lift_m.anim["work"].first_img() + image_offset;
104103
map_water_add_building(id(), tile(), 2, image_id);
105104
}
105+
106+
void building_water_lift::bind_dynamic(io_buffer *iob, size_t version) {
107+
iob->bind____skip(88);
108+
iob->bind(BIND_SIGNATURE_UINT8, &data.industry.orientation);
109+
}

src/building/building_water_lift.h

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ class building_water_lift : public building_impl {
88

99
building_water_lift(building &b) : building_impl(b) {}
1010

11+
struct static_params : public buildings::model_t<building_water_lift> {
12+
virtual void load(archive arch) override;
13+
};
14+
1115
virtual void window_info_background(object_info &c) override;
1216
virtual void on_create(int orientation) override;
1317
virtual void on_place_update_tiles(int orientation, int variant) override;
@@ -18,4 +22,7 @@ class building_water_lift : public building_impl {
1822
virtual e_sound_channel_city sound_channel() const override { return SOUND_CHANNEL_CITY_POLICE; }
1923
virtual bool draw_ornaments_and_animations_height(painter &ctx, vec2i point, tile2i tile, color color_mask) override;
2024
virtual void update_map_orientation(int orientation) override;
25+
virtual void bind_dynamic(io_buffer *iob, size_t version) override;
26+
27+
static const static_params &current_params() { return (const static_params &)params(TYPE); }
2128
};

0 commit comments

Comments
 (0)