Although the code is not elegant, I don't understand why it doesn't work.
Code: Select all
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_flat_check, nearby_tile_slope(0, 0) == SLOPE_FLAT) { 1: return CB_RESULT_LOCATION_ALLOW; return CB_RESULT_LOCATION_DISALLOW; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check23, nearby_tile_slope(0,1) & bitmask(CORNER_N, CORNER_E)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_flat_check; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check22, nearby_tile_slope(1,0) & bitmask(CORNER_N, CORNER_E)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check23; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check21, nearby_tile_slope(0,0) & bitmask(CORNER_N, CORNER_E)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check22; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check20, nearby_tile_slope(0,1) & bitmask(CORNER_S, CORNER_E)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check21; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check19, nearby_tile_slope(1,0) & bitmask(CORNER_S, CORNER_E)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check20; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check18, nearby_tile_slope(0,0) & bitmask(CORNER_S, CORNER_E)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check19; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check17, nearby_tile_slope(0,1) & bitmask(CORNER_S, CORNER_W)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check18; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check16, nearby_tile_slope(1,0) & bitmask(CORNER_S, CORNER_W)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check17; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check15, nearby_tile_slope(0,0) & bitmask(CORNER_S, CORNER_W)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check16; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check14, nearby_tile_slope(0,1) & bitmask(CORNER_N, CORNER_W)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check15; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check13, nearby_tile_slope(1,0) & bitmask(CORNER_N, CORNER_W)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check14; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check12, nearby_tile_slope(0,0) & bitmask(CORNER_N, CORNER_W)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check13; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check11, nearby_tile_slope(0,1) & bitmask(CORNER_N)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check12; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check10, nearby_tile_slope(1,0) & bitmask(CORNER_N)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check11; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check9, nearby_tile_slope(0,0) & bitmask(CORNER_N)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check10; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check8, nearby_tile_slope(0,1) & bitmask(CORNER_E)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check9; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check7, nearby_tile_slope(1,0) & bitmask(CORNER_E)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check8; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check6, nearby_tile_slope(0,0) & bitmask(CORNER_E)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check7; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check5, nearby_tile_slope(0,1) & bitmask(CORNER_S)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check6; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check4, nearby_tile_slope(1,0) & bitmask(CORNER_S)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check5; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check3, nearby_tile_slope(0,0) & bitmask(CORNER_S)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check4; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check2, nearby_tile_slope(0,1) & bitmask(CORNER_W)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check3; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check1, nearby_tile_slope(1,0) & bitmask(CORNER_W)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check2; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_slope_check, nearby_tile_slope(0,0) & bitmask(CORNER_W)) { 1: return CB_RESULT_LOCATION_DISALLOW; bistro01_tile_slope_check1; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_road_adjacent_4, nearby_tile_class(-1, 0)) { TILE_CLASS_ROAD: return CB_RESULT_LOCATION_ALLOW; bistro01_tile_slope_check; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_road_adjacent_3, nearby_tile_class(0, -1)) { TILE_CLASS_ROAD: return CB_RESULT_LOCATION_ALLOW; bistro01_tile_road_adjacent_4; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_road_adjacent_2, nearby_tile_class(1, 0)) { TILE_CLASS_ROAD: return CB_RESULT_LOCATION_ALLOW; bistro01_tile_road_adjacent_3; }
switch (FEAT_INDUSTRYTILES, SELF, bistro01_tile_road_adjacent_1, nearby_tile_class(0, 1)) { TILE_CLASS_ROAD: return CB_RESULT_LOCATION_ALLOW; bistro01_tile_road_adjacent_2; }
switch (FEAT_INDUSTRYTILES, PARENT, bistro01_terrain_check, ( (((extra_callback_info2 & 0xFF00) >> 8) == IND_CREATION_FUND) || (((extra_callback_info2 & 0xFF00) >> 8) == IND_CREATION_PROSPECT) ) ) { 1: return CB_RESULT_LOCATION_ALLOW; bistro01_tile_road_adjacent_1; }
item(FEAT_INDUSTRYTILES, bistro01_tile, 123) {
property {
substitute: 0;
land_shape_flags: bitmask(LSF_ONLY_ON_FLAT_LAND);
animation_triggers: bitmask(ANIM_TRIGGER_INDTILE_CONSTRUCTION_STATE);
special_flags: bitmask(INDTILE_FLAG_ACCEPT_ALL);
}
graphics {
tile_check: bistro01_terrain_check;
bistro01_tile_fences;
}
}