From 1cc5f452ff9a9856504fd1faafcf5dc3fe0eef66 Mon Sep 17 00:00:00 2001 From: jeefo Date: Wed, 3 Sep 2025 16:19:07 +0300 Subject: [PATCH] fix: startup when gamedir appears on path multiple times (ref #704) --- src/storage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage.cpp b/src/storage.cpp index f5d8494..b01b05a 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -490,7 +490,7 @@ StringRef BotStorage::getRunningPathVFS () { if (path.empty ()) { path = getRunningPath (); - path = path.substr (path.find (game.getRunningModName ())); // skip to the game dir + path = path.substr (path.rfind (game.getRunningModName ())); // skip to the game dir path = path.substr (path.find (kPathSeparator) + 1); // skip the game dir } return path;