Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot gracefully restart after clicking the "Restart" button on NixOS #263

Open
cloudyluna opened this issue Jan 22, 2025 · 0 comments
Open

Comments

@cloudyluna
Copy link

Hi. I am on NixOS 24.11 and using the distributed client executable from the repo.

I found that I cannot gracefully restart the game by clicking the "Restart" button that appears after I tick the fullscreen mode option and vice versa.

Once the game exits, it prints Returning from relaunching game, exiting this process on the console and doesn't actually restart the game.

With lldb and a breakpoint at minorGems/game/platforms/SDL/gameSDL.cpp:5550:

(lldb) b gameSDL.cpp:5550
....
* thread #1, name = 'OneLife', stop reason = breakpoint 1.1
    frame #0: 0x0000555555735b48 OneLife`relaunchGame() at gameSDL.cpp:5550:30
   5547
   5548 char relaunchGame() {
   5549     char *launchTarget = 
-> 5550         autoSprintf( "./%s", getLinuxAppName() );
   5551
   5552     AppLog::infoF( "Relaunching game %s", launchTarget );
   5553
(lldb) print getLinuxAppName()
(const char *) 0x00005555557513d2 "OneLifeApp"

here getLinuxAppName() prints OneLifeApp which I believe should be OneLife, the actual executable name instead.

I have to compile the game from the source and apply my workaround patch below to make the restarting function work:

diff --git a/gameSource/game.cpp b/gameSource/game.cpp
index db6b99c8..2f0d6b66 100644
--- a/gameSource/game.cpp
+++ b/gameSource/game.cpp
@@ -336,7 +336,7 @@ int getAppVersion() {
 
 const char *getLinuxAppName() {
     // no dir-name conflict here because we're using all caps for app name
-    return "OneLifeApp";
+    return getAppName();
     }
 
 

I don't know if this bug affects other Linux users or if is it only on my NixOS system.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant