Fix train variable 0x63 using wrong rail type on dual rail type tiles
This commit is contained in:
		@@ -836,7 +836,7 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object,
 | 
			
		||||
				case VEH_TRAIN: {
 | 
			
		||||
					RailType param_type = GetRailTypeTranslation(parameter, object->ro.grffile);
 | 
			
		||||
					if (param_type == INVALID_RAILTYPE) return 0x00;
 | 
			
		||||
					RailType tile_type = GetTileRailType(v->tile);
 | 
			
		||||
					RailType tile_type = GetTileRailTypeByTrackBit(v->tile, Train::From(v)->track);
 | 
			
		||||
					if (tile_type == param_type) return 0x0F;
 | 
			
		||||
					return (HasPowerOnRail(param_type, tile_type) ? 0x04 : 0x00) |
 | 
			
		||||
							(IsCompatibleRail(param_type, tile_type) ? 0x02 : 0x00) |
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user