Before you do something like
wielded->whatever[0].whatever
you want to add a check
if (wielded)
this prevents a crash when you try to reference a pointer that isn't
initialized (or soemthing like that.. if they're not wielding anythingm
then wielded == NULL and trying to use wielded-> will give a seg. viol.)
Also, you should change the object loading procedure in db.c to fill the
new structure you created (weapon_spell_type or something) with zeros,
and then, since I assume not every weapon casts a spell, again check with
if (wielded->spell[0].whatever) {
cast the spell
} else it doesn't have a spell...
I have no idea if this is right, but I ran into this problem when trying
to change stuff in hit().. it took me awhile to track down, but there
is also a reference to wielded in .. umm... skill_messages I think, that
one drove me nuts before I could find it! Let me know if I'm totally wrong,
Please.. heh.
Hope this helps.
Steve
This archive was generated by hypermail 2b30 : 12/07/00 PST