Commit 86f8513 1 parent 5871640 commit 86f8513 Copy full SHA for 86f8513
File tree 3 files changed +11
-9
lines changed
3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ enum e_fancy_state {
140
140
class building_work_camp ;
141
141
class building_farm ;
142
142
143
- building* building_get (int id);
143
+ building* building_get (building_id id);
144
144
145
145
class building {
146
146
public:
Original file line number Diff line number Diff line change 12
12
#include " core/game_environment.h"
13
13
#include " io/gamefiles/lang.h"
14
14
#include " building/industry.h"
15
+ #include " building/building_temple_complex.h"
15
16
16
17
#include " dev/debug.h"
17
18
#include " js/js_game.h"
@@ -382,11 +383,11 @@ void building_menu_update_temple_complexes() {
382
383
}
383
384
384
385
// check if upgrades have been placed
385
- building* b = building_get (temple_complex_id);
386
- const bool temple_has_altar = (b-> data . monuments . temple_complex_attachments & 2 ); // altar
386
+ auto b = building_get_ex<building_temple_complex> (temple_complex_id);
387
+ const bool temple_has_altar = b && b-> has_attachement (etc_attachement_altar);
387
388
building_menu_toggle_building (BUILDING_TEMPLE_COMPLEX_ALTAR, !temple_has_altar);
388
389
389
- const bool temple_has_oracle = (b-> data . monuments . temple_complex_attachments & 1 ); // oracle
390
+ const bool temple_has_oracle = b && b-> has_attachement (etc_attachement_oracle);
390
391
building_menu_toggle_building (BUILDING_TEMPLE_COMPLEX_ORACLE, !temple_has_oracle);
391
392
392
393
// all upgrades have been placed!
Original file line number Diff line number Diff line change @@ -800,21 +800,22 @@ void build_planner::update_special_case_orientations_check() {
800
800
}
801
801
}
802
802
803
- const bool templeAltar = (special_flags & e_building_flag::TempleUpgradeAltar);
804
- const bool templeOracle = (special_flags & e_building_flag::TempleUpgradeOracle);
805
- if (templeAltar || templeOracle) {
803
+ const bool temple_altar = (special_flags & e_building_flag::TempleUpgradeAltar);
804
+ const bool temple_oracle = (special_flags & e_building_flag::TempleUpgradeOracle);
805
+ const int temple_options = (temple_altar ? etc_attachement_altar : 0 ) | (temple_oracle ? etc_attachement_oracle : 0 );
806
+ if (temple_altar || temple_oracle) {
806
807
auto target = building_at (end)->main ()->dcast_temple_complex ();
807
808
if (!target) {
808
809
immediate_warning_id = WARNING_TEMPLE_UPGRADE_PLACEMENT_NEED_TEMPLE;
809
810
can_place = CAN_NOT_PLACE;
810
- } else if (target->data . monuments . temple_complex_attachments & additional_req_param1 ) {
811
+ } else if (target->has_attachement ((e_temple_compex_attachement)temple_options) ) {
811
812
immediate_warning_id = WARNING_TEMPLE_UPGRADE_ONLY_ONE;
812
813
can_place = CAN_NOT_PLACE;
813
814
} else {
814
815
int dir_absolute = (5 - (target->data .monuments .variant / 2 )) % 4 ;
815
816
dir_relative = city_view_relative_orientation (dir_absolute);
816
817
relative_orientation = (1 + dir_relative) % 2 ;
817
- end = temple_complex_part_target (& target->base , additional_req_param1 );
818
+ end = target->tile ( );
818
819
update_orientations (false );
819
820
}
820
821
}
You can’t perform that action at this time.
0 commit comments