Skip to content

Commit ec23f6b

Browse files
authored
Merge pull request #5709 from Goober5000/fix_loadout_crash
fix a crash in the apply-loadout-to-wing routine
2 parents d93d56e + b546d89 commit ec23f6b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

code/missionui/missionweaponchoice.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4030,6 +4030,10 @@ void wl_apply_current_loadout_to_all_ships_in_current_wing()
40304030
// get the slot for this ship
40314031
cur_wss_slot = cur_wing_block * MAX_WING_SLOTS + cur_wing_slot;
40324032

4033+
// make sure there is actually a ship here
4034+
if (Wss_slots[cur_wss_slot].ship_class < 0)
4035+
continue;
4036+
40334037
// get the ship's name and class
40344038
sip = &Ship_info[Wss_slots[cur_wss_slot].ship_class];
40354039
ss_return_name(cur_wing_block, cur_wing_slot, ship_name);

0 commit comments

Comments
 (0)