summaryrefslogtreecommitdiffstats
path: root/games/njam/patches/changed_hiscore_name.patch
blob: d6cd8b2313341d4eff1e9e1a2833ecda8183dfe1 (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#! /bin/sh -e
## changed_hiscore_name.dpatch by Anibal Avelar <aavelar@cofradia.org>
##
## DP: apply patch to change the hiscore name

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argum
ent"
                exit 1;;
esac

exit 0
diff -bBdNrw -U5 njam-1.25/src/njam.cpp njam-1.25.modif/src/njam.cpp
--- njam-1.25/src/njam.cpp	2005-12-13 05:56:43.000000000 -0600
+++ njam-1.25.modif/src/njam.cpp	2008-05-12 11:59:46.694847801 -0500
@@ -235,11 +235,11 @@
 		fprintf(fp, "I=%s\n", m_GameOptions.ServerIP);
 		fclose(fp);
 	}
 
 		// format: NAME#POINTS#LEVEL#
-	fp = fopen("hiscore.dat", "w+");
+	fp = fopen("njam-hiscore.dat", "w+");
 	if (fp)
 	{
 		for (int i=0; i<10; i++)
 			fprintf(fp, "%s#%d#%d#\n", TopTenScores[i].name, TopTenScores[i].points, TopTenScores[i].level);
 		fclose(fp);
@@ -647,11 +647,11 @@
 	}
     else
         LogFile("Failed to open conf file.\n");
 
 	// create default hiscore
-    LogFile("Creating default hiscore.\n");
+    LogFile("Creating default njam-hiscore.\n");
 	char DefaultNames[10][10] = {
 		"MILAN", 		"TANJA",
 		"DULIO", 		"DJORDJE",
 		"CLAUS",		"ENZO",
 		"JOLAN",		"JAAP",
@@ -663,14 +663,14 @@
 		sprintf(TopTenScores[i].name, "%s\0", DefaultNames[i]);
 	}
 
 	// load hiscore from file (if any)
 	// format: NAME#POINTS#LEVEL#
-	fp = fopen("hiscore.dat", "r");
+	fp = fopen("njam-hiscore.dat", "r");
 	if (fp)
 	{
-		LogFile("Reading hiscore.dat\n");
+		LogFile("Reading njam-hiscore.dat\n");
 		char buff[40];
 		int number = 0;
 		while (!feof(fp) && number < 10)
 		{
 			fgets(buff, 40, fp);