We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 83f0829 commit 319e573Copy full SHA for 319e573
1 file changed
code/ship/shipfx.cpp
@@ -235,6 +235,12 @@ static void shipfx_maybe_create_live_debris_at_ship_death( object *ship_objp )
235
for (auto pss: list_range(&shipp->subsys_list)) {
236
if (pss->system_info != nullptr) {
237
int submodel_num = pss->system_info->subobj_num;
238
+
239
+ // Subsystems without a valid submodel cannot produce live debris
240
+ if (submodel_num < 0 || submodel_num >= pm->n_models) {
241
+ continue;
242
+ }
243
244
// find the submodels which aren't already blown up and have live debris
245
if (!pmi->submodel[submodel_num].blown_off && pm->submodel[submodel_num].num_live_debris > 0) {
246
vec3d exp_center, tmp = ZERO_VECTOR;
0 commit comments