Skip to content

Commit

Permalink
-Updated game libraries
Browse files Browse the repository at this point in the history
-Updated API libraries
-Added extra check for warp distance to ensure that even on slow servers the ship warps the correct distance even if it takes longer
  • Loading branch information
chessmaster42 committed Aug 12, 2014
1 parent a5b6508 commit ed2a4a5
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 3 deletions.
Binary file modified Libraries/SEModAPI.dll
Binary file not shown.
Binary file modified Libraries/SEModAPIExtensions.dll
Binary file not shown.
Binary file modified Libraries/SEModAPIInternal.dll
Binary file not shown.
Binary file modified Libraries/Sandbox.Common.XmlSerializers.dll
Binary file not shown.
Binary file modified Libraries/Sandbox.Common.dll
Binary file not shown.
Binary file modified Libraries/VRage.Common.dll
Binary file not shown.
Binary file modified Libraries/VRage.Library.dll
Binary file not shown.
Binary file modified Libraries/VRage.Math.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions WarpDrivePlugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.2.1.4")]
[assembly: AssemblyFileVersion("0.2.1.4")]
[assembly: AssemblyVersion("0.2.1.5")]
[assembly: AssemblyFileVersion("0.2.1.5")]
16 changes: 15 additions & 1 deletion WarpDrivePlugin/WarpEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class WarpEngine : MultiblockStructure, IDisposable

private float m_energyRequired;
private float m_accelerationFactor;
private Vector3 m_warpStartPosition;

private string m_oldBeaconName;
private float m_oldBeaconBroadcastRadius;
Expand Down Expand Up @@ -131,6 +132,15 @@ public bool IsDisposed
get { return m_isDisposed; }
}

public float WarpDistance
{
get
{
float distance = Core._SpeedFactor * 100 * Core._Duration;
return distance;
}
}

protected BeaconEntity Beacon
{
get
Expand Down Expand Up @@ -511,8 +521,10 @@ public void Update()
if (m_isAtWarpSpeed)
{
m_timeSinceWarpStart = DateTime.Now - m_warpStart;
float distanceWarped = Vector3.Distance(m_warpStartPosition, Parent.Position);

if (speed > (0.95 * Core._SpeedFactor * 100) && m_timeSinceWarpStart.TotalMilliseconds > Core._Duration * 1000)
//Slow down if at speed, elapsed time is greater than duration, and warp distance is at least met
if (speed > (0.95 * Core._SpeedFactor * 100) && m_timeSinceWarpStart.TotalMilliseconds > Core._Duration * 1000 && distanceWarped > WarpDistance)
{
m_isSpeedingUp = false;
m_isAtWarpSpeed = false;
Expand Down Expand Up @@ -635,6 +647,8 @@ protected void SpeedUp()
m_isSpeedingUp = false;
m_isSlowingDown = false;
m_warpStart = DateTime.Now;

m_warpStartPosition = Parent.Position;
}
else
{
Expand Down

0 comments on commit ed2a4a5

Please sign in to comment.