Index: code/pilotfile/pilotfile.cpp
===================================================================
--- code/pilotfile/pilotfile.cpp	(revision 9970)
+++ code/pilotfile/pilotfile.cpp	(working copy)
@@ -182,6 +182,114 @@
 
 void pilotfile::update_stats_backout(scoring_struct *stats, bool training)
 {
+	int i, j;
+	uint idx;
+	size_t list_size;
+	index_list_t ilist;
+	scoring_special_t *p_stats = NULL;
+
+	if (Game_mode & GM_MULTIPLAYER) {
+		p_stats = &multi_stats;
+	} else {
+		p_stats = &all_time_stats;
+	}
+
+	// medals
+	if (stats->m_medal_earned >= 0) {
+		list_size = p_stats->medals_earned.size();
+
+		j = -1;
+
+		for (idx = 0; idx < list_size; idx++) {
+			if ( p_stats->medals_earned[idx].name.compare(Medals[stats->m_medal_earned].name) == 0 ) {
+				j = idx;
+				break;
+			}
+		}
+
+		if (j >= 0) {
+			p_stats->medals_earned[j].val = MAX(0,p_stats->medals_earned[j].val--);
+		} else {
+			Assertion(true, "Medal '%s' not found, should have been added by pilotfile::update_stats.", Medals[stats->m_medal_earned].name);
+		}
+	}
+
+	// only medals can be awarded in training missions
+	if (training) {
+		return;
+	}
+
+	p_stats->score -= stats->m_score;
+
+	p_stats->assists -= stats->m_assists;
+	p_stats->kill_count -= stats->m_kill_count;
+	p_stats->kill_count_ok -= stats->m_kill_count_ok;
+	p_stats->bonehead_kills -= stats->m_bonehead_kills;
+
+	p_stats->p_shots_fired -= stats->mp_shots_fired;
+	p_stats->p_shots_hit -= stats->mp_shots_hit;
+	p_stats->p_bonehead_hits -= stats->mp_bonehead_hits;
+
+	p_stats->s_shots_fired -= stats->ms_shots_fired;
+	p_stats->s_shots_hit -= stats->ms_shots_hit;
+	p_stats->s_bonehead_hits -= stats->ms_bonehead_hits;
+
+	p_stats->flight_time -= (unsigned int)f2i(Missiontime);
+	p_stats->last_flown = p_stats->last_backup;
+	p_stats->missions_flown--;
+
+	if (stats->m_promotion_earned >= 0) {
+		// deal with a multi-rank promotion mission
+		for (i = 0; i < MAX_FREESPACE2_RANK; ++i) {
+			if (p_stats->score <= Ranks[i].points) {
+				p_stats->rank = i-1;
+				break;
+			}
+		}
+		Assertion (p_stats->rank >= 0, "Rank became negative.");
+	}
+
+	// badges
+	if (stats->m_badge_earned >= 0) {
+		list_size = p_stats->medals_earned.size();
+
+		j = -1;
+
+		for (idx = 0; idx < list_size; idx++) {
+			if ( p_stats->medals_earned[idx].name.compare(Medals[stats->m_badge_earned].name) == 0 ) {
+				j = idx;
+				break;
+			}
+		}
+
+		if (j >= 0) {
+			p_stats->medals_earned[j].val = 0;
+		} else {
+			Assertion (true, "Badge '%s' not found, should have been added by pilotfile::update_stats.", Medals[stats->m_badge_earned].name);
+		}
+	}
+
+	// ship kills
+	for (i = 0; i < Num_ship_classes; i++) {
+		if (stats->m_okKills[i] > 0) {
+			list_size = p_stats->ship_kills.size();
+
+			j = -1;
+
+			for (idx = 0; idx < list_size; idx++) {
+				if ( p_stats->ship_kills[idx].name.compare(Ship_info[i].name) == 0 ) {
+					j = i;
+					break;
+				}
+			}
+
+			if (j >= 0) {
+				p_stats->ship_kills[j].val -= stats->m_okKills[i];
+			} else {
+				Assertion(true, "Ship kills of '%s' not found, should have been added by pilotfile::update_stats.", stats->m_okKills[i]);
+			}
+		}
+	}
 }
 
 /**
Index: code/missionui/missiondebrief.cpp
===================================================================
--- code/missionui/missiondebrief.cpp	(revision 9970)
+++ code/missionui/missiondebrief.cpp	(working copy)
@@ -47,6 +47,7 @@
 #include "network/multi_campaign.h"
 #include "network/multi_endgame.h"
 #include "missionui/chatbox.h"
+#include "pilotfile/pilotfile.h"
 
 
 #define MAX_TOTAL_DEBRIEF_LINES	200
@@ -2109,6 +2110,7 @@
 void debrief_close()
 {
 	int i;
+	scoring_struct *sc;
 
 	Assert(Debrief_inited);
 
@@ -2121,11 +2123,17 @@
 			if(MULTIPLAYER_MASTER){
 				for(i=0; i<MAX_PLAYERS; i++){
 					if(MULTI_CONNECTED(Net_players[i]) && !MULTI_STANDALONE(Net_players[i]) && !MULTI_PERM_OBSERVER(Net_players[i]) && (Net_players[i].m_player != NULL)){
-						scoring_backout_accept(&Net_players[i].m_player->stats);
+						sc = &Net_players[i].m_player->stats;
+						scoring_backout_accept(sc);
+
+						if (Net_player == &Net_players[i]) {
+							Pilot.update_stats_backout( sc );
+						}
 					}
 				}
 			} else {
 				scoring_backout_accept( &Player->stats );
+				Pilot.update_stats_backout( &Player->stats );
 			}
 		}
 	} else {
@@ -2136,6 +2144,7 @@
 				Campaign.next_mission = Campaign.current_mission;
 			}
 			scoring_backout_accept( &Player->stats );
+			Pilot.update_stats_backout( &Player->stats );
 		}
 	}
 
Index: code/network/multi_dogfight.cpp
===================================================================
--- code/network/multi_dogfight.cpp	(revision 9970)
+++ code/network/multi_dogfight.cpp	(working copy)
@@ -30,7 +30,7 @@
 #include "stats/scoring.h"
 #include "mission/missionparse.h"
 #include "iff_defs/iff_defs.h"
-
+#include "pilotfile/pilotfile.h"
 #include "fs2netd/fs2netd_client.h"
 #include "cfile/cfile.h"
 
@@ -296,6 +296,7 @@
 void multi_df_debrief_close()
 {
 	int idx;
+	scoring_struct *sc;
 
 	// shutdown the chatbox
 	chatbox_close();
@@ -307,11 +308,17 @@
 			if(MULTIPLAYER_MASTER){
 				for(idx=0; idx<MAX_PLAYERS; idx++){
 					if(MULTI_CONNECTED(Net_players[idx]) && !MULTI_STANDALONE(Net_players[idx]) && !MULTI_PERM_OBSERVER(Net_players[idx]) && (Net_players[idx].m_player != NULL)){
-						scoring_backout_accept(&Net_players[idx].m_player->stats);
+						sc = &Net_players[idx].m_player->stats;
+						scoring_backout_accept(sc);
+
+						if (Net_player == &Net_players[idx]) {
+							Pilot.update_stats_backout( sc );
+						}
 					}
 				}
 			} else {
 				scoring_backout_accept( &Player->stats );
+				Pilot.update_stats_backout( &Player->stats );
 			}
 		}
 	}
