Inline Transform
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user