Index: code/pilotfile/csg.cpp
===================================================================
--- code/pilotfile/csg.cpp	(revision 9651)
+++ code/pilotfile/csg.cpp	(working copy)
@@ -513,8 +513,7 @@
 
 void pilotfile::csg_read_loadout()
 {
-	int j;
-	int count;
+	int j, count, ship_idx = -1, wep_idx = -1;
 	uint idx, list_size = 0;
 
 	if ( !m_have_info ) {
@@ -555,31 +554,39 @@
 		}
 
 		// ship
-		idx = cfread_int(cfp);
+		ship_idx = cfread_int(cfp);
 
-		if (idx > ship_list.size()) {
-			//mprintf(("CSG => Parse Warning: Invalid value for ship index (%d), Clamping to valid range.\n", idx));	
-			 idx = ship_list.size();						
+		if (ship_idx > (int)ship_list.size()) { // on the casts, assume that ship & weapon lists will never exceed ~2 billion
+			//mprintf(("CSG => Parse Warning: Invalid value for ship index (%d), Clamping to valid range.\n", ship_idx));
+			 ship_idx = ship_list.size();
 		}
 
 		if (slot) {
-			slot->ship_class = ship_list[idx].index;
+			if (ship_idx == -1) { // -1 means no ship in this slot
+				slot->ship_class = -1;
+			} else {
+				slot->ship_class = ship_list[ship_idx].index;
+			}
 		}
 
 		// primary weapons
 		count = cfread_int(cfp);
 
 		for (j = 0; j < count; j++) {
-			idx = cfread_int(cfp);
+			wep_idx = cfread_int(cfp);
 
-			if (idx > weapon_list.size()) {
-				//mprintf(("CSG => Parse Warning: Invalid value for weapon index (%d), Clamping to valid range.\n", idx));	
-				idx = weapon_list.size();
+			if (wep_idx > (int)weapon_list.size()) {
+				//mprintf(("CSG => Parse Warning: Invalid value for weapon index (%d), Clamping to valid range.\n", wep_idx));
+				wep_idx = weapon_list.size();
 			}
 
 
 			if ( slot && (j < MAX_SHIP_PRIMARY_BANKS) ) {
-				slot->wep[j] = weapon_list[idx].index;
+				if (wep_idx == -1) { // -1 means no weapon in this slot
+					slot->wep[j] = -1;
+				} else {
+					slot->wep[j] = weapon_list[wep_idx].index;
+				}
 			}
 
 			idx = cfread_int(cfp);
@@ -593,15 +600,19 @@
 		count = cfread_int(cfp);
 
 		for (j = 0; j < count; j++) {
-			idx = cfread_int(cfp);
+			wep_idx = cfread_int(cfp);
 
-			if (idx > weapon_list.size()) {
-				//mprintf(("CSG => Parse Warning: Invalid value for weapon index (%d), Clamping to valid range.\n", idx));
-				idx = weapon_list.size();		
+			if (wep_idx > (int)weapon_list.size()) {
+				//mprintf(("CSG => Parse Warning: Invalid value for weapon index (%d), Clamping to valid range.\n", wep_idx));
+				wep_idx = weapon_list.size();
 			}
 
 			if ( slot && (j < MAX_SHIP_SECONDARY_BANKS) ) {
-				slot->wep[j+MAX_SHIP_PRIMARY_BANKS] = weapon_list[idx].index;
+				if (wep_idx == -1) { // -1 means no weapon in this slot
+					slot->wep[j+MAX_SHIP_PRIMARY_BANKS] = -1;
+				} else {
+					slot->wep[j+MAX_SHIP_PRIMARY_BANKS] = weapon_list[wep_idx].index;
+				}
 			}
 
 			idx = cfread_int(cfp);
Index: code/missionui/missionshipchoice.cpp
===================================================================
--- code/missionui/missionshipchoice.cpp	(revision 9651)
+++ code/missionui/missionshipchoice.cpp	(working copy)
@@ -1965,6 +1965,7 @@
 	}
 	// in single player we jump directly into the mission
 	else {
+		Pilot.save_savefile();
 		gameseq_post_event(GS_EVENT_ENTER_GAME);
 	}
 }
@@ -2493,7 +2494,6 @@
 		change_ship_type(Player_obj->instance, si_index);
 
 	Player->last_ship_flown_si_index = si_index;
-	Pilot.save_savefile();  // saves both Recent_mission & last_ship_flown_si_index (for quick-start-missions)
 }
 
 /*
@@ -2924,6 +2924,7 @@
 	for ( i = 0; i < MAX_WING_BLOCKS; i++ ) {
 		for ( j = 0; j < MAX_WING_SLOTS; j++ ) {
 			slot = &Ss_wings[i].ss_slots[j];
+			slot = &Ss_wings[i].ss_slots[j];
 			slot->status = WING_SLOT_LOCKED;
 			slot->sa_index = -1;
 			slot->original_ship_class = -1;
Index: code/mission/missioncampaign.cpp
===================================================================
--- code/mission/missioncampaign.cpp	(revision 9651)
+++ code/mission/missioncampaign.cpp	(working copy)
@@ -723,7 +723,35 @@
 	return mission_campaign_load_by_name( filename);
 }
 
+/*
+ * initialise Player_loadout with default values
+ */
+void player_loadout_init()
+{
+	int i = 0, j = 0;
 
+	memset(Player_loadout.filename, 0, sizeof(Player_loadout.filename));
+	memset(Player_loadout.last_modified, 0, sizeof(Player_loadout.last_modified));
+
+	for ( i = 0; i < MAX_SHIP_CLASSES; i++ ) {
+		Player_loadout.ship_pool[i] = 0;
+	}
+
+	for ( i = 0; i < MAX_WEAPON_TYPES; i++ ) {
+		Player_loadout.weapon_pool[i] = 0;
+	}
+
+	for ( i = 0; i < MAX_WSS_SLOTS; i++ ) {
+		Player_loadout.unit_data[i].ship_class = -1;
+
+		for ( j = 0; j < MAX_SHIP_WEAPONS; j++ ) {
+			Player_loadout.unit_data[i].wep[j] = 0;
+			Player_loadout.unit_data[i].wep_count[j] = 0;
+		}
+	}
+
+}
+
 /**
  * Initializes some variables then loads the default FreeSpace single player campaign.
  */
@@ -732,6 +760,8 @@
 	mission_campaign_clear();
 
 	Campaign_file_missing = 0;
+
+	player_loadout_init();
 }
 
 /**
Index: code/mission/missioncampaign.h
===================================================================
--- code/mission/missioncampaign.h	(revision 9651)
+++ code/mission/missioncampaign.h	(working copy)
@@ -154,6 +154,11 @@
 // if the campaign file is missing this will get set for us to check against
 extern int Campaign_file_missing;
 
+/*
+ * initialise Player_loadout with default values
+ */
+void player_loadout_init();
+
 // called at game startup time to load the default single player campaign
 void mission_campaign_init( void );
 
