public static Vector3 CaravanCollisionPosOffsetFor(Caravan caravan)
        {
            if (!caravan.Spawned)
            {
                return(Vector3.zero);
            }
            bool  flag = caravan.Spawned && caravan.pather.Moving;
            float d    = 0.15f * Find.WorldGrid.averageTileSize;

            if (!flag || caravan.pather.nextTile == caravan.pather.Destination)
            {
                int num                      = ((!flag) ? caravan.Tile : caravan.pather.nextTile);
                int caravansCount            = 0;
                int caravansWithLowerIdCount = 0;
                GetCaravansStandingAtOrAboutToStandAt(num, out caravansCount, out caravansWithLowerIdCount, caravan);
                if (caravansCount == 0)
                {
                    return(Vector3.zero);
                }
                return(WorldRendererUtility.ProjectOnQuadTangentialToPlanet(Find.WorldGrid.GetTileCenter(num), GenGeo.RegularPolygonVertexPosition(caravansCount, caravansWithLowerIdCount) * d));
            }
            if (DrawPosCollides(caravan))
            {
                Rand.PushState();
                Rand.Seed = caravan.ID;
                float f = Rand.Range(0f, 360f);
                Rand.PopState();
                Vector2 point = new Vector2(Mathf.Cos(f), Mathf.Sin(f)) * d;
                return(WorldRendererUtility.ProjectOnQuadTangentialToPlanet(PatherTweenedPosRoot(caravan), point));
            }
            return(Vector3.zero);
        }
        public static Vector3 CaravanCollisionPosOffsetFor(Caravan caravan)
        {
            if (!caravan.Spawned)
            {
                return(Vector3.zero);
            }
            bool  flag = caravan.Spawned && caravan.pather.Moving;
            float d    = (float)(0.15000000596046448 * Find.WorldGrid.averageTileSize);

            if (flag && caravan.pather.nextTile != caravan.pather.Destination)
            {
                if (CaravanTweenerUtility.DrawPosCollides(caravan))
                {
                    Rand.PushState();
                    Rand.Seed = caravan.ID;
                    float f = Rand.Range(0f, 360f);
                    Rand.PopState();
                    Vector2 point = new Vector2(Mathf.Cos(f), Mathf.Sin(f)) * d;
                    return(WorldRendererUtility.ProjectOnQuadTangentialToPlanet(CaravanTweenerUtility.PatherTweenedPosRoot(caravan), point));
                }
                return(Vector3.zero);
            }
            int num         = (!flag) ? caravan.Tile : caravan.pather.nextTile;
            int num2        = 0;
            int vertexIndex = 0;

            CaravanTweenerUtility.GetCaravansStandingAtOrAboutToStandAt(num, out num2, out vertexIndex, caravan);
            if (num2 == 0)
            {
                return(Vector3.zero);
            }
            return(WorldRendererUtility.ProjectOnQuadTangentialToPlanet(Find.WorldGrid.GetTileCenter(num), GenGeo.RegularPolygonVertexPosition(num2, vertexIndex) * d));
        }