IoC'd random (#302)
* Implemented RobustRandom * update submodule * update submodule * Fix benchmark
This commit is contained in:
@@ -5,8 +5,10 @@ using Content.Server.Interfaces;
|
||||
using Content.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Random;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -74,7 +76,7 @@ namespace Content.Server.GameObjects.Components.Destructible
|
||||
|
||||
void IExAct.OnExplosion(ExplosionEventArgs eventArgs)
|
||||
{
|
||||
var prob = new Random();
|
||||
var prob = IoCManager.Resolve<IRobustRandom>();
|
||||
switch (eventArgs.Severity)
|
||||
{
|
||||
case ExplosionSeverity.Destruction:
|
||||
@@ -84,7 +86,7 @@ namespace Content.Server.GameObjects.Components.Destructible
|
||||
_actSystem.HandleDestruction(Owner, true);
|
||||
break;
|
||||
case ExplosionSeverity.Light:
|
||||
if (RandomExtensions.Prob(prob, 40))
|
||||
if (prob.Prob(40))
|
||||
_actSystem.HandleDestruction(Owner, true);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user