ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/apply.C
(Generate patch)

Comparing deliantra/server/server/apply.C (file contents):
Revision 1.104 by root, Fri May 18 12:13:03 2007 UTC vs.
Revision 1.105 by root, Fri May 18 12:50:42 2007 UTC

2617 || INVOKE_OBJECT (UNREADY, who, ARG_OBJECT (op), ARG_INT (aflags))) 2617 || INVOKE_OBJECT (UNREADY, who, ARG_OBJECT (op), ARG_INT (aflags)))
2618 return RESULT_INT (0); 2618 return RESULT_INT (0);
2619 2619
2620 CLEAR_FLAG (op, FLAG_APPLIED); 2620 CLEAR_FLAG (op, FLAG_APPLIED);
2621 2621
2622 if (player *pl = who->contr)
2623 {
2624 if (op == pl->ranged_ob) pl->ranged_ob = 0;
2625 if (op == pl->combat_ob) pl->combat_ob = 0;
2626
2627 if (op == who->current_weapon)
2628 who->change_weapon (pl->combat_ob ? pl->combat_ob : pl->ranged_ob);
2629 }
2630 else if (op == who->current_weapon)
2631 who->change_weapon (0);
2632
2633 switch (op->type) 2622 switch (op->type)
2634 { 2623 {
2635 case SKILL_TOOL: 2624 case SKILL_TOOL:
2636 // unapplying a skill tool should also unapply the skill it governs 2625 // unapplying a skill tool should also unapply the skill it governs
2637 // but this is hard, as it shouldn't do so when the skill can 2626 // but this is hard, as it shouldn't do so when the skill can
2645 2634
2646 change_abil (who, op); 2635 change_abil (who, op);
2647 break; 2636 break;
2648 2637
2649 case WEAPON: 2638 case WEAPON:
2639 if (player *pl = who->contr)
2640 if (op == pl->combat_ob)
2641 {
2642 pl->combat_ob = 0;
2643 who->change_weapon (pl->ranged_ob);
2644 }
2645
2650 new_draw_info_format (NDI_UNIQUE, 0, who, "You unwield %s.", query_name (op)); 2646 new_draw_info_format (NDI_UNIQUE, 0, who, "You unwield %s.", query_name (op));
2651 2647
2652 change_abil (who, op); 2648 change_abil (who, op);
2653 CLEAR_FLAG (who, FLAG_READY_WEAPON); 2649 CLEAR_FLAG (who, FLAG_READY_WEAPON);
2654 break; 2650 break;
2720 2716
2721 case BOW: 2717 case BOW:
2722 case WAND: 2718 case WAND:
2723 case ROD: 2719 case ROD:
2724 case HORN: 2720 case HORN:
2725 if (who->contr) 2721 if (player *pl = who->contr)
2722 {
2723 if (op == pl->ranged_ob)
2724 {
2725 pl->ranged_ob = 0;
2726 who->change_weapon (pl->combat_ob);
2727 }
2728
2726 new_draw_info_format (NDI_UNIQUE, 0, who, "You unready %s.", query_name (op)); 2729 new_draw_info_format (NDI_UNIQUE, 0, who, "You unready %s.", query_name (op));
2730 }
2727 else 2731 else
2728 { 2732 {
2729 who->change_skill (0); 2733 who->change_skill (0);
2730 2734
2731 if (op->type == BOW) 2735 if (op->type == BOW)
3150 switch (op->type) 3154 switch (op->type)
3151 { 3155 {
3152 case WEAPON: 3156 case WEAPON:
3153 if (!check_weapon_power (who, op->last_eat)) 3157 if (!check_weapon_power (who, op->last_eat))
3154 { 3158 {
3155 new_draw_info (NDI_UNIQUE, 0, who, "This weapon is too powerful for you to use.\n" 3159 new_draw_info (NDI_UNIQUE, 0, who, "This weapon is too powerful for you to use. "
3156 "It would consume your soul!."); 3160 "It would consume your soul!.");
3157 3161
3158 if (tmp) 3162 if (tmp)
3159 insert_ob_in_ob (tmp, who); 3163 insert_ob_in_ob (tmp, who);
3160 3164

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines