(svn r16441) -Codechange: new class SpecializedVehicle used as superclass for all vehicle types

This commit is contained in:
smatz
2009-05-26 22:10:13 +00:00
parent aa546e513f
commit 7ee882d03f
15 changed files with 150 additions and 135 deletions

View File

@@ -432,10 +432,8 @@ CommandCost CmdSendRoadVehToDepot(TileIndex tile, DoCommandFlag flags, uint32 p1
*/
CommandCost CmdTurnRoadVeh(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
{
Vehicle *u = Vehicle::GetIfValid(p1);
if (u == NULL || u->type != VEH_ROAD || !CheckOwnership(u->owner)) return CMD_ERROR;
RoadVehicle *v = (RoadVehicle *)u;
RoadVehicle *v = RoadVehicle::GetIfValid(p1);
if (v == NULL || !CheckOwnership(v->owner)) return CMD_ERROR;
if (v->vehstatus & VS_STOPPED ||
v->vehstatus & VS_CRASHED ||
@@ -2065,7 +2063,7 @@ CommandCost CmdRefitRoadVeh(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
}
}
if (flags & DC_EXEC) RoadVehUpdateCache((RoadVehicle *)Vehicle::Get(p1)->First());
if (flags & DC_EXEC) RoadVehUpdateCache(RoadVehicle::Get(p1)->First());
_returned_refit_capacity = total_capacity;