From 896ca2f912f8b85004b9b172477dc3a8c5a1f781 Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Sat, 23 Apr 2022 00:32:54 -0700 Subject: [PATCH] Fix server launcher --- scripts/local_server_launch.cmd | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/local_server_launch.cmd b/scripts/local_server_launch.cmd index c775e0d..2df8358 100644 --- a/scripts/local_server_launch.cmd +++ b/scripts/local_server_launch.cmd @@ -3,6 +3,16 @@ set GRASSCUTTER_JAR=%1 set GRASSCUTTER_JAR=%GRASSCUTTER_JAR:"=% +:: Get folder the jar is in +set "X=%GRASSCUTTER_JAR%" +:l +if "%X:~-1%"=="\" goto al +set "X=%X:~0,-1%" +goto l +:al +set "X=%X:~0,-1%" +set "GRASSCUTTER_ROOT=%X%" + :: Ensure admin >nul 2>&1 reg query "HKU\S-1-5-19" || ( set params = %*:"="""% @@ -12,6 +22,6 @@ set GRASSCUTTER_JAR=%GRASSCUTTER_JAR:"=% echo Starting local Grasscutter server... :: Change dir to server directory - +cd /d "%GRASSCUTTER_ROOT%" start /b java -jar %GRASSCUTTER_JAR% \ No newline at end of file