Fix 3000 errors

This commit is contained in:
DrSmugleaf
2021-12-05 18:09:01 +01:00
parent 2bfec7ec62
commit 2a3b7d809d
569 changed files with 2979 additions and 3280 deletions

View File

@@ -16,20 +16,19 @@ public class StandingStateSystem : EntitySystem
var direction = EntityManager.TryGetComponent(uid, out PhysicsComponent? comp) ? comp.LinearVelocity / 50 : Vector2.Zero;
var dropAngle = _random.NextFloat(0.8f, 1.2f);
if (EntityManager.TryGetComponent(uid, out HandsComponent? hands))
if (!EntityManager.TryGetComponent(uid, out HandsComponent? hands))
return;
foreach (var heldItem in hands.GetAllHeldItems())
{
foreach (var heldItem in hands.GetAllHeldItems())
{
if (hands.Drop(heldItem.Owner))
{
IEntity tempQualifier = EntityManager.GetEntity(uid);
Throwing.ThrowHelper.TryThrow(heldItem.Owner,
_random.NextAngle().RotateVec(direction / dropAngle +
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(tempQualifier).WorldRotation.ToVec() / 50),
0.5f * dropAngle * _random.NextFloat(-0.9f, 1.1f),
EntityManager.GetEntity(uid), 0);
}
}
if (!hands.Drop(heldItem.Owner))
continue;
var worldRotation = EntityManager.GetComponent<TransformComponent>(uid).WorldRotation.ToVec();
Throwing.ThrowHelper.TryThrow(heldItem.Owner,
_random.NextAngle().RotateVec(direction / dropAngle + worldRotation / 50),
0.5f * dropAngle * _random.NextFloat(-0.9f, 1.1f),
uid, 0);
}
}