From 9c552d16317a7fe1ff4516c5021ebd0e7c82b906 Mon Sep 17 00:00:00 2001 From: Darkvater Date: Mon, 30 May 2005 14:45:36 +0000 Subject: (svn r2383) - Fix: Monkey-testing turned up some command crashes. --- aircraft_cmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'aircraft_cmd.c') diff --git a/aircraft_cmd.c b/aircraft_cmd.c index c6cf89282..333679295 100644 --- a/aircraft_cmd.c +++ b/aircraft_cmd.c @@ -170,7 +170,7 @@ int32 CmdBuildAircraft(int x, int y, uint32 flags, uint32 p1, uint32 p2) Vehicle *vl[3], *v, *u, *w; UnitID unit_num; TileIndex tile = TILE_FROM_XY(x,y); - const AircraftVehicleInfo *avi = AircraftVehInfo(p1); + const AircraftVehicleInfo *avi; Engine *e; if (!IsEngineBuildable(p1, VEH_Aircraft)) return CMD_ERROR; @@ -186,6 +186,7 @@ int32 CmdBuildAircraft(int x, int y, uint32 flags, uint32 p1, uint32 p2) if (flags & DC_QUERY_COST) return value; + avi = AircraftVehInfo(p1); // allocate 2 or 3 vehicle structs, depending on type if (!AllocateVehicles(vl, (avi->subtype & 1) == 0 ? 3 : 2) || IsOrderPoolFull()) -- cgit v1.2.3-54-g00ecf