src/disaster_cmd.cpp
branchgamebalance
changeset 9895 7bd07f43b0e3
parent 6479 b228a94a1832
child 9907 3b068c3a1c74
--- a/src/disaster_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/disaster_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -116,11 +116,11 @@
 }
 
 
-/** Initialize a disaster vehicle. These vehicles are of type VEH_Disaster, are unclickable
+/** Initialize a disaster vehicle. These vehicles are of type VEH_DISASTER, are unclickable
  * and owned by nobody */
 static void InitializeDisasterVehicle(Vehicle *v, int x, int y, byte z, Direction direction, byte subtype)
 {
-	v->type = VEH_Disaster;
+	v->type = VEH_DISASTER;
 	v->x_pos = x;
 	v->y_pos = y;
 	v->z_pos = z;
@@ -135,9 +135,7 @@
 	v->owner = OWNER_NONE;
 	v->vehstatus = VS_UNCLICKABLE;
 	v->u.disaster.image_override = 0;
-	v->current_order.type = OT_NOTHING;
-	v->current_order.flags = 0;
-	v->current_order.dest = 0;
+	v->current_order.Free();
 
 	DisasterVehicleUpdateImage(v);
 	VehiclePositionChanged(v);
@@ -330,7 +328,7 @@
 		v->current_order.dest = 1;
 
 		FOR_ALL_VEHICLES(u) {
-			if (u->type == VEH_Road && IsHumanPlayer(u->owner)) {
+			if (u->type == VEH_ROAD && IsHumanPlayer(u->owner)) {
 				v->dest_tile = u->index;
 				v->age = 0;
 				return;
@@ -341,7 +339,7 @@
 	} else {
 		/* Target a vehicle */
 		u = GetVehicle(v->dest_tile);
-		if (u->type != VEH_Road) {
+		if (u->type != VEH_ROAD) {
 			DeleteDisasterVeh(v);
 			return;
 		}
@@ -590,7 +588,7 @@
 		v->current_order.dest = 2;
 
 		FOR_ALL_VEHICLES(u) {
-			if (u->type == VEH_Train || u->type == VEH_Road) {
+			if (u->type == VEH_TRAIN || u->type == VEH_ROAD) {
 				if (delta(u->x_pos, v->x_pos) + delta(u->y_pos, v->y_pos) <= 12 * TILE_SIZE) {
 					u->breakdown_ctr = 5;
 					u->breakdown_delay = 0xF0;
@@ -758,12 +756,12 @@
 	// not used
 }
 
-typedef void DisasterInitProc(void);
+typedef void DisasterInitProc();
 
 
 /** Zeppeliner which crashes on a small airport if one found,
  * otherwise crashes on a random tile */
-static void Disaster_Zeppeliner_Init(void)
+static void Disaster_Zeppeliner_Init()
 {
 	Vehicle *v = ForceAllocateSpecialVehicle(), *u;
 	Station *st;
@@ -797,7 +795,7 @@
 
 /** Ufo which flies around aimlessly from the middle of the map a bit
  * until it locates a road vehicle which it targets and then destroys */
-static void Disaster_Small_Ufo_Init(void)
+static void Disaster_Small_Ufo_Init()
 {
 	Vehicle *v = ForceAllocateSpecialVehicle(), *u;
 	int x;
@@ -821,7 +819,7 @@
 
 
 /* Combat airplane which destroys an oil refinery */
-static void Disaster_Airplane_Init(void)
+static void Disaster_Airplane_Init()
 {
 	Industry *i, *found;
 	Vehicle *v, *u;
@@ -857,7 +855,7 @@
 
 
 /** Combat helicopter that destroys a factory */
-static void Disaster_Helicopter_Init(void)
+static void Disaster_Helicopter_Init()
 {
 	Industry *i, *found;
 	Vehicle *v, *u, *w;
@@ -899,7 +897,7 @@
 
 /* Big Ufo which lands on a piece of rail and will consequently be shot
  * down by a combat airplane, destroying the surroundings */
-static void Disaster_Big_Ufo_Init(void)
+static void Disaster_Big_Ufo_Init()
 {
 	Vehicle *v = ForceAllocateSpecialVehicle(), *u;
 	int x, y;
@@ -924,7 +922,7 @@
 
 
 /* Curious submarine #1, just floats around */
-static void Disaster_Small_Submarine_Init(void)
+static void Disaster_Small_Submarine_Init()
 {
 	Vehicle *v = ForceAllocateSpecialVehicle();
 	int x, y;
@@ -949,7 +947,7 @@
 
 
 /* Curious submarine #2, just floats around */
-static void Disaster_Big_Submarine_Init(void)
+static void Disaster_Big_Submarine_Init()
 {
 	Vehicle *v = ForceAllocateSpecialVehicle();
 	int x,y;
@@ -975,7 +973,7 @@
 
 /** Coal mine catastrophe, destroys a stretch of 30 tiles of
  * land in a certain direction */
-static void Disaster_CoalMine_Init(void)
+static void Disaster_CoalMine_Init()
 {
 	int index = GB(Random(), 0, 4);
 	uint m;
@@ -1031,7 +1029,7 @@
 };
 
 
-static void DoDisaster(void)
+static void DoDisaster()
 {
 	byte buf[lengthof(_dis_years)];
 	uint i;
@@ -1048,12 +1046,12 @@
 }
 
 
-static void ResetDisasterDelay(void)
+static void ResetDisasterDelay()
 {
 	_disaster_delay = GB(Random(), 0, 9) + 730;
 }
 
-void DisasterDailyLoop(void)
+void DisasterDailyLoop()
 {
 	if (--_disaster_delay != 0) return;
 
@@ -1062,7 +1060,7 @@
 	if (_opt.diff.disasters != 0) DoDisaster();
 }
 
-void StartupDisasters(void)
+void StartupDisasters()
 {
 	ResetDisasterDelay();
 }