File diff r27883:ddbd33508a8a → r27884:803962be0328
src/newgrf_roadstop.cpp
Show inline comments
 
@@ -152,49 +152,49 @@ uint32_t RoadStopScopeResolver::GetVaria
 
			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) | ClampTo<uint8_t>(ssl.localidx);
 
			}
 
			return res;
 
		}
 

	
 
		/* GRFID of nearby road stop tiles */
 
		case 0x6A: {
 
			if (this->tile == INVALID_TILE) return 0xFFFFFFFF;
 
			TileIndex nearby_tile = GetNearbyTile(parameter, this->tile);
 

	
 
			if (!IsRoadStopTile(nearby_tile)) return 0xFFFFFFFF;
 
			if (!IsCustomRoadStopSpecIndex(nearby_tile)) return 0;
 

	
 
			const RoadStopSpecList ssl = BaseStation::GetByTile(nearby_tile)->roadstop_speclist[GetCustomRoadStopSpecIndex(nearby_tile)];
 
			return ssl.grfid;
 
		}
 

	
 
		case 0xF0: return this->st == nullptr ? 0 : this->st->facilities; // facilities
 

	
 
		case 0xFA: return ClampTo<uint16_t>((this->st == nullptr ? TimerGameCalendar::date : this->st->build_date) - DAYS_TILL_ORIGINAL_BASE_YEAR); // build date
 
		case 0xFA: return ClampTo<uint16_t>((this->st == nullptr ? TimerGameCalendar::date : this->st->build_date) - CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR); // build date
 
	}
 

	
 
	if (this->st != nullptr) return this->st->GetNewGRFVariable(this->ro, variable, parameter, available);
 

	
 
	*available = false;
 
	return UINT_MAX;
 
}
 

	
 
const SpriteGroup *RoadStopResolverObject::ResolveReal(const RealSpriteGroup *group) const
 
{
 
	if (group == nullptr) return nullptr;
 

	
 
	return group->loading[0];
 
}
 

	
 
RoadStopResolverObject::RoadStopResolverObject(const RoadStopSpec *roadstopspec, BaseStation *st, TileIndex tile, RoadType roadtype, StationType type, uint8_t view,
 
		CallbackID callback, uint32_t param1, uint32_t param2)
 
	: ResolverObject(roadstopspec->grf_prop.grffile, callback, param1, param2), roadstop_scope(*this, st, roadstopspec, tile, roadtype, type, view)
 
	{
 

	
 
	this->town_scope = nullptr;
 

	
 
	CargoID ctype = CT_DEFAULT_NA;