src/aircraft_cmd.cpp
changeset 6589 addf4b6946d0
parent 6585 7da94b26498a
child 6642 2e690e6fdc03
child 9476 1d1ed96f32ad
--- a/src/aircraft_cmd.cpp	Thu Mar 08 21:05:05 2007 +0000
+++ b/src/aircraft_cmd.cpp	Thu Mar 08 21:39:34 2007 +0000
@@ -1273,8 +1273,7 @@
 
 			if (CmdFailed(ret)) CrashAirplane(v);
 		} else if (v->current_order.type != OT_GOTO_DEPOT) {
-			v->current_order.type = OT_NOTHING;
-			v->current_order.flags = 0;
+			v->current_order.Free();
 		}
 		return;
 	}
@@ -1326,8 +1325,7 @@
 			}
 
 			Order b = v->current_order;
-			v->current_order.type = OT_NOTHING;
-			v->current_order.flags = 0;
+			v->current_order.Free();
 			MarkAircraftDirty(v);
 			if (!(b.flags & OF_NON_STOP)) return;
 			break;
@@ -1552,8 +1550,7 @@
 
 	/* if we were sent to the depot, stay there */
 	if (v->current_order.type == OT_GOTO_DEPOT && (v->vehstatus & VS_STOPPED)) {
-		v->current_order.type = OT_NOTHING;
-		v->current_order.flags = 0;
+		v->current_order.Free();
 		return;
 	}
 
@@ -1601,7 +1598,7 @@
 		return;
 	}
 
-	if (v->current_order.type == OT_NOTHING) return;
+	if (!v->current_order.IsValid()) return;
 
 	/* if the block of the next position is busy, stay put */
 	if (AirportHasBlock(v, &apc->layout[v->u.air.pos], apc)) return;
@@ -1622,8 +1619,7 @@
 			}
 			break;
 		default:  // orders have been deleted (no orders), goto depot and don't bother us
-			v->current_order.type = OT_NOTHING;
-			v->current_order.flags = 0;
+			v->current_order.Free();
 			v->u.air.state = HANGAR;
 	}
 	AirportMove(v, apc);