rapiz1 / DungeonRush

πŸ‘ΎπŸ A opensource game inspired by Snake, written in pure C with SDL
GNU General Public License v3.0
2k stars 294 forks source link

AppImage crashs when creating data file #14

Closed rapiz1 closed 4 years ago

rapiz1 commented 4 years ago

Found by @BruceZhang1993 AppImage will crash when one turn is finished, creating the data file storage.dat. @probonopd The path used in the code is ./storage.dat. Anyway the data should be held in $HOME or something. I just don't want to get into a tricky situation related to the platforms. Is there a solution that the program can write into the working directory?

rapiz1 commented 4 years ago

With https://github.com/Rapiz1/DungeonRush/commit/3b0a11183cc8f9747de52182360d4faed331cb4b the storage will be disabled if the file descriptor can't be opened, so the program won't crash anymore. It does not really hurt if the rank list can't persist.

probonopd commented 4 years ago

Anyway the data should be held in $HOME or something.

Yes, this is the way to go. Then the problem will go away.

rapiz1 commented 4 years ago

Resolved by 3b0a11183cc8f9747de52182360d4faed331cb4b