… | |
… | |
3512 | case SKILL: |
3512 | case SKILL: |
3513 | if (player *pl = who->contr) |
3513 | if (player *pl = who->contr) |
3514 | { |
3514 | { |
3515 | if (IS_COMBAT_SKILL (op->subtype)) |
3515 | if (IS_COMBAT_SKILL (op->subtype)) |
3516 | { |
3516 | { |
3517 | if (skill_flags [op->subtype] & SF_NEED_WEAPON) |
3517 | if (skill_flags [op->subtype] & SF_NEED_ITEM) |
3518 | { |
3518 | { |
3519 | for (object *item = who->inv; item; item = item->below) |
3519 | for (object *item = who->inv; item; item = item->below) |
3520 | if (item->type == WEAPON && item->flag [FLAG_APPLIED]) |
3520 | if (item->type == item->weapontype && item->flag [FLAG_APPLIED]) |
3521 | { |
3521 | { |
3522 | if (item->skill == op->skill) |
3522 | if (item->skill == op->skill) |
3523 | { |
3523 | { |
3524 | who->change_weapon (pl->combat_ob = item); |
3524 | who->change_weapon (pl->combat_ob = item); |
3525 | goto found_weapon; |
3525 | goto found_weapon; |
… | |
… | |
3538 | else |
3538 | else |
3539 | who->change_weapon (pl->combat_ob = op); |
3539 | who->change_weapon (pl->combat_ob = op); |
3540 | } |
3540 | } |
3541 | else if (IS_RANGED_SKILL (op->subtype)) |
3541 | else if (IS_RANGED_SKILL (op->subtype)) |
3542 | { |
3542 | { |
3543 | if (skill_flags [op->subtype] & SF_NEED_BOW) |
3543 | if (skill_flags [op->subtype] & SF_NEED_ITEM) |
3544 | { |
3544 | { |
3545 | for (object *item = who->inv; item; item = item->below) |
3545 | for (object *item = who->inv; item; item = item->below) |
3546 | if (item->type == BOW && item->flag [FLAG_APPLIED]) |
3546 | if (item->type == item->weapontype && item->flag [FLAG_APPLIED]) |
3547 | { |
3547 | { |
3548 | //TODO: bows should/must all have skill missile weapon right now |
3548 | //TODO: bows should/must all have skill missile weapon right now |
3549 | who->change_weapon (pl->ranged_ob = item); |
3549 | who->change_weapon (pl->ranged_ob = item); |
3550 | goto found_bow; |
3550 | goto found_bow; |
3551 | } |
3551 | } |