diff --git a/Slipspace Engine/Data/Scripts/WarpDrive/WarpDriveSession.cs b/Slipspace Engine/Data/Scripts/WarpDrive/WarpDriveSession.cs index 71a440f..a7e018c 100644 --- a/Slipspace Engine/Data/Scripts/WarpDrive/WarpDriveSession.cs +++ b/Slipspace Engine/Data/Scripts/WarpDrive/WarpDriveSession.cs @@ -228,7 +228,7 @@ public void TransmitToggleWarp(IMyTerminalBlock block) })); } - private void ReceiveWarpSpeed(ushort channel, byte[] data, ulong sender, bool fromServer) + private void ReceiveWarpSpeed(ushort channel, byte[] data, ulong sender, bool fromServer) //TODO: suspect this for constant warp load sent to clients { var message = MyAPIGateway.Utilities.SerializeFromBinary(data); if (message == null) diff --git a/Slipspace Engine/Data/Scripts/WarpDrive/WarpSystem.cs b/Slipspace Engine/Data/Scripts/WarpDrive/WarpSystem.cs index 9119ca3..b78fc71 100644 --- a/Slipspace Engine/Data/Scripts/WarpDrive/WarpSystem.cs +++ b/Slipspace Engine/Data/Scripts/WarpDrive/WarpSystem.cs @@ -76,6 +76,9 @@ public class WarpSystem { public string ProximytyAlert = "Can't Start SSD, Proximity Alert!"; public const float EARTH_GRAVITY = 9.806652f; + private int teleportTick = 0; + private const int TELEPORT_DELAY = 10; // Adjust this value to change the update frequency + public WarpSystem(WarpDrive block, WarpSystem oldSystem) { if (block == null) @@ -211,21 +214,30 @@ public void UpdateBeforeSimulation() { } } - if (TeleportNow && !SafeTriggerON) { - TeleportNow = false; - - if (currentSpeedPt > 1f && gridMatrix != null) { - gridMatrix.Translation += gridMatrix.Forward * currentSpeedPt; - - if (MyAPIGateway.Utilities.IsDedicated || MyAPIGateway.Multiplayer.IsServer) - MainGrid.Teleport(gridMatrix); - - if (!MyAPIGateway.Utilities.IsDedicated) { - DrawAllLinesCenter1(); - - if (currentSpeedPt > 316.6666) { - //StartBlinkParticleEffect(); - DrawAllLinesCenter4(); + if (TeleportNow && !SafeTriggerON) + { + teleportTick++; + if (teleportTick >= TELEPORT_DELAY) + { + teleportTick = 0; + TeleportNow = false; + + if (currentSpeedPt > 1f && gridMatrix != null) + { + // Multiply the movement by TELEPORT_DELAY to maintain the same effective speed + gridMatrix.Translation += gridMatrix.Forward * currentSpeedPt * TELEPORT_DELAY; + + if (MyAPIGateway.Utilities.IsDedicated || MyAPIGateway.Multiplayer.IsServer) + MainGrid.Teleport(gridMatrix); + + if (!MyAPIGateway.Utilities.IsDedicated) + { + DrawAllLinesCenter1(); + + if (currentSpeedPt > 316.6666) + { + DrawAllLinesCenter4(); + } } } } diff --git a/Slipspace Engine/Data/Scripts/concatrecursivelyandminify.bat b/Slipspace Engine/Data/Scripts/concatrecursivelyandminify.bat new file mode 100644 index 0000000..9bbffa3 --- /dev/null +++ b/Slipspace Engine/Data/Scripts/concatrecursivelyandminify.bat @@ -0,0 +1,60 @@ +@echo off +setlocal enabledelayedexpansion +chcp 65001 +REM ^^ this is to change the encoding to UTF-8, apparently + +echo Starting operation... + +set TEMP_OUTPUT=temp_concatenated.txt +set FINAL_OUTPUT=minified_output.txt +set /a COUNT=0 +set /a ERRORS=0 + +if exist "%TEMP_OUTPUT%" ( + echo Existing temporary file found. Deleting... + del "%TEMP_OUTPUT%" +) + +if exist "%FINAL_OUTPUT%" ( + echo Existing output file found. Deleting... + del "%FINAL_OUTPUT%" +) + +for /r %%i in (*.cs) do ( + echo Processing: "%%i" + type "%%i" >> "%TEMP_OUTPUT%" + if errorlevel 1 ( + echo Error processing "%%i". + set /a ERRORS+=1 + ) else ( + set /a COUNT+=1 + ) +) + +echo Concatenation completed. +echo Total files processed: %COUNT% +if %ERRORS% gtr 0 ( + echo There were %ERRORS% errors during the concatenation. +) else ( + echo No errors encountered during concatenation. +) + +echo Minifying concatenated file... +csmin < "%TEMP_OUTPUT%" > "%FINAL_OUTPUT%" +if errorlevel 1 ( + echo Error occurred during minification. + set /a ERRORS+=1 +) else ( + echo Minification completed successfully. +) + +echo Cleaning up temporary file... +del "%TEMP_OUTPUT%" + +echo Operation completed. +if %ERRORS% gtr 0 ( + echo There were %ERRORS% errors during the entire operation. +) else ( + echo No errors encountered during the entire operation. +) +pause \ No newline at end of file