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.92 by root, Sat May 12 18:23:51 2007 UTC vs.
Revision 1.95 by root, Mon May 14 19:08:26 2007 UTC

1338 1338
1339 /* Just put in some sanity check. I think there is a bug in the 1339 /* Just put in some sanity check. I think there is a bug in the
1340 * above with some objects have zero speed, and thus the player 1340 * above with some objects have zero speed, and thus the player
1341 * getting permanently paralyzed. 1341 * getting permanently paralyzed.
1342 */ 1342 */
1343 if (victim->speed_left < -50.0) 1343 if (victim->speed_left < -50.f)
1344 victim->speed_left = -50.0; 1344 victim->speed_left = -50.f;
1345 /* LOG(llevDebug, "apply, playermove, player speed_left=%f\n", victim->speed_left); */ 1345 /* LOG(llevDebug, "apply, playermove, player speed_left=%f\n", victim->speed_left); */
1346 } 1346 }
1347 goto leave; 1347 goto leave;
1348 1348
1349 case SPINNER: 1349 case SPINNER:
2634 2634
2635 object *tmp2; 2635 object *tmp2;
2636 2636
2637 CLEAR_FLAG (op, FLAG_APPLIED); 2637 CLEAR_FLAG (op, FLAG_APPLIED);
2638 2638
2639 if (player *pl = who->contr)
2640 {
2641 if (op == pl->ranged_ob) pl->ranged_ob = 0;
2642 if (op == pl->combat_ob) pl->combat_ob = 0;
2643 }
2644
2639 switch (op->type) 2645 switch (op->type)
2640 { 2646 {
2641 case WEAPON: 2647 case WEAPON:
2642 new_draw_info_format (NDI_UNIQUE, 0, who, "You unwield %s.", query_name (op)); 2648 new_draw_info_format (NDI_UNIQUE, 0, who, "You unwield %s.", query_name (op));
2643 2649
2644 change_abil (who, op); 2650 change_abil (who, op);
2645 CLEAR_FLAG (who, FLAG_READY_WEAPON); 2651 CLEAR_FLAG (who, FLAG_READY_WEAPON);
2646
2647 if (who->contr)
2648 {
2649 if (who->contr->combat_ob == op)
2650 who->contr->combat_ob = 0;
2651
2652 if (who->current_weapon == op)
2653 who->current_weapon = 0;
2654 }
2655
2656 clear_skill (who); 2652 clear_skill (who);
2657 break; 2653 break;
2658 2654
2659 case SKILL: /* allows objects to impart skills */ 2655 case SKILL: /* allows objects to impart skills */
2660 case SKILL_TOOL: 2656 case SKILL_TOOL:
3080 return 0; 3076 return 0;
3081 3077
3082 // if the item is combat/ranged, wield the relevant slot first 3078 // if the item is combat/ranged, wield the relevant slot first
3083 // to resolve conflicts. 3079 // to resolve conflicts.
3084 if (player *pl = who->contr) 3080 if (player *pl = who->contr)
3085 switch (op->type) 3081 switch (op->slottype ())
3086 { 3082 {
3087 case WEAPON:
3088 who->change_weapon (pl->combat_ob); 3083 case slot_combat: who->change_weapon (pl->combat_ob); break;
3089 break;
3090
3091 case BOW:
3092 case ROD:
3093 case WAND:
3094 case HORN:
3095 case SKILL_TOOL:
3096 who->change_weapon (pl->ranged_ob); 3084 case slot_ranged: who->change_weapon (pl->ranged_ob); break;
3097 break;
3098
3099 case SKILL:
3100 if (IS_COMBAT_SKILL (op->subtype))
3101 who->change_weapon (pl->combat_ob);
3102 else if (IS_RANGED_SKILL (op->subtype))
3103 who->change_weapon (pl->ranged_ob);
3104 break;
3105 } 3085 }
3106 3086
3107 /* Can't just apply this object. Lets see what not and what to do */ 3087 /* Can't just apply this object. Lets see what not and what to do */
3108 if (int i = can_apply_object (who, op)) 3088 if (int i = can_apply_object (who, op))
3109 { 3089 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines