@@ -160,13 +160,21 @@ void building_temple_complex::static_params_t<T>::planer_setup_preview_graphics(
160
160
}
161
161
}
162
162
163
- void building_temple_complex_altar::static_params::planer_ghost_preview (build_planner &planer, painter &ctx, tile2i tile, tile2i end, vec2i pixel) const {
163
+ template <typename T>
164
+ void building_temple_complex_upgrade::static_params_t <T>::planer_ghost_preview(build_planner &planer, painter &ctx, tile2i tile, tile2i end, vec2i pixel) const {
164
165
int city_orientation = city_view_orientation () / 2 ;
165
166
int orientation = (1 + building_rotation_global_rotation () + city_orientation) % 2 ;
166
- int image_id = anim[animkeys ().base ].first_img () + orientation;
167
+ int image_id = this -> anim [animkeys ().base ].first_img () + orientation;
167
168
auto complex = building_at_ex<building_temple_complex>(end);
168
169
if (complex) {
169
- building *altar = complex->get_altar ();
170
+ building *upgrade_base = nullptr ;
171
+ if (this ->TYPE == BUILDING_TEMPLE_COMPLEX_ALTAR) {
172
+ upgrade_base = complex->get_altar ();
173
+ } else if (this ->TYPE == BUILDING_TEMPLE_COMPLEX_ORACLE) {
174
+ upgrade_base = complex->get_oracle ();
175
+ } else {
176
+ upgrade_base = &complex->main ()->base ;
177
+ }
170
178
171
179
tile2i offset = { 0 , 0 };
172
180
int bsize = building_size - 1 ;
@@ -177,8 +185,8 @@ void building_temple_complex_altar::static_params::planer_ghost_preview(build_pl
177
185
case 3 : offset = { bsize, bsize }; break ;
178
186
}
179
187
180
- vec2i pixel_altar = tile_to_pixel (altar ->tile .shifted (offset));
181
- planer.draw_building_ghost (ctx, image_id, pixel_altar );
188
+ vec2i pixel_upgrade = tile_to_pixel (upgrade_base ->tile .shifted (offset));
189
+ planer.draw_building_ghost (ctx, image_id, pixel_upgrade );
182
190
}
183
191
}
184
192
@@ -188,6 +196,7 @@ building_temple_complex_ptah::static_params building_temple_complex_ptah_m;
188
196
building_temple_complex_seth::static_params building_temple_complex_seth_m;
189
197
building_temple_complex_bast::static_params building_temple_complex_bast_m;
190
198
building_temple_complex_altar::static_params building_temple_complex_altar_m;
199
+ building_temple_complex_oracle::static_params building_temple_complex_oracle_m;
191
200
192
201
void building_temple_complex::on_create (int orientation) {
193
202
data.monuments .variant = (10 - (2 * orientation)) % 8 ; // ugh!
@@ -249,6 +258,18 @@ building *building_temple_complex::get_altar() const {
249
258
return next;
250
259
}
251
260
261
+ building *building_temple_complex::get_oracle () const {
262
+ building *next = base.next ();
263
+ while (next) {
264
+ if (next->type == BUILDING_TEMPLE_COMPLEX_ORACLE) {
265
+ break ;
266
+ }
267
+ next = next->next ();
268
+ }
269
+
270
+ return next;
271
+ }
272
+
252
273
void building_temple_complex::update_count () const {
253
274
const bool is_active = num_workers () > 0 ;
254
275
g_city.buildings .track_building (base, is_active);
0 commit comments