Changeset - r27276:f456603f9cab
[Not reviewed]
master
0 2 0
kiwitreekor - 13 months ago 2023-05-07 18:04:34
kiwitreekor@gmail.com
Fix: Var68 for station and roadstop was broken (#10784)
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/newgrf_roadstop.cpp
Show inline comments
 
@@ -154,13 +154,13 @@ uint32 RoadStopScopeResolver::GetVariabl
 
			StationType type = GetStationType(nearby_tile);
 
			if (type == STATION_TRUCK) res |= (1 << 16);
 
			if (type == this->type) SetBit(res, 20);
 

	
 
			if (IsCustomRoadStopSpecIndex(nearby_tile)) {
 
				const RoadStopSpecList ssl = BaseStation::GetByTile(nearby_tile)->roadstop_speclist[GetCustomRoadStopSpecIndex(nearby_tile)];
 
				res |= 1 << (ssl.grfid != grfid ? 9 : 8) | std::max<uint16_t>(ssl.localidx, 0xFF);
 
				res |= 1 << (ssl.grfid != grfid ? 9 : 8) | ClampTo<uint8_t>(ssl.localidx);
 
			}
 
			return res;
 
		}
 

	
 
		/* GRFID of nearby road stop tiles */
 
		case 0x6A: {
src/newgrf_station.cpp
Show inline comments
 
@@ -361,13 +361,13 @@ TownScopeResolver *StationResolverObject
 
			bool perpendicular = GetRailStationAxis(this->tile) != GetRailStationAxis(nearby_tile);
 
			bool same_station = this->st->TileBelongsToRailStation(nearby_tile);
 
			uint32 res = GB(GetStationGfx(nearby_tile), 1, 2) << 12 | !!perpendicular << 11 | !!same_station << 10;
 

	
 
			if (IsCustomStationSpecIndex(nearby_tile)) {
 
				const StationSpecList ssl = BaseStation::GetByTile(nearby_tile)->speclist[GetCustomStationSpecIndex(nearby_tile)];
 
				res |= 1 << (ssl.grfid != grfid ? 9 : 8) | std::max<uint16_t>(ssl.localidx, 0xFF);
 
				res |= 1 << (ssl.grfid != grfid ? 9 : 8) | ClampTo<uint8_t>(ssl.localidx);
 
			}
 
			return res;
 
		}
 

	
 
		case 0x6A: { // GRFID of nearby station tiles
 
			TileIndex nearby_tile = GetNearbyTile(parameter, this->tile);
0 comments (0 inline, 0 general)