Example #1
0
int HandleDeathInput(d_event *event)
{
	if (event->type == EVENT_KEY_COMMAND)
	{
		int key = event_key_get(event);

		if (Player_exploded && !key_isfunc(key) && key != KEY_PAUSE && key)
			Death_sequence_aborted  = 1;		//Any key but func or modifier aborts
		if (key == KEY_ESC)
			if (ConsoleObject->flags & OF_EXPLODING)
				Death_sequence_aborted = 1;
	}

	if (Player_exploded && (event->type == EVENT_JOYSTICK_BUTTON_UP || event->type == EVENT_MOUSE_BUTTON_UP))
		Death_sequence_aborted = 1;

#ifdef NETWORK
	if((Game_mode & GM_NETWORK) && (Netgame.SpawnStyle == SPAWN_STYLE_PREVIEW)) {
		if(is_key_rotate_event(event)) {
			Death_sequence_aborted = 0; 
		}		
	}
#endif

	if (Death_sequence_aborted)
	{
		// Causes problems with joystick throttle -- joy_axis data is cleared, and will only
		// be updated when joystick moves (could be long enough for player to notice)
		//game_flush_inputs();
		return 1;
	}

	return 0;
}
Example #2
0
void HandleDeathKey(int key)
{
/*
	Commented out redundant calls because the key used here typically
	will be passed to HandleSystemKey later.  Note that I do this to pause
	which is supposed to pass the ESC key to leave the level.  This
	doesn't work in the DOS version anyway.   -Samir
*/

if (gameStates.app.bPlayerExploded && !key_isfunc (key) && !key_ismod (key))
	gameStates.app.bDeathSequenceAborted  = 1;		//Any key but func or modifier aborts

if (key == KEY_COMMAND + KEY_SHIFTED + KEY_P) {
	gameStates.app.bDeathSequenceAborted  = 0;		// Clear because code above sets this for any key.
	}
else if (key == KEY_PRINT_SCREEN) {
	gameStates.app.bDeathSequenceAborted  = 0;		// Clear because code above sets this for any key.
	}
else if (key == (KEY_COMMAND + KEY_P)) {
	gameStates.app.bDeathSequenceAborted  = 0;		// Clear because code above sets this for any key.
	}
else if (key == KEY_PAUSE)   {
	gameStates.app.bDeathSequenceAborted  = 0;		// Clear because code above sets this for any key.
	}
else if (key == KEY_ESC) {
	if (gameData.objs.consoleP->info.nFlags & OF_EXPLODING)
		gameStates.app.bDeathSequenceAborted = 1;
	}
else if (key == KEY_BACKSPACE)  {
	gameStates.app.bDeathSequenceAborted  = 0;		// Clear because code above sets this for any key.
	Int3 ();
	}
//don't abort death sequence for netgame join/refuse keys
else if ((key == KEY_ALTED + KEY_1) || (key == KEY_ALTED + KEY_2))
	gameStates.app.bDeathSequenceAborted  = 0;
if (gameStates.app.bDeathSequenceAborted)
	GameFlushInputs ();
}