Index: code/fred2/fredview.cpp
===================================================================
--- code/fred2/fredview.cpp	(revision 10918)
+++ code/fred2/fredview.cpp	(working copy)
@@ -2688,6 +2688,46 @@
 					internal_error("Invalid dockee point (\"%s\" initially docked with \"%s\")", Ships[i].ship_name, Ships[ship].ship_name);
 				}
 			}
+
+			wing = Ships[i].wingnum;
+			bool is_in_loadout_screen = (ptr->type == OBJ_START);
+			if (!is_in_loadout_screen && wing >= 0) {
+				if ( multi && The_mission.game_type & MISSION_TYPE_MULTI_TEAMS )
+				{
+					for (n = 0; n < MAX_TVT_WINGS; n++) {
+						if (!strcmp(Wings[wing].name, TVT_wing_names[n])) {
+							is_in_loadout_screen = true;
+							break;
+						}
+					}
+				} else {
+					for (n = 0; n < MAX_STARTING_WINGS; n++) {
+						if (!strcmp(Wings[wing].name, Starting_wing_names[n])) {
+							is_in_loadout_screen = true;
+							break;
+						}
+					}
+				}
+			}
+			if (is_in_loadout_screen) {
+				int illegal = 0;
+				z = Ships[i].ship_info_index;
+				for (n = 0; n < MAX_SHIP_PRIMARY_BANKS; n++){
+					if (Ships[i].weapons.primary_bank_weapons[n] >= 0 && !Ship_info[z].allowed_weapons[Ships[i].weapons.primary_bank_weapons[n]]){
+						illegal++;
+					}
+				}
+
+				for (n = 0; n < MAX_SHIP_SECONDARY_BANKS; n++){
+					if (Ships[i].weapons.secondary_bank_weapons[n] >= 0 && !Ship_info[z].allowed_weapons[Ships[i].weapons.secondary_bank_weapons[n]]){
+						illegal++;
+					}
+				}
+
+				if (illegal && error("%d illegal weapon(s) found on ship \"%s\"", illegal, Ships[i].ship_name)) {
+					return 1;
+				}
+			}
 		}
 	}
 
