Changeset - r1197:5c12672cee22
[Not reviewed]
master
0 6 0
tron - 20 years ago 2005-01-27 21:18:03
tron@openttd.org
(svn r1701) Style police ^^
6 files changed with 12 insertions and 13 deletions:
0 comments (0 inline, 0 general)
aircraft_cmd.c
Show inline comments
 
@@ -161,7 +161,7 @@ int32 CmdBuildAircraft(int x, int y, uin
 
	const AircraftVehicleInfo *avi = AircraftVehInfo(p1);
 
	Engine *e;
 

	
 
	if (!(IsEngineBuildable(p1, VEH_Aircraft))) return CMD_ERROR;
 
	if (!IsEngineBuildable(p1, VEH_Aircraft)) return CMD_ERROR;
 

	
 
	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 

	
engine.c
Show inline comments
 
@@ -906,17 +906,20 @@ const ChunkHandler _engine_chunk_handler
 
	{ 'ENGS', LoadSave_ENGS, LoadSave_ENGS, CH_RIFF | CH_LAST},
 
};
 

	
 

	
 
/*
 
 * returns true if an engine is valid, and it is of the specified type, and buildable by the current player, false otherwise
 
 * returns true if an engine is valid, of the specified type, and buildable by
 
 * the current player, false otherwise
 
 *
 
 * engine = index of the engine to check
 
 * type   = the type the engine should be of (VEH_xxx)
 
 */
 
bool IsEngineBuildable(int engine, byte type) {
 
	Engine *e;
 
bool IsEngineBuildable(uint engine, byte type)
 
{
 
	const Engine *e;
 

	
 
	// check if it's an engine that is in the engine array
 
	if (0 > engine || engine >= TOTAL_NUM_ENGINES ) return false;
 
	if (engine >= TOTAL_NUM_ENGINES) return false;
 

	
 
	e = DEREF_ENGINE(engine);
 

	
 
@@ -928,7 +931,3 @@ bool IsEngineBuildable(int engine, byte 
 

	
 
	return true;
 
}
 

	
 

	
 

	
 

	
engine.h
Show inline comments
 
@@ -133,7 +133,7 @@ void AcceptEnginePreview(Engine *e, int 
 
void LoadCustomEngineNames(void);
 
void DeleteCustomEngineNames(void);
 

	
 
bool IsEngineBuildable(int engine, byte type);
 
bool IsEngineBuildable(uint engine, byte type);
 

	
 
enum {
 
	NUM_NORMAL_RAIL_ENGINES = 54,
roadveh_cmd.c
Show inline comments
 
@@ -115,7 +115,7 @@ int32 CmdBuildRoadVeh(int x, int y, uint
 
	uint tile = TILE_FROM_XY(x,y);
 
	Engine *e;
 

	
 
	if (!(IsEngineBuildable(p1, VEH_Road))) return CMD_ERROR;
 
	if (!IsEngineBuildable(p1, VEH_Road)) return CMD_ERROR;
 

	
 
	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 

	
ship_cmd.c
Show inline comments
 
@@ -816,7 +816,7 @@ int32 CmdBuildShip(int x, int y, uint32 
 
	uint tile = TILE_FROM_XY(x,y);
 
	Engine *e;
 

	
 
	if (!(IsEngineBuildable(p1, VEH_Ship))) return CMD_ERROR;
 
	if (!IsEngineBuildable(p1, VEH_Ship)) return CMD_ERROR;
 

	
 
	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 

	
train_cmd.c
Show inline comments
 
@@ -525,7 +525,7 @@ int32 CmdBuildRailVehicle(int x, int y, 
 
	Engine *e;
 
	uint tile;
 

	
 
	if (!(IsEngineBuildable(p1, VEH_Train))) return CMD_ERROR;
 
	if (!IsEngineBuildable(p1, VEH_Train)) return CMD_ERROR;
 

	
 
	_cmd_build_rail_veh_var1 = 0;
 

	
0 comments (0 inline, 0 general)