CDrone: Check for normal model in PreRender

This commit is contained in:
Luke Street 2020-09-13 20:07:24 -04:00
parent 8a4cda9d98
commit 3e8369d24d
2 changed files with 2 additions and 1 deletions

View File

@ -66,6 +66,7 @@ class CModelData {
bool x14_25_sortThermal : 1 = false; bool x14_25_sortThermal : 1 = false;
zeus::CColor x18_ambientColor; zeus::CColor x18_ambientColor;
// were rstl::optional_object<TCachedToken<CModel>>
TLockedToken<CModel> x1c_normalModel; TLockedToken<CModel> x1c_normalModel;
TLockedToken<CModel> x2c_xrayModel; TLockedToken<CModel> x2c_xrayModel;
TLockedToken<CModel> x3c_infraModel; TLockedToken<CModel> x3c_infraModel;

View File

@ -288,7 +288,7 @@ void CDrone::AddToRenderer(const zeus::CFrustum& frustum, CStateManager& mgr) {
void CDrone::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) { void CDrone::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) {
CPatterned::PreRender(mgr, frustum); CPatterned::PreRender(mgr, frustum);
if (x3fc_flavor == EFlavorType::One) { if (x3fc_flavor == EFlavorType::One) {
if (HasModelData() && GetModelData()->HasAnimData()) { if (HasModelData() && GetModelData()->HasAnimData() && GetModelData()->HasNormalModel()) {
if (GetModelAlphau8(mgr) == 0) if (GetModelAlphau8(mgr) == 0)
GetModelData()->GetAnimationData()->BuildPose(); GetModelData()->GetAnimationData()->BuildPose();
} }