… | |
… | |
132 | for (object *tmp = who->inv; tmp; tmp = tmp->below) |
132 | for (object *tmp = who->inv; tmp; tmp = tmp->below) |
133 | if (tmp->skill == sh) |
133 | if (tmp->skill == sh) |
134 | { |
134 | { |
135 | if (tmp->type == SKILL && (tmp->flag [FLAG_CAN_USE_SKILL] || tmp->flag [FLAG_APPLIED])) |
135 | if (tmp->type == SKILL && (tmp->flag [FLAG_CAN_USE_SKILL] || tmp->flag [FLAG_APPLIED])) |
136 | /* If this is a skill that can be used without applying tool, return it */ |
136 | /* If this is a skill that can be used without applying tool, return it */ |
137 | return tmp->inv_splay (); |
137 | return splay (tmp); |
138 | /* Try to find appropriate skilltool. If the player has one already |
138 | /* Try to find appropriate skilltool. If the player has one already |
139 | * applied, we try to keep using that one. |
139 | * applied, we try to keep using that one. |
140 | */ |
140 | */ |
141 | else if (tmp->type == SKILL_TOOL && !skill_tool) |
141 | else if (tmp->type == SKILL_TOOL && !skill_tool) |
142 | skill_tool = tmp; |
142 | skill_tool = tmp; |
… | |
… | |
155 | { |
155 | { |
156 | skill = give_skill_by_name (who, skill_tool->skill); |
156 | skill = give_skill_by_name (who, skill_tool->skill); |
157 | link_player_skills (who); |
157 | link_player_skills (who); |
158 | } |
158 | } |
159 | |
159 | |
160 | skill->inv_splay (); |
|
|
161 | |
|
|
162 | if (!skill_tool->flag [FLAG_APPLIED]) |
160 | if (!skill_tool->flag [FLAG_APPLIED]) |
163 | if (apply_special (who, skill_tool, AP_APPLY | AP_NO_READY)) |
161 | if (apply_special (who, splay (skill_tool), AP_APPLY | AP_NO_READY)) |
164 | return 0; |
162 | return 0; |
165 | |
163 | |
166 | return skill; |
164 | return splay (skill); |
167 | } |
165 | } |
168 | |
166 | |
169 | object * |
167 | object * |
170 | find_skill_by_name (object *who, const char *name) |
168 | find_skill_by_name (object *who, const char *name) |
171 | { |
169 | { |
… | |
… | |
226 | |
224 | |
227 | if (chosen_skill) |
225 | if (chosen_skill) |
228 | { |
226 | { |
229 | chosen_skill->flag [FLAG_APPLIED] = true; |
227 | chosen_skill->flag [FLAG_APPLIED] = true; |
230 | change_abil (this, chosen_skill); |
228 | change_abil (this, chosen_skill); |
231 | chosen_skill->inv_splay (); |
|
|
232 | } |
229 | } |
233 | |
230 | |
234 | // always clear current weapon, as the selected skill could |
231 | // always clear current weapon, as the selected skill could |
235 | // conflict with the current weapon skill, which would go |
232 | // conflict with the current weapon skill, which would go |
236 | // undetected and exp would be given to the wrong skill. |
233 | // undetected and exp would be given to the wrong skill. |