2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 07:47:42 +00:00

Fix invalid asset ID handling in CGuiModel and CAuiImagePane

This commit is contained in:
2017-11-13 05:13:34 -08:00
parent 550078f7cb
commit f4de84b5fa
2 changed files with 3 additions and 3 deletions

View File

@@ -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>();