Fix dice sprite error (#13628)
Fix https://github.com/space-wizards/space-station-14/issues/13627
This commit is contained in:
@@ -35,10 +35,10 @@ public sealed class DiceComponent : Component
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class DiceState : ComponentState
|
||||
{
|
||||
public int CurrentSide { get; set; } = 20;
|
||||
public DiceState(int side)
|
||||
public readonly int CurrentValue;
|
||||
public DiceState(int value)
|
||||
{
|
||||
CurrentSide = side;
|
||||
CurrentValue = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public abstract class SharedDiceSystem : EntitySystem
|
||||
private void OnHandleState(EntityUid uid, DiceComponent component, ref ComponentHandleState args)
|
||||
{
|
||||
if (args.Current is DiceComponent.DiceState state)
|
||||
component.CurrentValue = state.CurrentSide;
|
||||
component.CurrentValue = state.CurrentValue;
|
||||
|
||||
UpdateVisuals(uid, component);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
sides: 10
|
||||
multiplier: 10
|
||||
offset: 1 # first side is a 0
|
||||
currentValue: 1
|
||||
currentValue: 0
|
||||
- type: Sprite
|
||||
state: percentile_0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user