[crossfire] Code cleanlieness and server stability

Robin Redeker elmex at ta-sa.org
Fri Mar 10 08:57:43 CST 2006


On Mon, Feb 27, 2006 at 10:29:14PM -0800, Mark Wedel wrote:
> Robin Redeker wrote:
> 
> > (btw. it would be easier for us to submit those patches directly to the
> > mailing list)
> > 
> > I hope i can find the time to submit our bug fixes to the sourceforge
> > tracker, it would be much easier to just drop a mail to a mailing list
> > than logging in at sf.net, finding the correct tracker, filling in the
> > forms, adding the file and submitting it.
> 
>   The problem with submitting to the mailing list is that it is too easy for 
> things to just get lost.
> 
>   Simplest example being that every thinks someone else will take and apply the 
> patch, and no one ever does, and thus the patch is no longer applied.
> 
>   While the tracker may be less convenient, at least there is a definite record 
> - it is open until someone takes some action on it.  No way for it to really 
> fall through the cracks.
> 

Yes, ok, i've submitted 2 other patches in the last 2 days.

One question that arose on the last patch:

We found following code in server/monster.c (around line 1252):

        else if (item->type == SCROLL && QUERY_FLAG(mon, FLAG_USE_SCROLL)) {
            if (monster_should_cast_spell(mon, item->inv))

And in apply.c at void apply_scroll (object *op, object *tmp, int dir):

        if (!tmp->inv || tmp->inv->type != SPELL) {
                new_draw_info (NDI_UNIQUE, 0, op,
                        "The scroll just doesn't make sense!");
                return;

So we patched it like this:

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

But the question is: How is a scroll with an empty inventory created
in the first place? We weren't able to find out what behavoir is correct
and where and how scrolls are created.

But IMHO things like this and other inconsistencies should be fixed 
before doing unit tests :)


Robin

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



More information about the crossfire mailing list