private void HandleCollision(LSBody other) { if (!CanMove) { return; } if ((tempAgent = other.Agent) == null) { return; } Move otherMover = tempAgent.GetAbility <Move>(); if (ReferenceEquals(otherMover, null) == false) { if (IsMoving) { //If the other mover is moving to a similar point if (otherMover.MyMovementGroupID == MyMovementGroupID || otherMover.targetPos.FastDistance(this.targetPos) <= (closingDistance * closingDistance)) { if (otherMover.IsMoving == false) { if (otherMover.Arrived && otherMover.StoppedTime > MinimumOtherStopTime) { Arrive(); } } else { if (hasPath && otherMover.hasPath && otherMover.pathIndex > 0 && otherMover.lastTargetPos.SqrDistance(targetPos.x, targetPos.y) < closingDistance.Mul(closingDistance)) { if (this.distance < this.closingDistance) { this.pathIndex++; } } } } if (GetLookingForStopPause()) { //As soon as the original collision stop unit is released, units will start breaking out of pauses if (otherMover.GetCanCollisionStop() == false) { StopPauseLayer = -1; PauseAutoStop(); } else if (otherMover.GetCanAutoStop() == false) { if (otherMover.StopPauseLayer < StopPauseLayer) { StopPauseLayer = otherMover.StopPauseLayer + 1; PauseAutoStop(); } } } else { } } } }