Package: alienblaster / 1.1.0-10

06-fix-highscore.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Put high score file in HOME dir.

--- alienblaster-1.1.0.orig/src/menuArcadeMode.cc	2004-08-19 18:24:20.000000000 +0200
+++ alienblaster-1.1.0/src/menuArcadeMode.cc	2008-05-01 15:17:10.000000000 +0200
@@ -31,6 +31,7 @@
 #include "options.h"
 #include <iostream>
 #include <fstream>
+#include <cstdlib>
 
 MenuArcadeMode::MenuArcadeMode( SDL_Surface *scr ) {
   screen = scr;
@@ -46,7 +47,7 @@
   activeChoice = 0;
   playerOneLightFighter = true;
 
-  op = new Options( FN_HIGHSCORE );
+  op = new Options( (string)getenv("HOME") + "/.alienblaster_highscore" );
 
   // check, if the highscore is open
   int highscoreTest;
@@ -72,12 +73,12 @@
     op->setInt( 300, "POINTS_9" );
     op->setStr( "I RULE", "NAME_10" );
     op->setInt( 200, "POINTS_10" );
-    op->saveFile( FN_HIGHSCORE );
+    op->saveFile( (string)getenv("HOME") + "/.alienblaster_highscore" );
   }  
 }
 
 MenuArcadeMode::~MenuArcadeMode() {
-  op->saveFile( FN_HIGHSCORE );
+  op->saveFile( (string)getenv("HOME") + "/.alienblaster_highscore" );
   delete op;
 }
 
@@ -257,7 +258,7 @@
       op->setStr(  "? ? ? ?", "NAME_" + asString( newPos ) );
       readHighScoreName( newPos );
     }
-    op->saveFile( FN_HIGHSCORE );
+    op->saveFile( (string)getenv("HOME") + "/.alienblaster_highscore" );
   }
 }