From 2b3b2d26fe523b2b203a1d2f85c6aca0ecae4dc3 Mon Sep 17 00:00:00 2001 From: Natsumi Date: Fri, 20 Jun 2025 11:43:08 +1200 Subject: [PATCH] Fix relaunch crash loop --- src/app.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/app.js b/src/app.js index d68263d7..1a02b564 100644 --- a/src/app.js +++ b/src/app.js @@ -10678,6 +10678,7 @@ console.log(`isLinux: ${LINUX}`); } }; + $app.data.lastCrashedTime = null; $app.methods.checkIfGameCrashed = function () { if (!this.relaunchVRChatAfterCrash) { return; @@ -10687,6 +10688,15 @@ console.log(`isLinux: ${LINUX}`); if (result || !isRealInstance(location)) { return; } + // check if relaunched less than 2mins ago (prvent crash loop) + if ( + this.lastCrashedTime && + new Date() - this.lastCrashedTime < 120_000 + ) { + console.log('VRChat was recently crashed, not relaunching'); + return; + } + this.lastCrashedTime = new Date(); // wait a bit for SteamVR to potentially close before deciding to relaunch var restartDelay = 8000; if (this.isGameNoVR) {