Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CF: A patch for the boulders & gates bug



Hello.

Recently, boulder & gate bug is reported at this mailing list.
Today, I hacked the source code.
(I refer the comment in server/time.c)

/* Check to make sure that only non pickable objects are above the
 * gate.  If so, we finish closing the gate, otherwise, we fall
 * through to the code below which should lower the gate slightly.
 */

The problem is that objects which can roll is not concidered. 
So, I made a temporary patch.
I hope the following patch will work fine.

Thanks,
S.Nishita.


-------- 8< --------- 8= ---------

*** server/time.c.org	Wed Feb  3 19:41:14 1999
--- server/time.c	Wed Feb  3 21:46:18 1999
***************
*** 234,246 ****
      /* First, lets see if we are already at the top */
      if((unsigned char) op->stats.wc==(NUM_ANIMATIONS(op)-1)) {
  
! 	/* Check to make sure that only non pickable objects are above the
! 	 * gate.  If so, we finish closing the gate, otherwise, we fall
! 	 * through to the code below which should lower the gate slightly.
  	 */
  
  	for (tmp=op->above; tmp!=NULL; tmp=tmp->above) 
! 	    if (!QUERY_FLAG(tmp, FLAG_NO_PICK) || QUERY_FLAG(tmp, FLAG_ALIVE))
  		break;
  
  	if (tmp==NULL) {
--- 234,249 ----
      /* First, lets see if we are already at the top */
      if((unsigned char) op->stats.wc==(NUM_ANIMATIONS(op)-1)) {
  
! 	/* Check to make sure that only non pickable and non rollable
! 	 * objects are above the gate.  If so, we finish closing the gate,
! 	 * otherwise, we fall through to the code below which should lower
! 	 * the gate slightly.
  	 */
  
  	for (tmp=op->above; tmp!=NULL; tmp=tmp->above) 
! 	    if (!QUERY_FLAG(tmp, FLAG_NO_PICK)
! 		|| QUERY_FLAG(tmp, FLAG_CAN_ROLL)
! 		|| QUERY_FLAG(tmp, FLAG_ALIVE))
  		break;
  
  	if (tmp==NULL) {
***************
*** 279,285 ****
  		    if(tmp->type==PLAYER) 
  			new_draw_info_format(NDI_UNIQUE, 0, tmp,
  					     "You are crushed by the %s!",op->name);
! 		} else if(!tmp->speed&&!QUERY_FLAG(tmp, FLAG_NO_PICK)) {
  		    /* If it has speed, it should move itself, otherwise: */
  		    int i=find_free_spot(tmp->arch,op->map,op->x,op->y,1,9);
  
--- 282,290 ----
  		    if(tmp->type==PLAYER) 
  			new_draw_info_format(NDI_UNIQUE, 0, tmp,
  					     "You are crushed by the %s!",op->name);
! 		} else if(!tmp->speed
! 			&& (!QUERY_FLAG(tmp, FLAG_NO_PICK)
! 			   ||QUERY_FLAG(tmp,FLAG_CAN_ROLL))) {
  		    /* If it has speed, it should move itself, otherwise: */
  		    int i=find_free_spot(tmp->arch,op->map,op->x,op->y,1,9);
  
***************
*** 291,297 ****
  
  	    /* See if there is still anything blocking the gate */
  	    for (tmp=op->above; tmp!=NULL; tmp=tmp->above) 
! 		if (!QUERY_FLAG(tmp, FLAG_NO_PICK) || QUERY_FLAG(tmp, FLAG_ALIVE))
  		    break;
  
  	    /* IF there is, start putting the gate down  */
--- 296,304 ----
  
  	    /* See if there is still anything blocking the gate */
  	    for (tmp=op->above; tmp!=NULL; tmp=tmp->above) 
! 		if (!QUERY_FLAG(tmp, FLAG_NO_PICK)
! 			|| QUERY_FLAG(tmp, FLAG_CAN_ROLL)
! 			|| QUERY_FLAG(tmp, FLAG_ALIVE))
  		    break;
  
  	    /* IF there is, start putting the gate down  */


------- 8< -------- 8= ----------

--------------------------------------------------------------------------
Seikoh Nishita		      |	Dep't. of Information & Computer Sciences
			      |	Faculty of Engineering Science
[e-mail]		      |	Osaka University
s-nisita@ics.es.osaka-u.ac.jp |	Toyonaka, Osaka 560, Japan

-
[you can put yourself on the announcement list only or unsubscribe altogether
by sending an email stating your wishes to crossfire-request@ifi.uio.no]