From: jeppe@iesd.auc.dk (Jeppe Sommer)
Newsgroups: rec.games.xtank.programmer
Subject: Patches to box.c, update.c and x11.c
Date: 9 Sep 92 21:15:33 GMT
Distribution: rec
Organization: Mathematics and Computer Science, Aalborg University


Below is three patches for xtank 1.3e

The patches to box.c and update.c go together. They fix an error in the
handling of slowboxes, that make them a little too effective (understatement
of the year). The fix includes moving the handling of slowboxes from box.c to
update.c (by the way, I posted these patches some time during the spring, but
they apparently got lost - should I mail patches directly to the
"patchmeister" ?).

The last patch is one which I'm not very proud of. It is a _very_ quick 'n
dirty fix to x11.c which keeps the xtank menus within the physical dimensions
of your monitor ;-). It is probably only necessary when running xtank from
OpenWindows 3.0.  Don't apply this patch unless you really have to.

-----------------------------PATCH TO box.c:---------------------------------
*** box.c.orig	Wed Sep  9 21:26:22 1992
--- box.c	Wed Sep  9 21:31:36 1992
***************
*** 171,177 ****
  			box_scroll(b->type, xadj, yadj);
  			break;
  		case SLOW:
! 			box_slow(v);
  			break;
  	}
  
--- 171,177 ----
  			box_scroll(b->type, xadj, yadj);
  			break;
  		case SLOW:
! /*			box_slow(v);*/
  			break;
  	}
  

-----------------------------PATCH TO update.c:------------------------------
*** update.c.orig	Sun Aug 30 23:15:23 1992
--- update.c	Wed Sep  9 18:40:56 1992
***************
*** 375,381 ****
          slide_speed = sin(heading_diff) * vector->speed;
      }
  
!     if (slide_speed != 0.0 &&
          v->vdesc->treads != HOVER_TREAD &&
          v->safety == FALSE) {
          traction *= 0.7;	/* dynamic friction < stiction */
--- 375,382 ----
          slide_speed = sin(heading_diff) * vector->speed;
      }
  
!     /* 0.001 == infinitesimal */
!     if (ABS(slide_speed) > 0.001 &&  
          v->vdesc->treads != HOVER_TREAD &&
          v->safety == FALSE) {
          traction *= 0.7;	/* dynamic friction < stiction */
***************
*** 383,388 ****
--- 384,394 ----
  
      /* figure out what they WANT to do */
      desired_speed = vector->drive;
+ 
+     /* In slowboxes, pretend that they want to go slower */
+     if (real_map[v->loc->grid_x][v->loc->grid_y].type == SLOW)
+       desired_speed *= settings.si.box_slowdown;
+ 
      if (v->num_discs > 0) {
          /* if they have discs, pretend they want to go slower (more discs
             does NOT mean more slowdown) */



-----------------------------PATCH TO x11.c:---------------------------------
*** x11.c.orig	Sun Aug 30 23:15:24 1992
--- x11.c	Wed Sep  9 18:44:01 1992
***************
*** 942,947 ****
--- 942,952 ----
  	    fheight[i] = cs->ascent + cs->descent - (i > 0);
  	    fascent[i] = cs->ascent;
  	}
+ 	fheight[2] = 15;
+ 	fascent[2] = 10;
+ 	fheight[3] = 19;
+ 	fascent[3] = 12;
+ 
      }
      rw = RootWindow(vid->dpy, scr);





  


--

       Jeppe Sommer         |     Aalborg University   
                            |      Fredrik Bajersvej 7   
  email: jeppe@iesd.auc.dk  |       DK-9220 Aalborg {\O}st
____________________________|________Denmark______________