Inline OwnerUid

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 16:30:34 +01:00
parent 2eacf98335
commit f386b57148
85 changed files with 219 additions and 215 deletions

View File

@@ -36,7 +36,7 @@ public class SlowContactsSystem : EntitySystem
foreach (var colliding in _physics.GetCollidingEntities(physicsComponent))
{
var ent = colliding.OwnerUid;
var ent = ((IComponent) colliding).Owner;
if (!EntityManager.TryGetComponent<SlowContactsComponent>(ent, out var slowContactsComponent))
continue;
@@ -49,7 +49,7 @@ public class SlowContactsSystem : EntitySystem
private void OnEntityExit(EntityUid uid, SlowContactsComponent component, EndCollideEvent args)
{
var otherUid = args.OtherFixture.Body.OwnerUid;
var otherUid = ((IComponent) args.OtherFixture.Body).Owner;
if (!EntityManager.HasComponent<MovementSpeedModifierComponent>(otherUid)
|| !EntityManager.HasComponent<SlowsOnContactComponent>(otherUid))
return;
@@ -64,7 +64,7 @@ public class SlowContactsSystem : EntitySystem
private void OnEntityEnter(EntityUid uid, SlowContactsComponent component, StartCollideEvent args)
{
var otherUid = args.OtherFixture.Body.OwnerUid;
var otherUid = ((IComponent) args.OtherFixture.Body).Owner;
if (!EntityManager.HasComponent<MovementSpeedModifierComponent>(otherUid))
return;
if (!_statusCapableInContact.ContainsKey(otherUid))