To sum it up... Player A starts to cast a spell (it takes a few seconds) on mob A. Player B kills mob A while Player A is still casting. When Player A finishes spell, there's a crash.
This is the bt:
#0 number_argument (argument=0x0,
arg=0xbf97118c "\034\017\f\b¼\021\227¿pî\b\nÈ!\227¿#¨\004\b¸\002\t\n\210¾\b\n\034Ã\036\b8\"\227¿" at interp.c:852
#1 0x080f46e0 in get_char_room (ch=0xa0902b8, argument=0x0) at handler.c:1981
#2 0x0814a49b in do_chant (ch=0xa0902b8, argument=0x81d5178 "" at skills.c:7489
#3 0x080e9810 in violence_update () at fight.c:347
#4 0x081734cd in update_handler () at update.c:2615
#5 0x080cb0b7 in game_loop () at comm.c:1276
#6 0x080ccc95 in main (argc=0, argv=0xa08be88) at comm.c:606
Now, I already had an ifcheck to make sure the target was still in the room. Here's the check:
if ( get_char_room( ch, ch->using_spell->target->name ) == NULL || char_died(ch->using_spell->target) )
The above aborts if true.
using_spell->target is CHAR_DATA. If I print using_spell->target I get 0xa091eb8.
using_spell->target->name is 0x0.
Why is using_spell->target becoming corrupt? Spells work fine if the target is not killed. When a target is killed, it shouldn't mess with ch->using_spell... right?
If anything, you'd think that the char_died ifcheck would work.