diff --git a/src/r_data/models.cpp b/src/r_data/models.cpp index 320462c584..3d5c742a61 100644 --- a/src/r_data/models.cpp +++ b/src/r_data/models.cpp @@ -361,7 +361,7 @@ void RenderFrameModels(FModelRenderer *renderer, FLevelLocals *Level, const FSpr FModel* animation = Models[animationid]; animationData = animation->AttachAnimationData(); - if ((!smf->flags & MDL_MODELSAREATTACHMENTS) || evaluatedSingle == false) + if (!(smf->flags & MDL_MODELSAREATTACHMENTS) || evaluatedSingle == false) { boneData = animation->CalculateBones(modelframe, nextFrame ? modelframenext : modelframe, nextFrame ? inter : 0.f, *animationData); boneStartingPosition = renderer->SetupFrame(animation, 0, 0, 0, boneData, -1); @@ -370,7 +370,7 @@ void RenderFrameModels(FModelRenderer *renderer, FLevelLocals *Level, const FSpr } else { - if ((!smf->flags & MDL_MODELSAREATTACHMENTS) || evaluatedSingle == false) + if (!(smf->flags & MDL_MODELSAREATTACHMENTS) || evaluatedSingle == false) { boneData = mdl->CalculateBones(modelframe, nextFrame ? modelframenext : modelframe, nextFrame ? inter : 0.f, *animationData); boneStartingPosition = renderer->SetupFrame(mdl, 0, 0, 0, boneData, -1); diff --git a/src/rendering/hwrenderer/hw_models.cpp b/src/rendering/hwrenderer/hw_models.cpp index 0738276ffd..46ae92ed1b 100644 --- a/src/rendering/hwrenderer/hw_models.cpp +++ b/src/rendering/hwrenderer/hw_models.cpp @@ -141,8 +141,11 @@ int FHWModelRenderer::SetupFrame(FModel *model, unsigned int frame1, unsigned in auto mdbuff = static_cast(model->GetVertexBuffer(GetType())); boneIndexBase = boneStartIndex >= 0 ? boneStartIndex : screen->mBones->UploadBones(bones); state.SetBoneIndexBase(boneIndexBase); - state.SetVertexBuffer(mdbuff->vertexBuffer(), frame1, frame2); - if (mdbuff->indexBuffer()) state.SetIndexBuffer(mdbuff->indexBuffer()); + if (mdbuff) + { + state.SetVertexBuffer(mdbuff->vertexBuffer(), frame1, frame2); + if (mdbuff->indexBuffer()) state.SetIndexBuffer(mdbuff->indexBuffer()); + } return boneIndexBase; }