Fix build

This commit is contained in:
Pieter-Jan Briers
2019-08-22 09:28:24 +02:00
parent ab1108b731
commit ecbf9a7706

View File

@@ -1,5 +1,3 @@
using System;
using System.Runtime.InteropServices;
using Content.Server.GameObjects.Components.Sound; using Content.Server.GameObjects.Components.Sound;
using Content.Server.GameObjects.Components.Weapon.Melee; using Content.Server.GameObjects.Components.Weapon.Melee;
using Content.Server.GameObjects.EntitySystems; using Content.Server.GameObjects.EntitySystems;
@@ -7,9 +5,9 @@ using Content.Shared.GameObjects;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Components.Renderable; using Robust.Shared.Interfaces.Random;
using Robust.Shared.Maths; using Robust.Shared.IoC;
using Robust.Shared.Utility; using Robust.Shared.Random;
namespace Content.Server.GameObjects.Components.Mining namespace Content.Server.GameObjects.Components.Mining
{ {
@@ -19,12 +17,15 @@ namespace Content.Server.GameObjects.Components.Mining
public override string Name => "AsteroidRock"; public override string Name => "AsteroidRock";
private static readonly string[] SpriteStates = {"0", "1", "2", "3", "4"}; private static readonly string[] SpriteStates = {"0", "1", "2", "3", "4"};
#pragma warning disable 649
[Dependency] private readonly IRobustRandom _random;
#pragma warning restore 649
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
var spriteComponent = Owner.GetComponent<SpriteComponent>(); var spriteComponent = Owner.GetComponent<SpriteComponent>();
var random = new Random(Owner.Uid.GetHashCode() ^ DateTime.Now.GetHashCode()); spriteComponent.LayerSetState(0, _random.Pick(SpriteStates));
spriteComponent.LayerSetState(0, random.Pick(SpriteStates));
} }
bool IAttackBy.AttackBy(AttackByEventArgs eventArgs) bool IAttackBy.AttackBy(AttackByEventArgs eventArgs)