Fix dice sprite error (#13628)

Fix https://github.com/space-wizards/space-station-14/issues/13627
This commit is contained in:
Leon Friedrich
2023-01-21 17:58:16 +13:00
committed by GitHub
parent a648e48cd8
commit a9b9dc0a10
3 changed files with 5 additions and 5 deletions

View File

@@ -35,10 +35,10 @@ public sealed class DiceComponent : Component
[Serializable, NetSerializable] [Serializable, NetSerializable]
public sealed class DiceState : ComponentState public sealed class DiceState : ComponentState
{ {
public int CurrentSide { get; set; } = 20; public readonly int CurrentValue;
public DiceState(int side) public DiceState(int value)
{ {
CurrentSide = side; CurrentValue = value;
} }
} }
} }

View File

@@ -21,7 +21,7 @@ public abstract class SharedDiceSystem : EntitySystem
private void OnHandleState(EntityUid uid, DiceComponent component, ref ComponentHandleState args) private void OnHandleState(EntityUid uid, DiceComponent component, ref ComponentHandleState args)
{ {
if (args.Current is DiceComponent.DiceState state) if (args.Current is DiceComponent.DiceState state)
component.CurrentValue = state.CurrentSide; component.CurrentValue = state.CurrentValue;
UpdateVisuals(uid, component); UpdateVisuals(uid, component);
} }

View File

@@ -26,7 +26,7 @@
sides: 10 sides: 10
multiplier: 10 multiplier: 10
offset: 1 # first side is a 0 offset: 1 # first side is a 0
currentValue: 1 currentValue: 0
- type: Sprite - type: Sprite
state: percentile_0 state: percentile_0