… | |
… | |
101 | * mostly used for sending exp. |
101 | * mostly used for sending exp. |
102 | */ |
102 | */ |
103 | void |
103 | void |
104 | link_player_skills (object *op) |
104 | link_player_skills (object *op) |
105 | { |
105 | { |
106 | object *tmp; |
|
|
107 | |
|
|
108 | for (tmp = op->inv; tmp; tmp = tmp->below) |
106 | for (object *tmp = op->inv; tmp; tmp = tmp->below) |
109 | { |
|
|
110 | if (tmp->type == SKILL) |
107 | if (tmp->type == SKILL) |
111 | { |
108 | { |
112 | /* This is really a warning, hence no else below */ |
109 | /* This is really a warning, hence no else below */ |
113 | if (op->contr->last_skill_ob[tmp->subtype] && op->contr->last_skill_ob[tmp->subtype] != tmp) |
110 | if (op->contr->last_skill_ob[tmp->subtype] && op->contr->last_skill_ob[tmp->subtype] != tmp) |
114 | { |
|
|
115 | LOG (llevError, "Multiple skills with the same subtype? %s, %s\n", |
111 | LOG (llevError, "Multiple skills with the same subtype? %s, %s\n", |
116 | &op->contr->last_skill_ob[tmp->subtype]->skill, &tmp->skill); |
112 | &op->contr->last_skill_ob[tmp->subtype]->skill, &tmp->skill); |
117 | } |
113 | |
118 | if (tmp->subtype >= NUM_SKILLS) |
114 | if (tmp->subtype >= NUM_SKILLS) |
119 | { |
|
|
120 | LOG (llevError, "Invalid subtype number %d (range 0-%d)\n", tmp->subtype, NUM_SKILLS); |
115 | LOG (llevError, "Invalid subtype number %d (range 0-%d)\n", tmp->subtype, NUM_SKILLS); |
121 | } |
|
|
122 | else |
116 | else |
123 | { |
117 | { |
124 | op->contr->last_skill_ob[tmp->subtype] = tmp; |
118 | op->contr->last_skill_ob[tmp->subtype] = tmp; |
125 | op->contr->last_skill_exp[tmp->subtype] = -1; |
119 | op->contr->ns->last_skill_exp[tmp->subtype] = -1; //TODO: this should go |
126 | } |
120 | } |
127 | } |
121 | } |
128 | } |
|
|
129 | } |
122 | } |
130 | |
123 | |
131 | /* This returns the skill pointer of the given name (the |
124 | /* This returns the skill pointer of the given name (the |
132 | * one that accumlates exp, has the level, etc). |
125 | * one that accumlates exp, has the level, etc). |
133 | * |
126 | * |