summaryrefslogtreecommitdiff
path: root/ship_cmd.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2005-10-29 21:54:28 +0000
committerbjarni <bjarni@openttd.org>2005-10-29 21:54:28 +0000
commit17d341b9021b407a4a88be5968b7d570eac41801 (patch)
treeb3245017ad292e3af887c100aad93208b3a2f430 /ship_cmd.c
parenta110f575d77ded5fe9cbccc9b725169a13c32f14 (diff)
downloadopenttd-17d341b9021b407a4a88be5968b7d570eac41801.tar.xz
(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()
Diffstat (limited to 'ship_cmd.c')
-rw-r--r--ship_cmd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ship_cmd.c b/ship_cmd.c
index 64f853d91..d708b4f47 100644
--- a/ship_cmd.c
+++ b/ship_cmd.c
@@ -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;