Skip to content

Commit 21560b9

Browse files
WeylonSantanapandinocoder
authored andcommitted
fix small issues
1 parent 1db733f commit 21560b9

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

Intersect.Client.Core/Entities/Resource.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@ public ResourceDescriptor? Descriptor
4949
get => _descriptor;
5050
set
5151
{
52-
if (value == _descriptor)
53-
{
54-
return;
55-
}
56-
57-
_descriptor = value;
5852
if (value is { } descriptor)
5953
{
6054
_maximumHealthForStates = (int)(descriptor.UseExplicitMaxHealthForResourceStates
@@ -66,6 +60,12 @@ public ResourceDescriptor? Descriptor
6660
_maximumHealthForStates = 0;
6761
}
6862

63+
if (value == _descriptor)
64+
{
65+
return;
66+
}
67+
68+
_descriptor = value;
6969
UpdateCurrentState();
7070
}
7171
}
@@ -116,7 +116,7 @@ private void ReloadSpriteTexture()
116116
case ResourceTextureSource.Tileset:
117117
if (GameContentManager.Current.TilesetsLoaded)
118118
{
119-
Texture = GameContentManager.Current.GetTexture(TextureType.Tileset, _sprite);
119+
Texture = GameContentManager.Current.GetTexture(TextureType.Tileset, _currentState?.TextureName);
120120
}
121121
else
122122
{
@@ -125,7 +125,7 @@ private void ReloadSpriteTexture()
125125
break;
126126

127127
case ResourceTextureSource.Resource:
128-
Texture = GameContentManager.Current.GetTexture(TextureType.Resource, _sprite);
128+
Texture = GameContentManager.Current.GetTexture(TextureType.Resource, _currentState?.TextureName);
129129
break;
130130

131131
case ResourceTextureSource.Animation:
@@ -269,7 +269,6 @@ public void UpdateCurrentState()
269269
}
270270

271271
_currentState = currentState;
272-
_sprite = _currentState?.TextureName ?? string.Empty;
273272

274273
if (currentState is { TextureType: ResourceTextureSource.Animation } && currentState.AnimationId != Guid.Empty)
275274
{

0 commit comments

Comments
 (0)