use CannyFastMath in various places even where it might not be any different
also update a bunch of packages clean up redundant YamlDotNet references
This commit is contained in:
@@ -4,6 +4,9 @@ using Content.Server.GameObjects.Components.Chemistry;
|
||||
using Content.Shared.Interfaces;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
using CannyFastMath;
|
||||
using Math = CannyFastMath.Math;
|
||||
using MathF = CannyFastMath.MathF;
|
||||
|
||||
namespace Content.Server.Chemistry.ReactionEffects
|
||||
{
|
||||
@@ -35,9 +38,9 @@ namespace Content.Server.Chemistry.ReactionEffects
|
||||
serializer.DataField(ref _maxScale, "maxScale", 1);
|
||||
}
|
||||
|
||||
public void React(IEntity solutionEntity, decimal intensity)
|
||||
public void React(IEntity solutionEntity, double intensity)
|
||||
{
|
||||
float floatIntensity = (float)intensity;
|
||||
float floatIntensity = (float)intensity;
|
||||
if (solutionEntity == null)
|
||||
return;
|
||||
if(!solutionEntity.TryGetComponent(out SolutionComponent solution))
|
||||
@@ -46,7 +49,7 @@ namespace Content.Server.Chemistry.ReactionEffects
|
||||
//Handle scaling
|
||||
if (_scaled)
|
||||
{
|
||||
floatIntensity = Math.Min(floatIntensity, _maxScale);
|
||||
floatIntensity = MathF.Min(floatIntensity, _maxScale);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -54,10 +57,10 @@ namespace Content.Server.Chemistry.ReactionEffects
|
||||
}
|
||||
|
||||
//Calculate intensities
|
||||
int finalDevastationRange = (int)Math.Round(_devastationRange * floatIntensity);
|
||||
int finalHeavyImpactRange = (int)Math.Round(_heavyImpactRange * floatIntensity);
|
||||
int finalLightImpactRange = (int)Math.Round(_lightImpactRange * floatIntensity);
|
||||
int finalFlashRange = (int)Math.Round(_flashRange * floatIntensity);
|
||||
int finalDevastationRange = (int)MathF.Round(_devastationRange * floatIntensity);
|
||||
int finalHeavyImpactRange = (int)MathF.Round(_heavyImpactRange * floatIntensity);
|
||||
int finalLightImpactRange = (int)MathF.Round(_lightImpactRange * floatIntensity);
|
||||
int finalFlashRange = (int)MathF.Round(_flashRange * floatIntensity);
|
||||
ExplosionHelper.SpawnExplosion(solutionEntity.Transform.GridPosition, finalDevastationRange,
|
||||
finalHeavyImpactRange, finalLightImpactRange, finalFlashRange);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user