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

CF: a bug of slaying & patch



Hello, everyone.

In this mail, I'll report a bug for slaying and show a temporary patch 
for it. This bug report and a patch is S.Yoshioka's work.

The slaying parameter means "those objects with this race receives 2x
damage."
But slaying with more than one race will not work well.
For example, the slaying of the avator of Mostrai is "goblin,giant".
But the avator cannot gives 2x damage to giants.

This bug is caused by a mistake about usage of strstr().
The following is a temporary patch.

But I noticed that race parameters can also be set to two or
more races. So, drastic change could be needed for all occurance of
strstr() in server/attack.c.

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

*** server/attack.c.org	Fri Feb 19 23:34:09 1999
--- server/attack.c	Fri Feb 19 23:34:58 1999
***************
*** 502,508 ****
      if (attacktype & AT_INTERNAL) return dam;
  
      if (hitter->slaying) {
! 	if (((op->race !=NULL && strstr(op->race, hitter->slaying)) ||
  #ifndef MULTIPLE_GODS
  	  (strstr(hitter->slaying, undead_name) && QUERY_FLAG(op,FLAG_UNDEAD)) ||
  #endif
--- 502,508 ----
      if (attacktype & AT_INTERNAL) return dam;
  
      if (hitter->slaying) {
! 	if (((op->race !=NULL && strstr(hitter->slaying, op->race)) ||
  #ifndef MULTIPLE_GODS
  	  (strstr(hitter->slaying, undead_name) && QUERY_FLAG(op,FLAG_UNDEAD)) ||
  #endif

------- 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]