From 0062d2567ab30564548e9064d2941e6f7d3da410 Mon Sep 17 00:00:00 2001 From: SamuelCho Date: Tue, 8 Dec 2015 23:53:53 -0800 Subject: [PATCH 1/2] Fixes missing destroyed submodels from the polymodel_instance rendering commit. --- code/model/modelread.cpp | 8 ++++---- code/model/modelrender.cpp | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/code/model/modelread.cpp b/code/model/modelread.cpp index fef67304256..e1fbe5f6db6 100644 --- a/code/model/modelread.cpp +++ b/code/model/modelread.cpp @@ -4607,12 +4607,12 @@ void model_set_instance(int model_num, int sub_model_num, submodel_instance_info if (flags & SSF_NO_DISAPPEAR) { // If the submodel is to not disappear when the subsystem is destroyed, we simply // make the submodel act as its own replacement as well - sm->my_replacement = sub_model_num; + sm->blown_off = 0; + } else { + // Set the "blown out" flags + sm->blown_off = sii->blown_off; } - // Set the "blown out" flags - sm->blown_off = sii->blown_off; - if ( (sm->blown_off) && (!(flags & SSF_NO_REPLACE)) ) { if ( sm->my_replacement > -1 ) { pm->submodel[sm->my_replacement].blown_off = 0; diff --git a/code/model/modelrender.cpp b/code/model/modelrender.cpp index 3f14ecb1bdd..4c9d2d43dda 100644 --- a/code/model/modelrender.cpp +++ b/code/model/modelrender.cpp @@ -1411,7 +1411,11 @@ void model_render_children_buffers(draw_list* scene, model_render_params* interp smi = &pmi->submodel[mn]; } - if ( (smi != NULL && smi->blown_off) || model->blown_off ) { + if ( smi != NULL ) { + if ( smi->blown_off ) { + return; + } + } else if ( model->blown_off ) { return; } From 2deffc11566f8c4effa3dd7150b5a60fc4a72539 Mon Sep 17 00:00:00 2001 From: Samuel Cho Date: Wed, 9 Dec 2015 10:32:36 -0800 Subject: [PATCH 2/2] Removed comment from model_set_instance that no longer describes SSF_NO_DISAPPEAR functionality. --- code/model/modelread.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/model/modelread.cpp b/code/model/modelread.cpp index e1fbe5f6db6..90b2bc7f6be 100644 --- a/code/model/modelread.cpp +++ b/code/model/modelread.cpp @@ -4605,8 +4605,6 @@ void model_set_instance(int model_num, int sub_model_num, submodel_instance_info bsp_info *sm = &pm->submodel[sub_model_num]; if (flags & SSF_NO_DISAPPEAR) { - // If the submodel is to not disappear when the subsystem is destroyed, we simply - // make the submodel act as its own replacement as well sm->blown_off = 0; } else { // Set the "blown out" flags