// check to see if we need to be warping out (strange transition possibilities)
void multi_endgame_check_for_warpout()
{
	int need_to_warpout = 0;

	// if we're not in the process of warping out - do nothing
	if(!(Net_player->flags & NETINFO_FLAG_WARPING_OUT)){
		return;
	}

	// determine if sufficient warping-out conditions exist
	if((Game_mode & GM_IN_MISSION) &&										// if i'm still in the mission
		((Netgame.game_state == NETGAME_STATE_ENDGAME)	||				// if the netgame ended
		 (Netgame.game_state == NETGAME_STATE_DEBRIEF))					// if the netgame is now in the debriefing state
	  ) {
		need_to_warpout = 1;
	}

	// if we need to be warping out but are stuck in a dead popup, cancel it
	if(need_to_warpout && (popupdead_is_active() || (Net_player->flags & NETINFO_FLAG_RESPAWNING) || (Net_player->flags & NETINFO_FLAG_OBSERVER)) ){		
		// flush all active pushed state
		multi_handle_state_special();

		// begin the warpout process		
		send_debrief_event();

		// if text input mode is active, clear it
		multi_msg_text_flush();
	}	
}
// (client) call when receiving a packet indicating we should unpause
void multi_pause_unpause()
{
	int idx;

	// if we're already unpaused, don't do anything
	if(!Multi_pause_status){
		return;
	}

	// sanity check
	Assert(Multi_pause_status);

	// mark the game as being unpaused
	Multi_pause_status = 0;

	// pop us out of any necessary states (including the pause state !!)
	multi_handle_state_special();
	
	// mark the netgame state
	Netgame.game_state = NETGAME_STATE_IN_MISSION;			

	// if we're the server of the game, send a packet which will unpause the clients in the game now
	// if we're the server of the game, send a packet which will pause the clients in the game now
	if(Net_player->flags & NETINFO_FLAG_AM_MASTER){
		for(idx=0;idx<MAX_PLAYERS;idx++){
			if(MULTI_CONNECTED(Net_players[idx]) && (Net_player != &Net_players[idx])){
				send_client_update_packet(&Net_players[idx]);
			}
		}
	}
}