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

Comparing deliantra/server/server/player.C (file contents):
Revision 1.184 by root, Sun Apr 20 23:25:09 2008 UTC vs.
Revision 1.187 by root, Mon Apr 21 07:07:36 2008 UTC

1603 arrow->destroy (); 1603 arrow->destroy ();
1604 return 0; 1604 return 0;
1605 } 1605 }
1606 1606
1607 left = arrow; /* these are arrows left to the player */ 1607 left = arrow; /* these are arrows left to the player */
1608 arrow = get_split_ob (arrow, 1); 1608 arrow = arrow->split ();
1609 if (!arrow) 1609 if (!arrow)
1610 { 1610 {
1611 new_draw_info_format (NDI_UNIQUE, 0, op, "You have no %s left.", &bow->race); 1611 new_draw_info_format (NDI_UNIQUE, 0, op, "You have no %s left.", &bow->race);
1612 return 0; 1612 return 0;
1613 } 1613 }
1680 op->play_sound (sound_find ("fire_arrow")); 1680 op->play_sound (sound_find ("fire_arrow"));
1681 m->insert (arrow, sx, sy, op); 1681 m->insert (arrow, sx, sy, op);
1682 1682
1683 if (!arrow->destroyed ()) 1683 if (!arrow->destroyed ())
1684 move_arrow (arrow); 1684 move_arrow (arrow);
1685
1686 if (op->type == PLAYER)
1687 {
1688 if (left->destroyed ())
1689 esrv_del_item (op->contr, left->count);
1690 else
1691 esrv_send_item (op, left);
1692 }
1693 1685
1694 return 1; 1686 return 1;
1695} 1687}
1696 1688
1697/* Special fire code for players - this takes into 1689/* Special fire code for players - this takes into
1987 op->statusmsg (format ("You open the door with the %s", query_short_name (key)), NDI_BROWN); 1979 op->statusmsg (format ("You open the door with the %s", query_short_name (key)), NDI_BROWN);
1988 remove_door2 (door); /* remove door without violence ;-) */ 1980 remove_door2 (door); /* remove door without violence ;-) */
1989 } 1981 }
1990 1982
1991 /* Do this after we print the message */ 1983 /* Do this after we print the message */
1992 decrease_ob (key); /* Use up one of the keys */ 1984 key->decrease (); /* Use up one of the keys */
1993 /* Need to update the weight the container the key was in */ 1985 /* Need to update the weight the container the key was in */
1994 if (container != op) 1986 if (container != op)
1995 esrv_update_item (UPD_WEIGHT, op, container); 1987 esrv_update_item (UPD_WEIGHT, op, container);
1996 1988
1997 return 1; /* Nothing more to do below */ 1989 return 1; /* Nothing more to do below */
2934 2926
2935 if (!QUERY_FLAG (tmp, FLAG_UNIQUE) && (QUERY_FLAG (tmp, FLAG_STARTEQUIP) || QUERY_FLAG (tmp, FLAG_NO_DROP) || !(rndm (3)))) 2927 if (!QUERY_FLAG (tmp, FLAG_UNIQUE) && (QUERY_FLAG (tmp, FLAG_STARTEQUIP) || QUERY_FLAG (tmp, FLAG_NO_DROP) || !(rndm (3))))
2936 { 2928 {
2937 if (tmp->nrof > 1) 2929 if (tmp->nrof > 1)
2938 { 2930 {
2939 tmp2 = get_split_ob (tmp, 1 + RANDOM () % (tmp->nrof - 1)); 2931 tmp->decrease (rndm (1, tmp->nrof - 1));
2940 tmp2->destroy ();
2941 insert_ob_in_map (tmp, op->map, NULL, 0); 2932 insert_ob_in_map (tmp, op->map, NULL, 0);
2942 } 2933 }
2943 else 2934 else
2944 tmp->destroy (); 2935 tmp->destroy ();
2945 } 2936 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines