mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-20 13:09:15 +00:00
(svn r3101) -Codechange: added _new_vehicle_id
this var works like _new_train_id and the rest of that kind of vars, except it is set each time a vehicle is build, nomatter what type this is a nice tool to code vehicle independent code, which in turn can reduce code duplication Right now it's used in ReplaceVehicle() and CmdCloneVehicle()
This commit is contained in:
@@ -907,6 +907,7 @@ int32 CmdBuildShip(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||
v->reliability_spd_dec = e->reliability_spd_dec;
|
||||
v->max_age = e->lifelength * 366;
|
||||
_new_ship_id = v->index;
|
||||
_new_vehicle_id = v->index;
|
||||
|
||||
v->string_id = STR_SV_SHIP_NAME;
|
||||
v->u.ship.state = 0x80;
|
||||
|
Reference in New Issue
Block a user