Rename usages of collidable to physics (#2230)
* Rename usages of collidable to physics * high tier PANIQUE * aaaaaaaaAAAAAa * cursed commit dont research * Fix urist and items being anchored * Fix the rest
This commit is contained in:
@@ -72,7 +72,7 @@ namespace Content.Server.GameObjects.Components.Projectiles
|
||||
}
|
||||
|
||||
// This is so entities that shouldn't get a collision are ignored.
|
||||
if (entity.TryGetComponent(out ICollidableComponent collidable) && collidable.Hard == false)
|
||||
if (entity.TryGetComponent(out IPhysicsComponent otherPhysics) && otherPhysics.Hard == false)
|
||||
{
|
||||
_deleteOnCollide = false;
|
||||
return;
|
||||
@@ -103,9 +103,9 @@ namespace Content.Server.GameObjects.Components.Projectiles
|
||||
}
|
||||
|
||||
if (!entity.Deleted && entity.TryGetComponent(out CameraRecoilComponent recoilComponent)
|
||||
&& Owner.TryGetComponent(out ICollidableComponent collidableComponent))
|
||||
&& Owner.TryGetComponent(out IPhysicsComponent ownPhysics))
|
||||
{
|
||||
var direction = collidableComponent.LinearVelocity.Normalized;
|
||||
var direction = ownPhysics.LinearVelocity.Normalized;
|
||||
recoilComponent.Kick(direction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Content.Server.GameObjects.Components.Projectiles
|
||||
void ICollideBehavior.CollideWith(IEntity entity)
|
||||
{
|
||||
if (!_shouldCollide) return;
|
||||
if (entity.TryGetComponent(out CollidableComponent collid))
|
||||
if (entity.TryGetComponent(out PhysicsComponent collid))
|
||||
{
|
||||
if (!collid.Hard) // ignore non hard
|
||||
return;
|
||||
@@ -52,7 +52,7 @@ namespace Content.Server.GameObjects.Components.Projectiles
|
||||
// after impacting the first object.
|
||||
// For realism this should actually be changed when the velocity of the object is less than a threshold.
|
||||
// This would allow ricochets off walls, and weird gravity effects from slowing the object.
|
||||
if (Owner.TryGetComponent(out ICollidableComponent body) && body.PhysicsShapes.Count >= 1)
|
||||
if (Owner.TryGetComponent(out IPhysicsComponent body) && body.PhysicsShapes.Count >= 1)
|
||||
{
|
||||
_shouldCollide = false;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ namespace Content.Server.GameObjects.Components.Projectiles
|
||||
return;
|
||||
}
|
||||
|
||||
if (Owner.TryGetComponent(out ICollidableComponent body) && body.PhysicsShapes.Count >= 1)
|
||||
if (Owner.TryGetComponent(out IPhysicsComponent body) && body.PhysicsShapes.Count >= 1)
|
||||
{
|
||||
body.PhysicsShapes[0].CollisionMask &= (int) ~CollisionGroup.ThrownItem;
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Content.Server.GameObjects.Components.Projectiles
|
||||
|
||||
public void StartThrow(Vector2 direction, float speed)
|
||||
{
|
||||
var comp = Owner.GetComponent<ICollidableComponent>();
|
||||
var comp = Owner.GetComponent<IPhysicsComponent>();
|
||||
comp.Status = BodyStatus.InAir;
|
||||
|
||||
var controller = comp.EnsureController<ThrownController>();
|
||||
@@ -125,7 +125,7 @@ namespace Content.Server.GameObjects.Components.Projectiles
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
Owner.EnsureComponent<CollidableComponent>().EnsureController<ThrownController>();
|
||||
Owner.EnsureComponent<PhysicsComponent>().EnsureController<ThrownController>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user