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

spells.c cleaning




  There are several things that could be done to improve spells.c

1)  Some of the functions are downright redundant.  They're basically
front-ends to certain spells that are used exactly once wlsewhere in the code.
An example of this is 'fire_a_ball', which is used by firechests only.
There's no reason that this couldn't be replaced by a call to 'cast_spell',
and there are other similar little unneeded functions in the spell code.

There are even some functionsn which are not used whatsoever, anywhere.

2)  There are certain tasks which some functions all have their own copy
of.  For example, one task i recall is the act of 'finding a friendly player,
or if none are around, find yourself' for healing, stat, and protection
spells.  I think all three have their own copy of this, I'm not sure
how bad it is.  But the code might benefit from a little abstraction
of commonly-used stuff into their own functions.

Regards,

PeterM