mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r2274) - Codechange: some comments, parentheses and EngineID typedef for engine_type
This commit is contained in:
parent
61ca460457
commit
adf929fef5
|
@ -955,7 +955,7 @@ int32 CmdSellRailWagon(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
|
|
||||||
/* 2. We are selling the first engine, some special action might be required
|
/* 2. We are selling the first engine, some special action might be required
|
||||||
* here, so take attention */
|
* here, so take attention */
|
||||||
if (flags & DC_EXEC && v == first) {
|
if ((flags & DC_EXEC) && v == first) {
|
||||||
Vehicle *new_f = first->next;
|
Vehicle *new_f = first->next;
|
||||||
|
|
||||||
/* 2.1 If the first wagon is sold, update the first-> pointers to NULL */
|
/* 2.1 If the first wagon is sold, update the first-> pointers to NULL */
|
||||||
|
@ -1043,7 +1043,7 @@ int32 CmdSellRailWagon(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 3. If it is still a valid train after selling, update its acceleration */
|
/* 3. If it is still a valid train after selling, update its acceleration */
|
||||||
if (flags & DC_EXEC && first != NULL && first->subtype == TS_Front_Engine) UpdateTrainAcceleration(first);
|
if ((flags & DC_EXEC) && first != NULL && first->subtype == TS_Front_Engine) UpdateTrainAcceleration(first);
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
return cost;
|
return cost;
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef uint16 UnitID; //! All unitnumber stuff is of this type (or anyway, should be)
|
typedef uint16 UnitID; //! All unitnumber stuff is of this type (or anyway, should be)
|
||||||
|
typedef uint16 EngineID; //! All enginenumbers should be of this type
|
||||||
|
|
||||||
// Prices and also the fractional part.
|
// Prices and also the fractional part.
|
||||||
VARDEF Prices _price;
|
VARDEF Prices _price;
|
||||||
|
|
10
vehicle.h
10
vehicle.h
|
@ -26,9 +26,9 @@ enum VehStatus {
|
||||||
|
|
||||||
// 1 and 3 do not appear to be used
|
// 1 and 3 do not appear to be used
|
||||||
typedef enum TrainSubtypes {
|
typedef enum TrainSubtypes {
|
||||||
TS_Front_Engine = 0,
|
TS_Front_Engine = 0, // Leading engine of a train
|
||||||
TS_Not_First = 2,
|
TS_Not_First = 2, // Wagon or additional engine
|
||||||
TS_Free_Car = 4,
|
TS_Free_Car = 4, // First in a wagon chain (in depot)
|
||||||
} TrainSubtype;
|
} TrainSubtype;
|
||||||
|
|
||||||
/* Effect vehicle types */
|
/* Effect vehicle types */
|
||||||
|
@ -161,7 +161,7 @@ struct Vehicle {
|
||||||
byte z_height; // z-height of vehicle sprite
|
byte z_height; // z-height of vehicle sprite
|
||||||
int8 x_offs; // x offset for vehicle sprite
|
int8 x_offs; // x offset for vehicle sprite
|
||||||
int8 y_offs; // y offset for vehicle sprite
|
int8 y_offs; // y offset for vehicle sprite
|
||||||
uint16 engine_type;
|
EngineID engine_type;
|
||||||
|
|
||||||
// for randomized variational spritegroups
|
// for randomized variational spritegroups
|
||||||
// bitmask used to resolve them; parts of it get reseeded when triggers
|
// bitmask used to resolve them; parts of it get reseeded when triggers
|
||||||
|
@ -366,7 +366,7 @@ static inline uint16 GetVehiclePoolSize(void)
|
||||||
/**
|
/**
|
||||||
* Check if a Vehicle really exists.
|
* Check if a Vehicle really exists.
|
||||||
*/
|
*/
|
||||||
static inline bool IsValidVehicle(Vehicle* v)
|
static inline bool IsValidVehicle(const Vehicle *v)
|
||||||
{
|
{
|
||||||
return v->type != 0;
|
return v->type != 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue