mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-09-01 19:09:09 +00:00
(svn r16527) -Codechange: use static member functions instead of simple casts when converting Vehicle to specialised vehicle types. Includes safety check
This commit is contained in:
@@ -184,7 +184,7 @@ static SmallSet<DiagDirection, SIG_GLOB_SIZE> _globset("_globset"); ///< set of
|
||||
/** Check whether there is a train on rail, not in a depot */
|
||||
static Vehicle *TrainOnTileEnum(Vehicle *v, void *)
|
||||
{
|
||||
if (v->type != VEH_TRAIN || ((Train *)v)->track == TRACK_BIT_DEPOT) return NULL;
|
||||
if (v->type != VEH_TRAIN || Train::From(v)->track == TRACK_BIT_DEPOT) return NULL;
|
||||
|
||||
return v;
|
||||
}
|
||||
|
Reference in New Issue
Block a user