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

CF: another bug of cone magic



I found another bug of cone magic.
Cone magic invoked by players should have attacktype of magic.
But it does not have.

Following patch is useful for some people.


*** spell_util.c.orig	Sun Feb  8 14:26:19 1998
--- spell_util.c	Wed Mar 25 00:36:45 1998
***************
*** 958,965 ****
      tmp->level=SK_level(op); /* need to use the cleric level, not overall value -b.t. */ 
      tmp->x=x,tmp->y=y;
  #ifdef MULTIPLE_GODS /* holy word stuff */                
!     if((tmp->attacktype&AT_HOLYWORD)||(tmp->attacktype&AT_GODPOWER))
              if(!tailor_god_spell(tmp,op)) return 0;  
      else /* god/holy word isnt really 'magic' */
  #endif
      if(magic)
--- 958,966 ----
      tmp->level=SK_level(op); /* need to use the cleric level, not overall value -b.t. */ 
      tmp->x=x,tmp->y=y;
  #ifdef MULTIPLE_GODS /* holy word stuff */                
!     if((tmp->attacktype&AT_HOLYWORD)||(tmp->attacktype&AT_GODPOWER)) {
              if(!tailor_god_spell(tmp,op)) return 0;  
+     }
      else /* god/holy word isnt really 'magic' */
  #endif
      if(magic)



I'm not sure that the patch is useful for everybody.
The bug is related with the specification of C language.
i.e. cone magic does not have attacktype of magic,
*only if* the following conditional program,

	if (p1) 
		if (p2) 
			st2
	else if (p3)
		st3

is same as the following program on your C language

	if (p1) {
		if (p2) 
			st2
		else if (p3)
			st3
	}

-------
--------------------------------------------------------------------------
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
[to unsubscribe etc., send mail to crossfire-request@ifi.uio.no]