Indeed, directly going to the other switch that way got me the intended behaviour and furthermore, with the code attached below, can now ensure that this industry can only be built next to a road but not if there is already another industry (same or other type) on an adjacent tile.
Not a big step for mankind nor OTTD in general, but I'm quite proud of that achievement and a good way to end the day
/* ******************************************************************
* Road_Vehicle_Maintenance_Depot
* ******************************************************************/
spriteset(Road_Vehicle_Maintenance_Depot_spriteset_2_0) { [0, 0, 64, 64, -31, -33, ANIM | NOCROP, "gfx/Utility_Comp.png"] }
spriteset(Road_Vehicle_Maintenance_Depot_spriteset_2_0_snow) { [0, 0, 64, 64, -31, -33, ANIM | NOCROP, "gfx/Utility_Comp_SNOW.png"] }
spritelayout Road_Vehicle_Maintenance_Depot_spritelayout {
childsprite {
sprite: GROUNDSPRITE_NORMAL;
recolour_mode: RECOLOUR_REMAP;
palette: PALETTE_USE_DEFAULT;
hide_sprite: (LOAD_TEMP(13));
always_draw: 1;
}
childsprite {
sprite: GROUNDSPRITE_NORMAL;
recolour_mode: RECOLOUR_REMAP;
palette: PALETTE_USE_DEFAULT;
hide_sprite: (!LOAD_TEMP(13));
always_draw: 1;
}
building {
sprite: Road_Vehicle_Maintenance_Depot_spriteset_2_0(0);
recolour_mode: RECOLOUR_REMAP;
palette: PALETTE_USE_DEFAULT;
xoffset: 0;
yoffset: 0;
zoffset: 0;
xextent: 16;
yextent: 16;
zextent: 16;
always_draw: 0;
hide_sprite: (LOAD_TEMP(55));
}
building {
sprite: Road_Vehicle_Maintenance_Depot_spriteset_2_0_snow(0);
recolour_mode: RECOLOUR_REMAP;
palette: PALETTE_USE_DEFAULT;
xoffset: 0;
yoffset: 0;
zoffset: 0;
xextent: 16;
yextent: 16;
zextent: 16;
always_draw: 0;
hide_sprite: (LOAD_TEMP(45));
}
}
switch(FEAT_INDUSTRYTILES, SELF, Road_Vehicle_Maintenance_Depot_industry_layout_graphics_switch, relative_pos) {
relative_coord(0, 0): Road_Vehicle_Maintenance_Depot_spritelayout;
return 0; // a default is needed, but should never be reached, layout definitions are explicit
}
switch(FEAT_INDUSTRYTILES, PARENT, Road_Vehicle_Maintenance_Depot_industry_graphics_switch_layouts, layout_num) {
1: Road_Vehicle_Maintenance_Depot_industry_layout_graphics_switch;
Road_Vehicle_Maintenance_Depot_industry_layout_graphics_switch; // default
}
switch(FEAT_INDUSTRYTILES, SELF, Road_Vehicle_Maintenance_Depot_industry_construction_state_graphics_switch, construction_state) {
0..2: spritelayout_default_construction_states;
Road_Vehicle_Maintenance_Depot_industry_graphics_switch_layouts; // default
}
switch(FEAT_INDUSTRYTILES, SELF, Road_Vehicle_Maintenance_Depot_store_temp_vars,
[STORE_TEMP(random_bits, 14),
STORE_TEMP(terrain_type == TILETYPE_SNOW, 13) , STORE_TEMP(0, 55),
STORE_TEMP(construction_state != 3 ? 1 : LOAD_TEMP(55), 55),
STORE_TEMP(LOAD_TEMP(13) == 0 ? 1 : LOAD_TEMP(55), 45),
STORE_TEMP(LOAD_TEMP(13) == 1 ? 1 : LOAD_TEMP(55), 55)]) {
Road_Vehicle_Maintenance_Depot_industry_construction_state_graphics_switch; // default
}
switch(FEAT_INDUSTRYTILES, SELF, Road_Vehicle_Maintenance_Depot_switch_graphics, [switch_tile_fences(), switch_terrain_sprite()]) {
Road_Vehicle_Maintenance_Depot_store_temp_vars;
}
switch(FEAT_INDUSTRYTILES, SELF, Road_Vehicle_Maintenance_Depot_tile_1_lc_1,
(nearby_tile_class( 1, 1) == TILE_CLASS_INDUSTRY) |
(nearby_tile_class( 1, 0) == TILE_CLASS_INDUSTRY) |
(nearby_tile_class( 1, -1) == TILE_CLASS_INDUSTRY) |
(nearby_tile_class( 0, -1) == TILE_CLASS_INDUSTRY) |
(nearby_tile_class(-1, -1) == TILE_CLASS_INDUSTRY) |
(nearby_tile_class(-1, 0) == TILE_CLASS_INDUSTRY) |
(nearby_tile_class(-1, 1) == TILE_CLASS_INDUSTRY) |
(nearby_tile_class( 0, 1) == TILE_CLASS_INDUSTRY)) {
1: return CB_RESULT_LOCATION_DISALLOW;
return CB_RESULT_LOCATION_ALLOW;
}
switch(FEAT_INDUSTRYTILES, SELF, Road_Vehicle_Maintenance_Depot_tile_1_lc_2,
(nearby_tile_class( 1, 1) == TILE_CLASS_ROAD) |
(nearby_tile_class( 1, 0) == TILE_CLASS_ROAD) |
(nearby_tile_class( 1, -1) == TILE_CLASS_ROAD) |
(nearby_tile_class( 0, -1) == TILE_CLASS_ROAD) |
(nearby_tile_class(-1, -1) == TILE_CLASS_ROAD) |
(nearby_tile_class(-1, 0) == TILE_CLASS_ROAD) |
(nearby_tile_class(-1, 1) == TILE_CLASS_ROAD) |
(nearby_tile_class( 0, 1) == TILE_CLASS_ROAD)) {
0: return CB_RESULT_LOCATION_DISALLOW;
Road_Vehicle_Maintenance_Depot_tile_1_lc_1;
}
switch (FEAT_INDUSTRYTILES, PARENT, Road_Vehicle_Maintenance_Depot_tile_1_lc_0, (
(((extra_callback_info2 & 0xFF00) >> 8 ) == IND_CREATION_FUND) ||
(((extra_callback_info2 & 0xFF00) >> 8 ) == IND_CREATION_PROSPECT)) ) {
1: return CB_RESULT_LOCATION_ALLOW;
Road_Vehicle_Maintenance_Depot_tile_1_lc_1;
}
item(FEAT_INDUSTRYTILES, Road_Vehicle_Maintenance_Depot_tile_1, 127) {
property {
substitute: 0;
land_shape_flags: bitmask(LSF_ONLY_ON_FLAT_LAND);
special_flags: bitmask(INDTILE_FLAG_ACCEPT_ALL);
animation_triggers: bitmask();
}
graphics {
// tile_check: Road_Vehicle_Maintenance_Depot_tile_1_lc_0;
tile_check: Road_Vehicle_Maintenance_Depot_tile_1_lc_2;
Road_Vehicle_Maintenance_Depot_switch_graphics;
}
}
/* *************************************************
* Definition of the industry
* *************************************************/
tilelayout Road_Vehicle_Maintenance_Depot_industry_layout_tilelayout {
0, 0: Road_Vehicle_Maintenance_Depot_tile_1;
}
switch (FEAT_INDUSTRIES, SELF, Road_Vehicle_Maintenance_Depot_cargo_subtype_display, 1) {
return 0x3800 + string(STR_EMPTY);
}
item(FEAT_INDUSTRIES, Road_Vehicle_Maintenance_Depot, 127) {
property {
substitute: 0;
override: 0;
map_colour: 207;
life_type: IND_LIFE_TYPE_BLACK_HOLE;
min_cargo_distr: 1;
layouts: [Road_Vehicle_Maintenance_Depot_industry_layout_tilelayout];
spec_flags: bitmask(IND_FLAG_LONG_CARGO_TYPE_LISTS);
conflicting_ind_types: [];
random_sound_effects: [];
name: string(STR_IND_Road_Vehicle_Maintenance_Depot);
prob_map_gen: 0;
prob_in_game: 0;
prospect_chance: 0.75;
fund_cost_multiplier: 1;
remove_cost_multiplier: 0;
remove_cost_multiplier: 0;
cargo_types: [accept_cargo("VEHI"), accept_cargo("TYRE")];
nearby_station_name: string(STR_STATION, string(STR_TOWN), string(STR_STATION_Road_Vehicle_Maintenance_Depot));
}
}
item(FEAT_INDUSTRIES, Road_Vehicle_Maintenance_Depot, 127) {
graphics {
build_prod_change: randomise_primary_production_on_build;
extra_text_industry: return string(STR_EXTRA_Road_Vehicle_Maintenance_Depot);
cargo_subtype_display: Road_Vehicle_Maintenance_Depot_cargo_subtype_display;
}
}
/*****************************************************
END Road_Vehicle_Maintenance_Depot
******************************************************/