mirror of https://github.com/AxioDL/metaforce.git
Fix invalid asset ID handling in CGuiModel and CAuiImagePane
This commit is contained in:
parent
550078f7cb
commit
f4de84b5fa
|
@ -187,7 +187,7 @@ void CAuiImagePane::Draw(const CGuiWidgetDrawParms& params) const
|
|||
|
||||
bool CAuiImagePane::GetIsFinishedLoadingWidgetSpecific() const
|
||||
{
|
||||
return xb8_tex0Tok.IsLoaded();
|
||||
return !xb8_tex0Tok || xb8_tex0Tok.IsLoaded();
|
||||
}
|
||||
|
||||
void CAuiImagePane::SetTextureID0(CAssetId tex, CSimplePool* sp)
|
||||
|
@ -195,7 +195,7 @@ void CAuiImagePane::SetTextureID0(CAssetId tex, CSimplePool* sp)
|
|||
xc8_tex0 = tex;
|
||||
if (!sp)
|
||||
return;
|
||||
if (xc8_tex0 != -1)
|
||||
if (xc8_tex0.IsValid())
|
||||
xb8_tex0Tok = sp->GetObj({FOURCC('TXTR'), xc8_tex0});
|
||||
else
|
||||
xb8_tex0Tok = TLockedToken<CTexture>();
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace urde
|
|||
CGuiModel::CGuiModel(const CGuiWidgetParms& parms, CSimplePool* sp, CAssetId modelId, u32 lightMask, bool flag)
|
||||
: CGuiWidget(parms), x108_modelId(modelId), x10c_lightMask(lightMask)
|
||||
{
|
||||
if (!flag || modelId == 0xffffffff ||
|
||||
if (!flag || !modelId.IsValid() ||
|
||||
parms.x0_frame->GetGuiSys().GetUsageMode() == CGuiSys::EUsageMode::Two)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue