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.45 by root, Sat May 12 22:04:20 2007 UTC vs.
Revision 1.46 by root, Sun May 13 15:13:57 2007 UTC

243change_skill (object *who, object *new_skill, int flag) 243change_skill (object *who, object *new_skill, int flag)
244{ 244{
245 if (who->type != PLAYER) 245 if (who->type != PLAYER)
246 return 0; 246 return 0;
247 247
248#if 0
248 // optimise this supposedly common case 249 // optimise this supposedly common case
249 if (new_skill == who->chosen_skill) 250 if (new_skill == who->chosen_skill)
250 return 1; 251 return 1;
251 252#endif
252 if (who->chosen_skill)
253 {
254 apply_special (who, who->chosen_skill, AP_UNAPPLY);
255 who->chosen_skill = 0;//D verify wether necessary
256 }
257 253
258 if (!new_skill) 254 if (!new_skill)
259 { 255 {
260 LOG (llevError | logBacktrace, "change_skill called on %s with NULL skill\n", 256 LOG (llevError | logBacktrace, "change_skill called on %s with NULL skill\n",
261 who->debug_desc ()); 257 who->debug_desc ());
262 return 0; 258 return 0;
263 } 259 }
264 260
261 // the skill could be readied already because it is used by a weapon.
262 who->change_weapon (0);
265 new_skill->inv_splay (); 263 new_skill->inv_splay ();
266 264
267 if (apply_special (who, new_skill, AP_APPLY)) 265 if (apply_special (who, new_skill, AP_APPLY))
268 return 0; 266 return 0;
269 267

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines