Move "players don't collide with mobs" to shared to fix mispredicts on it.

This commit is contained in:
Pieter-Jan Briers
2020-06-24 11:58:13 +02:00
parent 8ccf98333e
commit 5a5a3b8548
5 changed files with 23 additions and 20 deletions

View File

@@ -14,25 +14,10 @@ namespace Content.Server.GameObjects.Components.Movement
/// </summary>
[RegisterComponent]
[ComponentReference(typeof(IMoverComponent))]
public class PlayerInputMoverComponent : SharedPlayerInputMoverComponent, IMoverComponent, ICollideSpecial
public class PlayerInputMoverComponent : SharedPlayerInputMoverComponent
{
public override GridCoordinates LastPosition { get; set; }
public override float StepSoundDistance { get; set; }
/// <summary>
/// Special collision override, can be used to give custom behaviors deciding when to collide
/// </summary>
/// <param name="collidedwith"></param>
/// <returns></returns>
bool ICollideSpecial.PreventCollide(IPhysBody collidedwith)
{
// Don't collide with other mobs
if (collidedwith.Owner.TryGetComponent<SpeciesComponent>(out var collidedSpeciesComponent))
{
return true;
}
return false;
}
}
}