(svn r71) -Cheat: [976127] no extra frequent jet crash on small airports (truesatan)
authordarkvater
Mon, 16 Aug 2004 22:35:17 +0000
changeset 70 60216d94f7c1
parent 69 f8c29cdb388e
child 71 1b8e15a10515
(svn r71) -Cheat: [976127] no extra frequent jet crash on small airports (truesatan)
-Changed some debug messages in aircraft code to DEBUG(misc, 1)
aircraft_cmd.c
lang/english.txt
misc_gui.c
variables.h
window.c
--- a/aircraft_cmd.c	Mon Aug 16 22:15:44 2004 +0000
+++ b/aircraft_cmd.c	Mon Aug 16 22:35:17 2004 +0000
@@ -1132,7 +1132,7 @@
 
 	//FIXME -- MaybeCrashAirplane -> increase crashing chances of very modern airplanes on smaller than AT_METROPOLITAN airports
 	prob = 0x10000 / 1500;
-	if (st->airport_type == AT_SMALL && (_aircraft_subtype[v->engine_type - AIRCRAFT_ENGINES_INDEX]&2)) {
+	if (st->airport_type == AT_SMALL && (_aircraft_subtype[v->engine_type - AIRCRAFT_ENGINES_INDEX]&2) && !_cheats.no_jetcrash.value) {
 		prob = 0x10000 / 20;
 	}
 
@@ -1391,8 +1391,8 @@
 
 static void AircraftEventHandler_General(Vehicle *v, const AirportFTAClass *Airport)
 {
-	printf("OK, you shouldn't be here, check your Airport Scheme!\n");
-	assert(1 == v->u.air.state); // when here state is 0, so this always fails
+	DEBUG(misc, 0) ("OK, you shouldn't be here, check your Airport Scheme!");
+	assert(0);
 }
 
 static void AircraftEventHandler_TakeOff(Vehicle *v, const AirportFTAClass *Airport) {
@@ -1565,7 +1565,7 @@
 
 	// error handling
 	if (v->u.air.pos >= Airport->nofelements) {
-		printf("position %d is not valid for current airport. Max position is %d\n", v->u.air.pos, Airport->nofelements-1);
+		DEBUG(misc, 0) ("position %d is not valid for current airport. Max position is %d", v->u.air.pos, Airport->nofelements-1);
 		assert(v->u.air.pos < Airport->nofelements);
 	}
 
@@ -1600,8 +1600,8 @@
 		current = current->next_in_chain;
 	} while (current != NULL);
 
-	printf("Cannot move further on Airport...! pos:%d state:%d\n", v->u.air.pos, v->u.air.state);
-	printf("Airport entry point: %d, Vehicle: %d\n", Airport->entry_point, v->index);
+	DEBUG(misc, 0) ("Cannot move further on Airport...! pos:%d state:%d", v->u.air.pos, v->u.air.state);
+	DEBUG(misc, 0) ("Airport entry point: %d, Vehicle: %d", Airport->entry_point, v->index);
 	assert(0);
 	return false;
 }
--- a/lang/english.txt	Mon Aug 16 22:15:44 2004 +0000
+++ b/lang/english.txt	Mon Aug 16 22:35:17 2004 +0000
@@ -1027,6 +1027,7 @@
 STR_CHEAT_EXTRA_DYNAMITE			:{LTBLUE}Magic bulldozer (remove industries, unmovables): {ORANGE}{STRING}
 STR_CHEAT_CROSSINGTUNNELS			:{LTBLUE}Tunnels may cross each other: {ORANGE}{STRING}
 STR_CHEAT_BUILD_IN_PAUSE			:{LTBLUE}Build while in pause mode: {ORANGE}{STRING}
+STR_CHEAT_NO_JETCRASH					:{LTBLUE}Jetplanes will not crash (frequently) on small airports: {ORANGE} {STRING}
 
 STR_SORT_BY_POPULATION					:{BLACK}Population
 
--- a/misc_gui.c	Mon Aug 16 22:15:44 2004 +0000
+++ b/misc_gui.c	Mon Aug 16 22:35:17 2004 +0000
@@ -1403,6 +1403,7 @@
 	{CE_BOOL, 0, STR_CHEAT_EXTRA_DYNAMITE,	&_cheats.magic_bulldozer.value,	&_cheats.magic_bulldozer.been_used},
 	{CE_BOOL, 0, STR_CHEAT_CROSSINGTUNNELS,	&_cheats.crossing_tunnels.value,&_cheats.crossing_tunnels.been_used},
 	{CE_BOOL, 0, STR_CHEAT_BUILD_IN_PAUSE,	&_cheats.build_in_pause.value,		&_cheats.build_in_pause.been_used},
+	{CE_BOOL, 0, STR_CHEAT_NO_JETCRASH,			&_cheats.no_jetcrash.value,			&_cheats.no_jetcrash.been_used},
 };
 
 
--- a/variables.h	Mon Aug 16 22:15:44 2004 +0000
+++ b/variables.h	Mon Aug 16 22:35:17 2004 +0000
@@ -176,6 +176,7 @@
 	Cheat money;							// get rich
 	Cheat crossing_tunnels;		// allow tunnels that cross each other
 	Cheat	build_in_pause;			// build while in pause mode
+	Cheat	no_jetcrash;				// no jet will crash on small airports anymore
 } Cheats;
 
 VARDEF Cheats _cheats;
--- a/window.c	Mon Aug 16 22:15:44 2004 +0000
+++ b/window.c	Mon Aug 16 22:35:17 2004 +0000
@@ -1023,7 +1023,7 @@
 		}
 
 		if (click == 1) {
-			DEBUG(misc, 1) ("cursor: 0x%X (%d)", _cursor.sprite, _cursor.sprite);
+			DEBUG(misc, 2) ("cursor: 0x%X (%d)", _cursor.sprite, _cursor.sprite);
 			if (_thd.place_mode != 0 &&
 					// query button and place sign button work in pause mode
 					!(_cursor.sprite == 0x2CF || _cursor.sprite == 0x2D2) &&