Changeset - r20799:8be44cbca7c9
[Not reviewed]
master
0 1 0
frosch - 11 years ago 2013-10-12 16:35:32
frosch@openttd.org
(svn r25843) -Codechange: Rename MAX_SPECLIST to NUM_STATIONSSPECS_PER_STATION.
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/newgrf_station.cpp
Show inline comments
 
@@ -48,7 +48,7 @@ bool NewGRFClass<Tspec, Tid, Tmax>::IsUI
 

	
 
INSTANTIATE_NEWGRF_CLASS_METHODS(StationClass, StationSpec, StationClassID, STAT_CLASS_MAX)
 

	
 
static const uint MAX_SPECLIST = 255;
 
static const uint NUM_STATIONSSPECS_PER_STATION = 255; ///< Maximum number of parts per station.
 

	
 
enum TriggerArea {
 
	TA_TILE,
 
@@ -697,17 +697,17 @@ int AllocateSpecToStation(const StationS
 

	
 
	if (statspec == NULL || st == NULL) return 0;
 

	
 
	for (i = 1; i < st->num_specs && i < MAX_SPECLIST; i++) {
 
	for (i = 1; i < st->num_specs && i < NUM_STATIONSSPECS_PER_STATION; i++) {
 
		if (st->speclist[i].spec == NULL && st->speclist[i].grfid == 0) break;
 
	}
 

	
 
	if (i == MAX_SPECLIST) {
 
	if (i == NUM_STATIONSSPECS_PER_STATION) {
 
		/* As final effort when the spec list is already full...
 
		 * try to find the same spec and return that one. This might
 
		 * result in slightly "wrong" (as per specs) looking stations,
 
		 * but it's fairly unlikely that one reaches the limit anyways.
 
		 */
 
		for (i = 1; i < st->num_specs && i < MAX_SPECLIST; i++) {
 
		for (i = 1; i < st->num_specs && i < NUM_STATIONSSPECS_PER_STATION; i++) {
 
			if (st->speclist[i].spec == statspec) return i;
 
		}
 

	
0 comments (0 inline, 0 general)