I am sorry I should have explained my bug and code a little better. It's
been a long time since i wrote here. My apologies.
Mike Barton wrote:
We put in a "<direction> flag <flags>" command.
You could do it that way. But that doesn't change the fact that
flag_value() ignores "junk" arguments.
flag_value() accepts multiple flags, ignores anything that is not a
flag, and doesn't return NO_FLAG as long as at least one argument is a flag.
What I did was force it to bail if the first argument is not a flag
which more than likely means it's a command argument _not_ a flag, i.e.
name, key and dig. Depending on how other code is written it could
affect other areas of the code as well, I just didn't bother testing to
find out. It is broke, fix it. ;)
There is some thought that snips should contain at least one error, so
that people understand what the code is doing. I really don't feel that
is the way to do it. I would rather give a fix that works (with a better
explanation next time) and leave some ideas, which follow...
Mike Barton wrote:
> I'm not sure short circuiting flag_value is the best solution.
In my humble shoddy-hack artist opinion ;), I don't think it is a good
coding practice to allow "junk" arguments to be ignored without at the
very least, logging it so you can find out it is happening. I also would
not advise allowing the code to make any changes at all as long as there
are junk arguments. In other words, don't short circuit flag_value,
change it so that it checks for junk arguments first, bailing if there
is one or more, and if there are no junk arguments, go back and start
changing things.
--
Jonathan L. Potter
Snafu Life.
telnet://aac.mudmagic.com:2469 (Alpha Phase)
01000101 -- Go ahead take a byte ;)