@@ -50,27 +50,7 @@ private static void Init( )
5050 return ;
5151 _init = true ;
5252 Essentials . Log . Info ( "Init cargo ships" ) ;
53- //cache planet locations and gravity sphere radius
54- HashSet < IMyEntity > entities = new HashSet < IMyEntity > ( ) ;
55- Wrapper . GameAction ( ( ) =>
56- {
57- //MyAPIGateway.Entities.GetEntities( entities, x => x is MyPlanet );
58- MyAPIGateway . Entities . GetEntities ( entities ) ;
59- } ) ;
60-
61- foreach ( IMyEntity entity in entities )
62- {
63- if ( ! ( entity is MyPlanet ) )
64- continue ;
6553
66- MyPlanet planet = ( MyPlanet ) entity ;
67- gravitySphereList . Add ( new BoundingSphereD ( planet . PositionComp . GetPosition ( ) , planet . GravityLimit ) ) ;
68- Essentials . Log . Debug ( planet . ToString ( ) ) ;
69- Essentials . Log . Debug ( planet . PositionComp . GetPosition ( ) . ToString ( ) + ", " + planet . GravityLimit . ToString ( ) ) ;
70- break ;
71- }
72-
73- //Communication.DisplayDialog( 76561197996829390, "", "",results );
7454 //load spawn groups
7555 var spawnGroups = MyDefinitionManager . Static . GetSpawnGroupDefinitions ( ) ;
7656 foreach ( var spawnGroup in spawnGroups )
@@ -108,9 +88,7 @@ public static bool DoesTrajectoryIntersect( Ray trajectory, float spawnRadius )
10888 if ( planet == null )
10989 continue ;
11090 BoundingSphereD gravitySphere = new BoundingSphereD ( planet . PositionComp . GetPosition ( ) , planet . GravityLimit + spawnRadius ) ;
111- Essentials . Log . Info ( gravitySphere ) ;
112- Essentials . Log . Info ( trajectory . Intersects ( gravitySphere ) ) ;
113-
91+
11492 float ? intersect = trajectory . Intersects ( gravitySphere ) ;
11593 if ( intersect . HasValue && intersect . Value > 0 )
11694 return true ;
@@ -129,9 +107,7 @@ public static bool IsPointInGravity( Vector3D testPoint )
129107 {
130108 if ( ExtenderOptions . IsDebugging )
131109 Essentials . Log . Info ( "Checking point gravity intersect" ) ;
132-
133- Essentials . Log . Info ( testPoint ) ;
134- Essentials . Log . Info ( MyGravityProviderSystem . CalculateNaturalGravityInPoint ( testPoint , true ) ) ;
110+
135111 return ! Vector3D . IsZero ( MyGravityProviderSystem . CalculateNaturalGravityInPoint ( testPoint , true ) ) ;
136112
137113 /*
0 commit comments