I am having a most interesting time with set_fighting. For some reason, it
likes to crash my MUD without (from what I can tell) rhyme or reason.
Here is the gdb output (I saved the core and binary, so if you need a
specific print or somesuch, let me know and I will provide.)
Core was generated by `bin/spear -q 1066'.
Program terminated with signal 6, IOT trap/Abort.
Reading symbols from /lib/libc.so.5...done.
Reading symbols from /lib/ld-linux.so.1...done.
#0 0x40077f61 in __kill ()
(gdb) bt
#0 0x40077f61 in __kill ()
#1 0x4004407d in gsignal ()
#2 0x8083e86 in mag_masses (level=60, ch=0x813fba8, spellnum=71,
savetype=4, argument=0x80e3b60 "cast") at magic.c:970
#3 0x809bdc1 in call_magic (caster=0x813fba8, cvict=0x0, ovict=0x0,
spellnum=71, level=60, casttype=0, argument=0x80e3b60 "cast")
at spell_parser.c:554
#4 0x809cb04 in cast_spell (ch=0x813fba8, tch=0x0, tobj=0x0, spellnum=71,
argument=0x80e3b60 "cast") at spell_parser.c:821
#5 0x809d0c3 in do_cast (ch=0x813fba8, argument=0xbffff9f8 " ", cmd=51,
subcmd=0) at spell_parser.c:991
#6 0x807e4f1 in command_interpreter (ch=0x813fba8,
argument=0xbffff9f4 "cast ") at interpreter.c:914
#7 0x806b350 in game_loop (mother_desc=3) at comm.c:535
#8 0x806aa9c in init_game (port=1066) at comm.c:210
#9 0x806aa2b in main (argc=3, argv=0xbffffe58) at comm.c:182
#10 0x80493fe in _start ()
And, of course, here is the code that is giving me fits. This bit is
pulled from mag_masses() in magic.c.
for (tch = world[ch->in_room].people; tch; tch = tch_next) {
tch_next = tch->next_in_room;
if (tch == ch)
continue;
if (spell_info[spellnum].violent) {
if (!IS_NPC(ch) && !IS_NPC(tch) &&
!PRF_FLAGGED(ch, PRF_CAN_MURDER)) {
act("Your spell doesn't seem to affect $N",
FALSE, ch, 0, tch, TO_CHAR);
act("$n's spell doesn't seem to affect $N.",
FALSE, ch, 0, tch, TO_NOTVICT);
act("$n's spell doesn't seem to affect you.",
FALSE, ch, 0, tch, TO_VICT);
continue;
}
check_killer(ch, tch);
if (!FIGHTING(tch))
set_fighting(ch, tch); /* THIS IS LINE 970 */
}
/* more stuff in loop here to actually make the spell do something */
}
If I comment out the set_fighting (and the if), then all goes well, but I
want the target character to start bashing on the caster and without those
lines, it goes kaput. :(
I checked my set_fighting vs. stock set_fighting code and they are
identical exept for the fact that I renamed the IS_AFFECTED macro to
AFF_FLAGGED to be more consitent with the rest of the macros.
Any ideas?
Thanks in advance for any advice or suggestions that you may have.
John Evans <evansj@hi-line.net> -- http://www.hi-line.net/~evansj/
Any sufficiently advanced technology is indistinguishable from magic.
--Arthur C. Clarke
+------------------------------------------------------------+
| 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/15/00 PST