Skip to content

Commit 640e1a9

Browse files
committed
fix hp bar not showing when has no graphic
1 parent 414d46f commit 640e1a9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Intersect.Client.Core/Entities/Resource.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ private void ReloadSpriteTexture()
103103
Texture = GameContentManager.Current.GetTexture(TextureType.Resource, _sprite);
104104
}
105105

106+
if (Texture == default)
107+
{
108+
Texture = Graphics.Renderer.WhitePixel;
109+
}
110+
106111
_recalculateRenderBounds = true;
107112
}
108113

@@ -196,8 +201,7 @@ public void UpdateCurrentState()
196201
);
197202

198203
_currentState = currentState.Value;
199-
var updatedSprite = _currentState?.Texture;
200-
_sprite = updatedSprite ?? string.Empty;
204+
_sprite = _currentState?.Texture ?? string.Empty;
201205
ReloadSpriteTexture();
202206
}
203207

0 commit comments

Comments
 (0)