Inline Transform

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 14:20:34 +01:00
parent 69b270017b
commit a5b57c8e10
283 changed files with 742 additions and 709 deletions

View File

@@ -70,7 +70,7 @@ namespace Content.Server.AI.Operators.Combat.Melee
var meleeWeapon = hands.GetActiveHand.Owner;
IoCManager.Resolve<IEntityManager>().TryGetComponent(meleeWeapon.Uid, out MeleeWeaponComponent? meleeWeaponComponent);
if ((_target.Transform.Coordinates.Position - _owner.Transform.Coordinates.Position).Length >
if ((IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_target.Uid).Coordinates.Position - IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_owner.Uid).Coordinates.Position).Length >
meleeWeaponComponent?.Range)
{
return Outcome.Failed;
@@ -78,7 +78,7 @@ namespace Content.Server.AI.Operators.Combat.Melee
var interactionSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<InteractionSystem>();
interactionSystem.AiUseInteraction(_owner, _target.Transform.Coordinates, _target.Uid);
interactionSystem.AiUseInteraction(_owner, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_target.Uid).Coordinates, _target.Uid);
_elapsedTime += frameTime;
return Outcome.Continuing;
}

View File

@@ -76,14 +76,14 @@ namespace Content.Server.AI.Operators.Combat.Melee
return Outcome.Failed;
}
if ((_target.Transform.Coordinates.Position - _owner.Transform.Coordinates.Position).Length >
if ((IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_target.Uid).Coordinates.Position - IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_owner.Uid).Coordinates.Position).Length >
_unarmedCombat.Range)
{
return Outcome.Failed;
}
var interactionSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<InteractionSystem>();
interactionSystem.AiUseInteraction(_owner, _target.Transform.Coordinates, _target.Uid);
interactionSystem.AiUseInteraction(_owner, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_target.Uid).Coordinates, _target.Uid);
_elapsedTime += frameTime;
return Outcome.Continuing;
}

View File

@@ -23,7 +23,7 @@ namespace Content.Server.AI.Operators.Inventory
public override Outcome Execute(float frameTime)
{
if (_useTarget.Transform.GridID != _owner.Transform.GridID)
if (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_useTarget.Uid).GridID != IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_owner.Uid).GridID)
{
return Outcome.Failed;
}
@@ -40,7 +40,7 @@ namespace Content.Server.AI.Operators.Inventory
// Click on da thing
var interactionSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<InteractionSystem>();
interactionSystem.AiUseInteraction(_owner, _useTarget.Transform.Coordinates, _useTarget.Uid);
interactionSystem.AiUseInteraction(_owner, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_useTarget.Uid).Coordinates, _useTarget.Uid);
return Outcome.Success;
}