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:
DrSmugleaf
2020-10-11 16:36:58 +02:00
committed by GitHub
parent 413ca9812d
commit b64cb24059
79 changed files with 292 additions and 268 deletions

View File

@@ -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>();
}
}
}