SeventhUmbral icon indicating copy to clipboard operation
SeventhUmbral copied to clipboard

Fix FFXIV not launching when computer has been on for longer than ~24.9 days (pass the tick count to FFXIV as an unsigned int)

Open Sophira opened this issue 3 years ago • 1 comments

Please note: This pull request has not been tested as I do not have the correct build environment. However, the fix is a simple one.

I recently discovered that using Seventh Umbral Launcher to run FFXIV 1.x after a signed overflow of GetTickCount occurs (once the computer has been on for over ~24.9 days) results in the game failing to launch. This bug can be seen in action in this video, which includes a handy display on when the overflow happens: https://youtu.be/eaLcPSpQar4

At first I thought the problem was with the game itself, since I noticed that ffxivgame.exe was able to be launched successfully, but after further investigation I think the issue is actually in the Seventh Umbral Launcher instead.

Namely, when the launcher is calculating the parameters to use to launch the game with, the result of GetTickCount is correctly assigned to an unsigned integer, but the use of %d rather than %u in the sprintf call directly afterwards means that we're passing the signed number to ffxivgame.exe, not the unsigned number.

Although I haven't been able to test this, I'm all but certain that this change will fix this bug.

Sophira avatar Jan 31 '22 14:01 Sophira

One sec, going to force-push a correction to the commit description, sorry!

[edit: Done! I had accidentally said %s instead of %d in there.]

Sophira avatar Jan 31 '22 14:01 Sophira