… | |
… | |
770 | return 0; |
770 | return 0; |
771 | |
771 | |
772 | for (skop = op->inv; skop; skop = skop->below) |
772 | for (skop = op->inv; skop; skop = skop->below) |
773 | { |
773 | { |
774 | if (skop->type == SKILL |
774 | if (skop->type == SKILL |
775 | && QUERY_FLAG (skop, FLAG_CAN_USE_SKILL) |
775 | && skop->flag [FLAG_CAN_USE_SKILL] |
776 | && !strncasecmp (string, skop->skill, min (strlen (string), (size_t) strlen (skop->skill)))) |
776 | && skop->skill.starts_with (string)) |
777 | break; |
777 | break; |
778 | else if (skop->type == SKILL_TOOL |
778 | else if (skop->type == SKILL_TOOL |
779 | && !strncasecmp (string, skop->skill, min (strlen (string), (size_t) strlen (skop->skill)))) |
779 | && skop->skill.starts_with (string) |
|
|
780 | && op->apply (skop)) |
780 | break; |
781 | break; |
781 | } |
782 | } |
782 | |
783 | |
783 | if (!skop) |
784 | if (!skop) |
784 | { |
785 | { |
785 | new_draw_info_format (NDI_UNIQUE, 0, op, "Unable to find skill %s", string); |
786 | op->failmsg (format ("Unable to find skill %s.", string)); |
|
|
787 | return 0; |
|
|
788 | } |
|
|
789 | |
|
|
790 | if (!(skill_flags [skop->subtype] & SF_USE)) |
|
|
791 | { |
|
|
792 | op->failmsg (format ( |
|
|
793 | "You feel as if you wanted to do something funny, but you can't remember what. " |
|
|
794 | "H<The %s skill cannot be used - maybe you need to ready it, use it with some item, or it's always active.>", |
|
|
795 | &skop->skill |
|
|
796 | )); |
786 | return 0; |
797 | return 0; |
787 | } |
798 | } |
788 | |
799 | |
789 | len = strlen (skop->skill); |
800 | len = strlen (skop->skill); |
790 | |
801 | |