bin/ai/wrightai/main.nut
branchnoai
changeset 11051 00251d01f070
parent 10888 8a74bb2691b0
equal deleted inserted replaced
11048:186fcb00d2a5 11051:00251d01f070
   304 function WrightAI::HandleEvents()
   304 function WrightAI::HandleEvents()
   305 {
   305 {
   306 	while (AIEventController.IsEventWaiting()) {
   306 	while (AIEventController.IsEventWaiting()) {
   307 		local e = AIEventController.GetNextEvent();
   307 		local e = AIEventController.GetNextEvent();
   308 		switch (e.GetEventType()) {
   308 		switch (e.GetEventType()) {
   309 			case AIEvent.AI_ET_CRASHED_VEHICLE:
   309 			case AIEvent.AI_ET_VEHICLE_CRASHED:
   310 				local ec = AIEventVehicleCrash.Convert(e);
   310 				local ec = AIEventVehicleCrashed.Convert(e);
   311 				local v = ec.GetVehicleID();
   311 				local v = ec.GetVehicleID();
   312 				AILog.Info("We have a crashed vehicle (" + v + "), buying a new one as replacement");
   312 				AILog.Info("We have a crashed vehicle (" + v + "), buying a new one as replacement");
   313 				this.BuildAircraft(this.route_1.GetValue(v), this.route_2.GetValue(v));
   313 				this.BuildAircraft(this.route_1.GetValue(v), this.route_2.GetValue(v));
   314 				this.route_1.RemoveItem(v);
   314 				this.route_1.RemoveItem(v);
   315 				this.route_2.RemoveItem(v);
   315 				this.route_2.RemoveItem(v);