Been having a bit of trouble with the affect_from_char function.
I haven't touched it, so I dunno what's going on. It only seems to crash
when I call it to remove spells I've recently written, and charm, sometimes.
Here's the backtrace:
Program received signal SIGSEGV, Segmentation fault.
affect_from_char (ch=0x8269f30, type=7) at handler.c:336
336 if (hjp->type == type)
(gdb) bt
#0 affect_from_char (ch=0x8269f30, type=7) at handler.c:336
#1 0x8091dc7 in stop_follower (ch=0x8269f30) at utils.c:318
#2 0x8091e92 in die_follower (ch=0x8269f30) at utils.c:349
#3 0x8077660 in extract_char (ch=0x8269f30) at handler.c:934
#4 0x806354e in do_purge (ch=0x8296848, argument=0xbffff435 " yot",
cmd=253, subcmd=0) at act.wizard.c:1176
#5 0x8079cad in command_interpreter (ch=0x8296848,
argument=0xbffff430 "purge yot") at interpreter.c:787
#6 0x8049c86 in game_loop (mother_desc=5) at comm.c:519
#7 0x804952a in init_game (port=3333) at comm.c:203
#8 0x80494be in main (argc=1, argv=0xbffff800) at comm.c:176
#9 0x80491fb in ___crt_dummy__ ()
I've tried checking to see whether hjp is valid, specifically hjp->type,
etc. An assert(hjp) fails, too, but putting an if (hjp) in doesn't help
at all.
It also can't be anything specifically in stop_follower or any of those,
it happens from other places as well, such as removing a spell from the
victim in damage(). Strange.
The function is stock circle.
/* Call affect_remove with every spell of spelltype "skill" */
void affect_from_char(struct char_data * ch, sh_int type)
{
struct affected_type *hjp;
for (hjp = ch->affected; hjp; hjp = hjp->next)
if (hjp->type == type)
affect_remove(ch, hjp);
}
Any ideas? I'm well and truly stumped on this one.
Chris
_____________________________________________________
"A double-edged sword lets you cut down
your enemies with the backswing as well."
-- Gerrard of the Weatherlight
-----------------------------------------------------
Check out Dominia Mud, on snafu.net.au 3333
Or my homepage: http://yoyo.cc.monash.edu.au/~cjp
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/08/00 PST