From dce1101039d8a5a104ee59df36b15f1909503b12 Mon Sep 17 00:00:00 2001 From: maedhros Date: Fri, 1 Jun 2007 11:17:30 +0000 Subject: (svn r10007) -Codechange: Add some asserts to IsFrontEngine and friends to ensure that only trains use them. --- src/train_cmd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/train_cmd.cpp') diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index ecc9965aa..7e5c74cfb 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -619,8 +619,10 @@ static int32 CmdBuildRailWagon(EngineID engine, TileIndex tile, uint32 flags) v->u.rail.track = TRACK_BIT_DEPOT; v->vehstatus = VS_HIDDEN | VS_DEFPAL; + v = new (v) Train(); v->subtype = 0; SetTrainWagon(v); + if (u != NULL) { u->next = v; } else { @@ -637,7 +639,6 @@ static int32 CmdBuildRailWagon(EngineID engine, TileIndex tile, uint32 flags) v->u.rail.railtype = rvi->railtype; v->build_year = _cur_year; - v = new (v) Train(); v->cur_image = 0xAC2; v->random_bits = VehicleRandomBits(); -- cgit v1.2.3-54-g00ecf