Try fix collision mispredicts (#16298)

This commit is contained in:
Leon Friedrich
2023-05-13 02:02:50 +12:00
committed by GitHub
parent f1a81d9a8d
commit d228f971b0
11 changed files with 134 additions and 214 deletions

View File

@@ -274,11 +274,8 @@ namespace Content.Shared.Movement.Systems
if (TryComp<InputMoverComponent>(entity, out var mover))
SetMoveInput(mover, MoveButtons.None);
DebugTools.Assert(TryComp(relayMover.RelayEntity, out MovementRelayTargetComponent? targetComp) && targetComp.Entities.Count == 1,
"Multiple relayed movers are not supported at the moment");
if (relayMover.RelayEntity != null && !_mobState.IsIncapacitated(entity))
HandleDirChange(relayMover.RelayEntity.Value, dir, subTick, state);
if (!_mobState.IsIncapacitated(entity))
HandleDirChange(relayMover.RelayEntity, dir, subTick, state);
return;
}
@@ -328,9 +325,7 @@ namespace Content.Shared.Movement.Systems
SetMoveInput(moverComp, MoveButtons.None);
}
if (relayMover.RelayEntity == null) return;
HandleRunChange(relayMover.RelayEntity.Value, subTick, walking);
HandleRunChange(relayMover.RelayEntity, subTick, walking);
return;
}