src/ai/default/default.cpp
changeset 5609 dc6a58930ba4
parent 5602 bccd4b89e536
child 5733 388bb9dcb79b
--- a/src/ai/default/default.cpp	Thu Jan 11 15:30:35 2007 +0000
+++ b/src/ai/default/default.cpp	Thu Jan 11 17:29:39 2007 +0000
@@ -3575,7 +3575,6 @@
 static void AiStateRemoveStation(Player *p)
 {
 	// Remove stations that aren't in use by any vehicle
-	byte *in_use;
 	const Order *ord;
 	const Station *st;
 	TileIndex tile;
@@ -3584,7 +3583,7 @@
 	p->ai.state = AIS_1;
 
 	// Get a list of all stations that are in use by a vehicle
-	MallocT(&in_use, GetMaxStationIndex() + 1);
+	byte *in_use = MallocT<byte>(GetMaxStationIndex() + 1);
 	memset(in_use, 0, GetMaxStationIndex() + 1);
 	FOR_ALL_ORDERS(ord) {
 		if (ord->type == OT_GOTO_STATION) in_use[ord->dest] = 1;