Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mod documentation.




 I really agree with Peter on this one - please give a description of
any patches you submit to me.

 I plan to write a source coding guideline sometime soon.  Some of the
things might be somewhat obvious, others more obscure (for example,
using static/global variables to keep values across functions calls
is extremely dangerous, because that function can be called from a function
it calls).  Anything that needs to have its value retained beyond one
(that) call to the function needs to have a link in the character
or something.

 I think this was the reason why the disappearing exit bug/characters
appearing in the middle of oceans happen.  Some of those functions used
static variables, and during the loading of the map, it could be called
again because a different character enters an exit.  That static variable
then does not have the expected value that the original calling function
put in it.

 Other things my be about identation and comment style, and fixing
code so it operates properly and is expandable.  Such that expanding
a feature should not be a major pain for each expansion (like
inventory display was).

 I know that some people have submitted patches in the past that may have
failed in some of these areas.  Don't worry about it or take offense - no
guidelines are in place right now, some of these were just convenient
cases I could use).

 --Mark