[crossfire] Code cleanlieness and server stability

Robin Redeker elmex at ta-sa.org
Sun Mar 12 05:30:45 CST 2006


On Fri, Mar 10, 2006 at 10:39:05PM -0800, Mark Wedel wrote:
> Robin Redeker wrote:
> 
> > 
[...]
> >         else if (item->type == SCROLL && QUERY_FLAG(mon, FLAG_USE_SCROLL)) {
> >             if (monster_should_cast_spell(mon, item->inv))
> > 
[...]
> > So we patched it like this:
> > 
> >         if (item->inv && monster_should_cast_spell(mon, item->inv))
> 
>   I think you still need the item->type == SCROLL check in there - otherwise, 
> the monster will try to use spellbooks, wands, rods, containers - anything with 
> an inventory, as a spell.

Of course we did not remove the line with the else if :) Sorry if it was
misleading. I only meant that we changed the line:

             if (monster_should_cast_spell(mon, item->inv))

to:

             if (item->inv && monster_should_cast_spell(mon, item->inv))


Robin

-- 
elmex at ta-sa.org / robin at nethype.de / r.redeker at gmail.com
Robin Redeker



More information about the crossfire mailing list