Fix errors

This commit is contained in:
DrSmugleaf
2021-12-05 21:02:04 +01:00
parent 2a3b7d809d
commit ab9d0cc6d8
94 changed files with 568 additions and 591 deletions

View File

@@ -81,12 +81,13 @@ namespace Content.Server.Explosion.EntitySystems
foreach (var player in players)
{
if (!player.AttachedEntity.Valid || !EntityManager.TryGetComponent(player.AttachedEntity, out CameraRecoilComponent? recoil))
if (player.AttachedEntity is not {Valid: true} playerEntity ||
!EntityManager.TryGetComponent(playerEntity, out CameraRecoilComponent? recoil))
{
continue;
}
var playerPos = EntityManager.GetComponent<TransformComponent>(player.AttachedEntity).WorldPosition;
var playerPos = EntityManager.GetComponent<TransformComponent>(playerEntity).WorldPosition;
var delta = epicenter.ToMapPos(EntityManager) - playerPos;
//Change if zero. Will result in a NaN later breaking camera shake if not changed