Skip to content

Commit

Permalink
Final commit for release
Browse files Browse the repository at this point in the history
  • Loading branch information
DraygoKorvan committed Aug 25, 2015
1 parent ff5260b commit 3b6a05c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,13 @@ private void mainloop()
{
if (!(entity is IMyVoxelMap))
continue;
//Console.WriteLine("Found voxelmap");
Console.WriteLine("Found voxelmap");
IMyVoxelMap tmpasteroid = (IMyVoxelMap)entity;

if (tmpasteroid.LocalAABB.Size.X > 120F)
{
m_cache.Add(new SeDropshipAsteroids(tmpasteroid));
//Console.WriteLine("Adding to valid asteroid list");
Console.WriteLine("Adding to valid asteroid list");
}


Expand Down Expand Up @@ -515,7 +515,7 @@ public void doDrop(IMyCubeGrid grid)


Vector3D Vector3Intercept = FindInterceptVector(position, startSpeed, target, new Vector3D(0, 0, 0));
int slowDist = slowDownDistance + (int)asteroid.asteroid.LocalAABB.HalfExtents.Length();
int slowDist = slowDownDistance + asteroid.halfextent;
float distance = Vector3.Distance(position,target) - slowDist;
SandboxGameAssemblyWrapper.Instance.GameAction(() =>
{
Expand Down
2 changes: 1 addition & 1 deletion SEDropshipSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class SEDropshipSettings
public int slowDownDistance
{
get { return m_slowDownDistance; }
set { if (value > 128) m_slowDownDistance = value; else m_slowDownDistance = 128; }//safe minimum
set { if (value > 32) m_slowDownDistance = value; else m_slowDownDistance = 32; }//safe minimum
}

public bool anyAsteroid
Expand Down
13 changes: 12 additions & 1 deletion SeDropshipAsteroids.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ public class SeDropshipAsteroids
private List<MyVoxelMaterialDefinition> m_Defs = new List<MyVoxelMaterialDefinition>();
private Vector3D m_position;
private string m_name;
private int m_halfextent;

private static MyVoxelMaterialDefinition m_irondef = Sandbox.Definitions.MyDefinitionManager.Static.GetVoxelMaterialDefinition("Iron_01");
private static MyVoxelMaterialDefinition m_irondef2 = Sandbox.Definitions.MyDefinitionManager.Static.GetVoxelMaterialDefinition("Iron_02");
Expand Down Expand Up @@ -262,12 +263,15 @@ private void calculateSize()
m_sizex = m_position.X;
m_sizey = m_position.Y;
m_sizez = m_position.Z;
}
m_halfextent = (int)m_asteroid.LocalAABB.HalfExtents.Length();
}
catch (Exception)
{
Console.WriteLine("Exception thrown when attempting to cache values");
m_sizex = 50;
m_sizey = 50;
m_sizez = 50;
m_halfextent = 128;
return;
}

Expand Down Expand Up @@ -468,5 +472,12 @@ public Vector3D center
}

}
public int halfextent
{
get
{
return m_halfextent;
}
}
}
}

0 comments on commit 3b6a05c

Please sign in to comment.