… | |
… | |
482 | chosen_skill = !ob || ob->type == SKILL ? ob : find_skill_by_name (this, ob->skill); |
482 | chosen_skill = !ob || ob->type == SKILL ? ob : find_skill_by_name (this, ob->skill); |
483 | |
483 | |
484 | if (chosen_skill) |
484 | if (chosen_skill) |
485 | chosen_skill->flag [FLAG_APPLIED] = true; |
485 | chosen_skill->flag [FLAG_APPLIED] = true; |
486 | |
486 | |
487 | if (ob && !ob->flag [FLAG_APPLIED]) |
|
|
488 | { |
|
|
489 | LOG (llevError | logBacktrace, "%s changed to unapplied weapon %s", |
|
|
490 | &name, ob->debug_desc ()); |
|
|
491 | return false; |
|
|
492 | } |
|
|
493 | |
|
|
494 | update_stats (); |
487 | update_stats (); |
495 | |
488 | |
496 | if (ob) |
489 | if (ob) |
497 | { |
490 | { |
498 | // now check wether any body locations became invalid, in which case |
491 | // now check wether any body locations became invalid, in which case |
… | |
… | |
511 | |
504 | |
512 | //new_draw_info_format (NDI_UNIQUE, 0, this, "You switch to your %s.", &ob->name); |
505 | //new_draw_info_format (NDI_UNIQUE, 0, this, "You switch to your %s.", &ob->name); |
513 | } |
506 | } |
514 | else |
507 | else |
515 | ;//new_draw_info_format (NDI_UNIQUE, 0, this, "You unwield your weapons."); |
508 | ;//new_draw_info_format (NDI_UNIQUE, 0, this, "You unwield your weapons."); |
|
|
509 | |
|
|
510 | if (ob && !ob->flag [FLAG_APPLIED] && ob->type != SPELL) |
|
|
511 | { |
|
|
512 | LOG (llevError | logBacktrace, "%s changed to unapplied weapon %s", |
|
|
513 | &name, ob->debug_desc ()); |
|
|
514 | return false; |
|
|
515 | } |
516 | |
516 | |
517 | return true; |
517 | return true; |
518 | } |
518 | } |
519 | |
519 | |
520 | /* Zero the key_values on op, decrementing the shared-string |
520 | /* Zero the key_values on op, decrementing the shared-string |