Changeset - r70:ccf7bc6bc5a2
[Not reviewed]
master
0 5 0
darkvater - 20 years ago 2004-08-16 22:35:17
darkvater@openttd.org
(svn r71) -Cheat: [976127] no extra frequent jet crash on small airports (truesatan)
-Changed some debug messages in aircraft code to DEBUG(misc, 1)
5 files changed with 10 insertions and 7 deletions:
0 comments (0 inline, 0 general)
aircraft_cmd.c
Show inline comments
 
@@ -1129,13 +1129,13 @@ static void MaybeCrashAirplane(Vehicle *
 
	uint16 amt;
 

	
 
	st = DEREF_STATION(v->u.air.targetairport);
 

	
 
	//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;
 
	}
 

	
 
	if ((uint16)Random() > prob)
 
		return;
 

	
 
@@ -1388,14 +1388,14 @@ static void AircraftEventHandler_AtTermi
 
	}
 
	AirportMove(v, Airport);
 
}
 

	
 
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) {
 
	PlayAircraftSound(v); // play takeoffsound for airplanes
 
	v->u.air.state = STARTTAKEOFF;
 
}
 
@@ -1562,13 +1562,13 @@ static bool AirportMove(Vehicle *v, cons
 
	AirportFTA *current;
 
	byte prev_pos;
 
	bool retval = false;
 

	
 
	// 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);
 
	}
 

	
 
	current = &Airport->layout[v->u.air.pos];
 
	// we have arrived in an important state (eg terminal, hangar, etc.)
 
	if (current->heading == v->u.air.state) {
 
@@ -1597,14 +1597,14 @@ static bool AirportMove(Vehicle *v, cons
 
					} // move to next position
 
					return retval;
 
		}
 
		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;
 
}
 

	
 
// returns true if the road ahead is busy, eg. you must wait before proceeding
 
static bool AirportHasBlock(Vehicle *v, AirportFTA *current_pos, const AirportFTAClass *Airport)
lang/english.txt
Show inline comments
 
@@ -1024,12 +1024,13 @@ STR_CHEATS_TIP								:{BLACK}Checkboxes
 
STR_CHEATS_WARNING						:{BLACK}Warning! You are about to betray your fellow competitors. Keep in mind that such a disgrace will be remembered for eternity.
 
STR_CHEAT_MONEY								:{LTBLUE}Increase money by {CURRENCY64}
 
STR_CHEAT_CHANGE_PLAYER				:{LTBLUE}Playing as player: {ORANGE}{COMMA16}
 
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
 

	
 
STR_HEADING_FOR_CHECKPOINT				:{LTBLUE}Heading for {CHECKPOINT}
 
STR_HEADING_FOR_CHECKPOINT_VEL			:{LTBLUE}Heading for {CHECKPOINT}, {VELOCITY}
 

	
misc_gui.c
Show inline comments
 
@@ -1400,12 +1400,13 @@ static void WriteCE(const CheatEntry *ce
 
static const CheatEntry _cheats_ui[] = {
 
	{CE_CLICK, 0, STR_CHEAT_MONEY, 					&_cheats.money.value, 					&_cheats.money.been_used, 				&ClickMoneyCheat},
 
	{CE_UINT8, 0, STR_CHEAT_CHANGE_PLAYER, 	&_local_player, 								&_cheats.switch_player.been_used,	&ClickChangePlayerCheat, 0, 11, 1},
 
	{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},
 
};
 

	
 

	
 
static const Widget _cheat_widgets[] = {
 
{   WWT_CLOSEBOX,    14,     0,    10,     0,    13, STR_00C5,			STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,    14,    11,   399,     0,    13, STR_CHEATS,	STR_018C_WINDOW_TITLE_DRAG_THIS},
variables.h
Show inline comments
 
@@ -173,12 +173,13 @@ typedef struct Cheat {
 
typedef struct Cheats {
 
	Cheat magic_bulldozer;		// dynamite industries, unmovables
 
	Cheat switch_player;			// change to another player
 
	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;
 

	
 
typedef struct Paths {
 
	char *personal_dir;  // includes cfg file and save folder 
window.c
Show inline comments
 
@@ -1020,13 +1020,13 @@ void MouseLoop()
 

	
 
		if (mousewheel && !(w->flags4 & WF_DISABLE_VP_SCROLL)) {
 
			ZoomInOrOutToCursor(mousewheel < 0);
 
		}
 

	
 
		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) &&
 
					_pause != 0 &&
 
					!_cheats.build_in_pause.value)
 
						return;
0 comments (0 inline, 0 general)