Mercurial > hg > openttd
diff src/roadveh_cmd.cpp @ 7398:6324d82f421d draft
(svn r10770) -Codechange: use the pool item class as super class for the vehicle struct.
-Codechange: do not force "special" vehicles to be allocated in the low 1024 vehicle slots and non "special" vehicles in the rest of the slots.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Fri, 03 Aug 2007 19:36:00 +0000 |
parents | fba35a9abf79 |
children | 5e887e08fd59 |
line wrap: on
line diff
--- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -185,7 +185,7 @@ Vehicle *vl[11]; memset(&vl, 0, sizeof(vl)); - if (!AllocateVehicles(vl, num_vehicles)) { + if (!Vehicle::AllocateList(vl, num_vehicles)) { return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME); } @@ -372,7 +372,7 @@ InvalidateWindow(WC_COMPANY, v->owner); DeleteWindowById(WC_VEHICLE_VIEW, v->index); DeleteDepotHighlightOfVehicle(v); - DeleteVehicle(v); + delete v; } return CommandCost(-v->value); @@ -610,7 +610,7 @@ BeginVehicleMove(v); EndVehicleMove(v); - DeleteVehicle(v); + delete v; } static byte SetRoadVehPosition(Vehicle *v, int x, int y)