diff options
Diffstat (limited to 'games/ltris/files/patch-af')
-rw-r--r-- | games/ltris/files/patch-af | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/games/ltris/files/patch-af b/games/ltris/files/patch-af new file mode 100644 index 000000000000..7217f9582fd2 --- /dev/null +++ b/games/ltris/files/patch-af @@ -0,0 +1,47 @@ +--- ltris/tetris.cpp.orig Thu Dec 21 20:53:27 2000 ++++ ltris/tetris.cpp Thu Dec 21 21:03:51 2000 +@@ -19,6 +19,8 @@ + #include <string.h> + #include <stdlib.h> + #include <stdio.h> ++#include <sys/types.h> ++#include <sys/stat.h> + #include "tetris.h" + #include "preview.h" + +@@ -35,14 +37,18 @@ + snapshot = 0; + q_pct = 90; + q_pms = -0.05; ++ struct stat sb; + + //setup init data + /*config path*/ + cfg_path = new char[strlen(home_dir) + strlen(".ltris.cfg") + 2]; + sprintf(cfg_path, "%s/.ltris.cfg", home_dir); + /*load init*/ +- FILE *f; +- if ((f = fopen(cfg_path, "r")) == 0) { ++ FILE *f = NULL; ++ if (stat(cfg_path, &sb) == 0) { ++ f = fopen(cfg_path, "r"); ++ } ++ if ((f == NULL) || (sb.st_size != sizeof(InitData))) { + init_data.level = 0; + init_data.gametype = 0; + init_data.next = 1; +@@ -73,11 +79,13 @@ + init_data.smooth_hori = 0; + init_data.help = 0; + init_data.bl_by_bl = 0; ++ init_data.slow = 0; + } + else { + fread(&init_data, sizeof(InitData), 1, f); +- fclose(f); + } ++ if (f != NULL) ++ fclose(f); + + //load hiscores + hiscore[0] = new HiScore("highscore.0"); |