aircraft_cmd.c
changeset 4712 4335ad42e163
parent 4656 9c1d8c4d3e60
child 4725 40cccaaa042c
equal deleted inserted replaced
4711:28fbbec5f258 4712:4335ad42e163
  1394 	InvalidateWindowClasses(WC_AIRCRAFT_LIST);
  1394 	InvalidateWindowClasses(WC_AIRCRAFT_LIST);
  1395 
  1395 
  1396 	TriggerVehicle(v, VEHICLE_TRIGGER_DEPOT);
  1396 	TriggerVehicle(v, VEHICLE_TRIGGER_DEPOT);
  1397 
  1397 
  1398 	if (v->current_order.type == OT_GOTO_DEPOT) {
  1398 	if (v->current_order.type == OT_GOTO_DEPOT) {
       
  1399 		int32 cost;
       
  1400 
  1399 		InvalidateWindow(WC_VEHICLE_VIEW, v->index);
  1401 		InvalidateWindow(WC_VEHICLE_VIEW, v->index);
  1400 
  1402 
  1401 		old_order = v->current_order;
  1403 		old_order = v->current_order;
  1402 		v->current_order.type = OT_NOTHING;
  1404 		v->current_order.type = OT_NOTHING;
  1403 		v->current_order.flags = 0;
  1405 		v->current_order.flags = 0;
       
  1406 
       
  1407 		_current_player = v->owner;
       
  1408 		cost = DoCommand(v->tile, v->index, old_order.refit_cargo | old_order.refit_subtype << 8, DC_EXEC, CMD_REFIT_AIRCRAFT);
       
  1409 		if (!CmdFailed(cost) && v->owner == _local_player && cost != 0) ShowCostOrIncomeAnimation(v->x_pos, v->y_pos, v->z_pos, cost);
  1404 
  1410 
  1405 		if (HASBIT(old_order.flags, OFB_PART_OF_ORDERS)) {
  1411 		if (HASBIT(old_order.flags, OFB_PART_OF_ORDERS)) {
  1406 			v->cur_order_index++;
  1412 			v->cur_order_index++;
  1407 		} else if (HASBIT(old_order.flags, OFB_HALT_IN_DEPOT)) { // force depot visit
  1413 		} else if (HASBIT(old_order.flags, OFB_HALT_IN_DEPOT)) { // force depot visit
  1408 			v->vehstatus |= VS_STOPPED;
  1414 			v->vehstatus |= VS_STOPPED;