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

Comparing deliantra/server/server/skill_util.C (file contents):
Revision 1.9 by root, Sun Sep 10 15:59:57 2006 UTC vs.
Revision 1.10 by root, Tue Sep 12 00:26:16 2006 UTC

1 1
2/* 2/*
3 * static char *rcsid_skill_util_c = 3 * static char *rcsid_skill_util_c =
4 * "$Id: skill_util.C,v 1.9 2006/09/10 15:59:57 root Exp $"; 4 * "$Id: skill_util.C,v 1.10 2006/09/12 00:26:16 root Exp $";
5 */ 5 */
6 6
7/* 7/*
8 CrossFire, A Multiplayer game for X-windows 8 CrossFire, A Multiplayer game for X-windows
9 9
56#include <spells.h> 56#include <spells.h>
57 57
58static int attack_hth (object *pl, int dir, const char *string, object *skill); 58static int attack_hth (object *pl, int dir, const char *string, object *skill);
59static int attack_melee_weapon (object *op, int dir, const char *string, object *skill); 59static int attack_melee_weapon (object *op, int dir, const char *string, object *skill);
60 60
61shstr skill_names[NUM_SKILLS];
62
63/* init_skills basically just sets up the skill_names table 61/* init_skills basically just sets up the skill_names table
64 * above. The index into the array is set up by the 62 * above. The index into the array is set up by the
65 * subtypes. 63 * subtypes.
66 */ 64 */
67void 65void
69{ 67{
70 int i; 68 int i;
71 archetype *at; 69 archetype *at;
72 70
73 for (at = first_archetype; at != NULL; at = at->next) 71 for (at = first_archetype; at != NULL; at = at->next)
74 {
75 if (at->clone.type == SKILL) 72 if (at->clone.type == SKILL)
76 { 73 {
77 if (skill_names[at->clone.subtype] != NULL) 74 if (skill_names[at->clone.subtype] != NULL)
78 {
79 LOG (llevError, "init_skills: multiple skill using same subtype %d, %s, %s\n", 75 LOG (llevError, "init_skills: multiple skill using same subtype %d, %s, %s\n",
80 at->clone.subtype, &skill_names[at->clone.subtype], &at->clone.skill); 76 at->clone.subtype, &skill_names[at->clone.subtype], &at->clone.skill);
81 }
82 else 77 else
83 {
84 skill_names[at->clone.subtype] = at->clone.skill; 78 skill_names[at->clone.subtype] = at->clone.skill;
85 }
86 } 79 }
87 }
88 80
89 /* This isn't really an error if there is no skill subtype set, but 81 /* This isn't really an error if there is no skill subtype set, but
90 * checking for this may catch some user errors. 82 * checking for this may catch some user errors.
91 */ 83 */
92 for (i = 1; i < NUM_SKILLS; i++) 84 for (i = 1; i < NUM_SKILLS; i++)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines