// check the training message que to see if we should play a new message yet or not.
// Goober5000: removed stipulation of instructor being present
void message_training_que_check()
{
	int i, j, iship_num;

	// get the instructor's ship.
	iship_num = ship_name_lookup(NOX("instructor"));
//	if ( iship_num == -1 )	// commented out by Goober5000
//		return;

	// if the instructor is dying or departing, do nothing
	if ( iship_num != -1 )	// added by Goober5000
		if (Ships[iship_num].flags & (SF_DYING | SF_DEPARTING))
			return;

	if (Training_failure)
		return;

	for (i=0; i<Training_msg_que_count; i++) {
		if (timestamp_elapsed(Training_msg_que[i].timestamp)) {
			message_training_setup(Training_msg_que[i].num, Training_msg_que[i].length);
			// remove this message from the que now.
			for (j=i+1; j<Training_msg_que_count; j++)
				Training_msg_que[j - 1] = Training_msg_que[j];

			i--;
			Training_msg_que_count--;
		}
	}
}
/**
 * Check the training message queue to see if we should play a new message yet or not.
 */
void message_training_queue_check()
{
	int i, iship_num;

	// get the instructor's ship.
	iship_num = ship_name_lookup(NOX("instructor"));

	// if the instructor is dying or departing, do nothing
	if ( iship_num != -1 )	// added by Goober5000
		if (Ships[iship_num].flags & (SF_DYING | SF_DEPARTING))
			return;

	if (Training_failure)
		return;

	for (i=0; i<Training_message_queue_count; i++) {
		if (timestamp_elapsed(Training_message_queue[i].timestamp)) {
			message_training_setup(Training_message_queue[i].num, Training_message_queue[i].length, Training_message_queue[i].special_message);

			// remove this message from the queue now.
			message_training_remove_from_queue(i);
			i--;
		}
	}
}