Fixed Neverputt using hard-coded limits for score counts. Patch from ettin.
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Fri, 1 Feb 2008 02:22:12 +0000 (02:22 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Fri, 1 Feb 2008 02:22:12 +0000 (02:22 +0000)
Long overdue...  See http://www.nevercorner.net/forum/viewtopic.php?id=883.

git-svn-id: https://s.snth.net/svn/neverball/trunk@1688 78b8d119-cf0a-0410-b17c-f493084dd1d7

putt/hole.c

index f2d03ad..6ed2da0 100644 (file)
@@ -134,7 +134,7 @@ char *hole_tot(int p)
 
     if (p <= party)
     {
-        for (h = 1; h <= hole && h <= 18; h++)
+        for (h = 1; h <= hole && h < count; h++)
             T += score_v[h][p];
 
         sprintf(str, "%d", T);
@@ -152,7 +152,7 @@ char *hole_out(int p)
 
     if (p <= party)
     {
-        for (h = 1; h <= hole && h <= 9; h++)
+        for (h = 1; h <= hole && h <= count / 2; h++)
             T += score_v[h][p];
 
         sprintf(str, "%d", T);
@@ -167,10 +167,11 @@ char *hole_in(int p)
     static char str[MAXSTR];
 
     int h, T = 0;
+    int out = count / 2;
 
-    if (hole > 9 && p <= party)
+    if (hole > out && p <= party)
     {
-        for (h = 10; h <= hole && h <= 18; h++)
+        for (h = out + 1; h <= hole && h < count; h++)
             T += score_v[h][p];
 
         sprintf(str, "%d", T);