aboutsummaryrefslogtreecommitdiff
path: root/src/app/main.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-03-10 20:18:24 +0100
committerGitHub <noreply@github.com>2022-03-10 20:18:24 +0100
commit0cae81f6e2c9ea6e5501395fd00af7085e3b4e74 (patch)
tree9286bf114db954638228c12f6f1aeb6802fb1383 /src/app/main.js
parent6da9e22142edf0eb3b3b0a6a4c41ed1d58b93733 (diff)
downloadViper-0cae81f6e2c9ea6e5501395fd00af7085e3b4e74.tar.gz
Viper-0cae81f6e2c9ea6e5501395fd00af7085e3b4e74.zip
fix nsargs being cleared when edited out of Viper (#93)
If the nsargs are edited by a third-party program or anything that isn't Viper, the next time you launch Viper it'll reset the nsargs back to what it was when you last opened it.
Diffstat (limited to 'src/app/main.js')
-rw-r--r--src/app/main.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/app/main.js b/src/app/main.js
index a781ef1..1688ab2 100644
--- a/src/app/main.js
+++ b/src/app/main.js
@@ -33,6 +33,11 @@ if (fs.existsSync("viper.json")) {
} else {
setpath(true);
}
+
+ let args = path.join(settings.gamepath, "ns_startup_args.txt");
+ if (fs.existsSync(args)) {
+ settings.nsargs = fs.readFileSync(args, "utf8");
+ }
} else {
setpath();
}