ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/spell_util.C
(Generate patch)

Comparing deliantra/server/server/spell_util.C (file contents):
Revision 1.89 by root, Wed Dec 31 17:35:38 2008 UTC vs.
Revision 1.90 by root, Thu Jan 1 11:41:17 2009 UTC

33/* This returns a random spell from 'ob'. If skill is set, then 33/* This returns a random spell from 'ob'. If skill is set, then
34 * the spell must be of this skill, it can be NULL in which case all 34 * the spell must be of this skill, it can be NULL in which case all
35 * matching spells are used. 35 * matching spells are used.
36 */ 36 */
37object * 37object *
38find_random_spell_in_ob (object *ob, const char *skill) 38find_random_spell_in_ob (object *ob, shstr_cmp skill)
39{ 39{
40 int k = 0, s; 40 int k = 0, s;
41 41
42 for (object *tmp = ob->inv; tmp; tmp = tmp->below) 42 for (object *tmp = ob->inv; tmp; tmp = tmp->below)
43 if (tmp->type == SPELL && (!skill || tmp->skill == skill)) 43 if (tmp->type == SPELL && (!skill || tmp->skill == skill))
247/* Checks to see if player knows the spell. If the name is the same 247/* Checks to see if player knows the spell. If the name is the same
248 * as an existing spell, we presume they know it. 248 * as an existing spell, we presume they know it.
249 * returns 1 if they know the spell, 0 if they don't. 249 * returns 1 if they know the spell, 0 if they don't.
250 */ 250 */
251object * 251object *
252check_spell_known (object *op, const char *name) 252check_spell_known (object *op, shstr_cmp name)
253{ 253{
254 object *spop; 254 object *spop;
255 shstr_cmp name_ (name);
256 255
257 for (spop = op->inv; spop; spop = spop->below) 256 for (spop = op->inv; spop; spop = spop->below)
258 if (spop->type == SPELL && spop->name == name) 257 if (spop->type == SPELL && spop->name == name)
259 return spop; 258 return spop;
260 259

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines