File diff r15609:02b794721f9c → r15610:623a23fb6560
src/engine.cpp
Show inline comments
 
@@ -35,13 +35,14 @@
 

	
 
EnginePool _engine_pool("Engine");
 
INSTANTIATE_POOL_METHODS(Engine)
 

	
 
EngineOverrideManager _engine_mngr;
 

	
 
/** Year that engine aging stops. Engines will not reduce in reliability
 
/**
 
 * Year that engine aging stops. Engines will not reduce in reliability
 
 * and no more engines will be introduced */
 
static Year _year_engine_aging_stops;
 

	
 
/** Number of engines of each vehicle type in original engine data */
 
const uint8 _engine_counts[4] = {
 
	lengthof(_orig_rail_vehicle_info),
 
@@ -396,13 +397,14 @@ EngineID EngineOverrideManager::GetID(Ve
 
			return index;
 
		}
 
	}
 
	return INVALID_ENGINE;
 
}
 

	
 
/** Sets cached values in Company::num_vehicles and Group::num_vehicles
 
/**
 
 * Sets cached values in Company::num_vehicles and Group::num_vehicles
 
 */
 
void SetCachedEngineCounts()
 
{
 
	size_t engines = Engine::GetPoolSize();
 

	
 
	/* Set up the engine count for all companies */
 
@@ -650,13 +652,14 @@ void EnginesDailyLoop()
 
				if (IsInteractiveCompany(best_company)) ShowEnginePreviewWindow(i);
 
			}
 
		}
 
	}
 
}
 

	
 
/** Accept an engine prototype. XXX - it is possible that the top-company
 
/**
 
 * Accept an engine prototype. XXX - it is possible that the top-company
 
 * changes while you are waiting to accept the offer? Then it becomes invalid
 
 * @param tile unused
 
 * @param flags operation to perfom
 
 * @param p1 engine-prototype offered
 
 * @param p2 unused
 
 * @param text unused
 
@@ -763,13 +766,14 @@ static bool IsUniqueEngineName(const cha
 
		if (e->name != NULL && strcmp(e->name, name) == 0) return false;
 
	}
 

	
 
	return true;
 
}
 

	
 
/** Rename an engine.
 
/**
 
 * Rename an engine.
 
 * @param tile unused
 
 * @param flags operation to perfom
 
 * @param p1 engine ID to rename
 
 * @param p2 unused
 
 * @param text the new name or an empty string when resetting to the default
 
 * @return the cost of this operation or an error
 
@@ -799,13 +803,14 @@ CommandCost CmdRenameEngine(TileIndex ti
 
	}
 

	
 
	return CommandCost();
 
}
 

	
 

	
 
/** Check if an engine is buildable.
 
/**
 
 * Check if an engine is buildable.
 
 * @param engine  index of the engine to check.
 
 * @param type    the type the engine should be.
 
 * @param company index of the company.
 
 * @return True if an engine is valid, of the specified type, and buildable by
 
 *              the given company.
 
 */