Skip to content

Commit fb26270

Browse files
Merge pull request #2757 from TwelveEyes/fix-null-blitcloakinterior
Null check ImageData for BlitCloakInterior
2 parents 3fdf424 + e623300 commit fb26270

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Assets/Scripts/Game/Utility/PaperDollRenderer.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ void DrawTexture(ImageData srcImage, DaggerfallUnityItem item = null)
246246

247247
void DrawTexture(ImageData srcImage, Rect srcRect, Rect targetRect, DaggerfallUnityItem item = null)
248248
{
249+
if (srcImage.texture == null)
250+
return;
251+
249252
// Calculate image position relative to origin
250253
int posX = (int)targetRect.xMin - paperDollOrigin.X;
251254
int posY = (int)targetRect.yMin - paperDollOrigin.Y;
@@ -265,7 +268,7 @@ void DrawTexture(ImageData srcImage, Rect srcRect, Rect targetRect, DaggerfallUn
265268
TextureReplacement.OverridePaperdollItemRect(item, srcImage, scale, ref screenRect);
266269

267270
// Draw with custom shader for paper doll item masking
268-
if (item != null)
271+
if (item != null && srcImage.maskTexture != null)
269272
{
270273
paperDollMaterial.SetTexture("_MaskTex", srcImage.maskTexture);
271274
Graphics.DrawTexture(screenRect, srcImage.texture, srcRect, 0, 0, 0, 0, paperDollMaterial);
@@ -438,4 +441,4 @@ bool IsEquippedToBody(DaggerfallUnityItem item)
438441

439442
#endregion
440443
}
441-
}
444+
}

0 commit comments

Comments
 (0)