Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CF: Fix for trap_disarm() crash
- To: crossfire (at) ifi.uio.no
- Subject: CF: Fix for trap_disarm() crash
- From: Jan Echternach <>
- Date: Thu, 8 Jun 2000 01:52:34 +0200
- Mail-Followup-To:
- Reply-To: Jan Echternach <>
- Sender:
This patch is already in the CVS tree. From the CHANGES file:
server/rune.c: trap_disarm(): Bugfix: Use SK_level() to determine
disarmer's level. Fixes server crash if multisquare monster casts
"disarm".
(This is a different cause for crashes on maps with big wizards,
unrelated to the animate_weaon() problems.)
--
Jan
diff -ru orig/crossfire-0.95.5-cvs3-patch19/server/rune.c crossfire-0.95.5-cvs3/server/rune.c
--- orig/crossfire-0.95.5-cvs3-patch19/server/rune.c Fri May 26 14:36:49 2000
+++ crossfire-0.95.5-cvs3/server/rune.c Thu Jun 8 01:20:46 2000
@@ -326,13 +326,15 @@
int trapworth; /* need to compute the experience worth of the trap
before we kill it */
+ int disarmer_level = SK_level (disarmer);
+
/* this formula awards a more reasonable amount of exp */
trapworth = MAX(1,trap->level) * disarmer->map->difficulty *
sqr(MAX(trap->stats.dam,spells[trap->stats.sp].sp)) /
- disarmer->level;
+ disarmer_level;
if(!(RANDOM()%(MAX(2,
- MIN(20,trap->level-disarmer->level
+ MIN(20,trap->level-disarmer_level
+5 - disarmer->stats.Dex/2)))))
{
new_draw_info(NDI_UNIQUE, 0,disarmer,"You successfuly disarm it!");
@@ -355,7 +357,7 @@
else
{
new_draw_info(NDI_UNIQUE, 0,disarmer,"You fail to disarm the trap.");
- if(! (RANDOM()% (MAX(2,disarmer->level-trap->level
+ if(! (RANDOM()% (MAX(2,disarmer_level-trap->level
+ disarmer->stats.Dex/2-6)))
&&risk) {
new_draw_info(NDI_UNIQUE, 0,disarmer,"In fact, you set it off!");