@@ -13,7 +13,6 @@ using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.ViewVariables;
|
||||
@@ -414,7 +413,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering
|
||||
var startTile = gridManager.GetTileRef(entity.Transform.Coordinates);
|
||||
var endTile = gridManager.GetTileRef(steeringRequest.TargetGrid);
|
||||
var collisionMask = 0;
|
||||
if (entity.TryGetComponent(out IPhysBody physics))
|
||||
if (entity.TryGetComponent(out IPhysicsComponent physics))
|
||||
{
|
||||
collisionMask = physics.CollisionMask;
|
||||
}
|
||||
@@ -600,7 +599,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering
|
||||
return Vector2.Zero;
|
||||
}
|
||||
|
||||
if (target.TryGetComponent(out IPhysBody physics))
|
||||
if (target.TryGetComponent(out IPhysicsComponent physics))
|
||||
{
|
||||
var targetDistance = (targetPos.Position - entityPos.Position);
|
||||
targetPos = targetPos.Offset(physics.LinearVelocity * targetDistance);
|
||||
@@ -618,7 +617,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering
|
||||
/// <returns></returns>
|
||||
private Vector2 CollisionAvoidance(IEntity entity, Vector2 direction, ICollection<IEntity> ignoredTargets)
|
||||
{
|
||||
if (direction == Vector2.Zero || !entity.TryGetComponent(out IPhysBody physics))
|
||||
if (direction == Vector2.Zero || !entity.TryGetComponent(out IPhysicsComponent physics))
|
||||
{
|
||||
return Vector2.Zero;
|
||||
}
|
||||
@@ -659,7 +658,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering
|
||||
// if we're moving in the same direction then ignore
|
||||
// So if 2 entities are moving towards each other and both detect a collision they'll both move in the same direction
|
||||
// i.e. towards the right
|
||||
if (physicsEntity.TryGetComponent(out IPhysBody otherPhysics) &&
|
||||
if (physicsEntity.TryGetComponent(out IPhysicsComponent otherPhysics) &&
|
||||
Vector2.Dot(otherPhysics.LinearVelocity, direction) > 0)
|
||||
{
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user