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

Comparing deliantra/server/socket/item.C (file contents):
Revision 1.65 by root, Tue May 6 16:32:34 2008 UTC vs.
Revision 1.68 by root, Thu May 8 20:03:50 2008 UTC

749 749
750 if (object *op = esrv_get_ob_from_count (pl->ob, tag)) 750 if (object *op = esrv_get_ob_from_count (pl->ob, tag))
751 { 751 {
752 std::string s = op->describe (pl->ob); 752 std::string s = op->describe (pl->ob);
753 753
754 if (msg_is_special (s.c_str (), false))
755 cfperl_expand_cfpod (pl, s);
756
754 packet sl ("ex"); 757 packet sl ("ex");
755 sl << ber32 (tag) << s.c_str (); 758 sl << ber32 (tag) << s.c_str ();
756 759
757 pl->ns->send_packet (sl); 760 pl->ns->send_packet (sl);
758 } 761 }
895 898
896/** Move an object to a new location */ 899/** Move an object to a new location */
897void 900void
898esrv_move_object (object *pl, tag_t to, tag_t tag, long nrof) 901esrv_move_object (object *pl, tag_t to, tag_t tag, long nrof)
899{ 902{
900 object *op, *env;
901
902 op = esrv_get_ob_from_count (pl, tag); 903 object *op = esrv_get_ob_from_count (pl, tag);
903 if (!op) 904 if (!op)
904 { 905 {
905 LOG (llevDebug, "Player '%s' tried to move an unknown object (%ld)\n", &pl->name, tag); 906 LOG (llevDebug, "Player '%s' tried to move an unknown object (%ld)\n", &pl->name, tag);
906 return; 907 return;
907 } 908 }
916 */ 917 */
917 if (op->inv && QUERY_FLAG (op, FLAG_APPLIED)) 918 if (op->inv && QUERY_FLAG (op, FLAG_APPLIED))
918 { 919 {
919 int cnt = MAX_ITEM_PER_DROP; 920 int cnt = MAX_ITEM_PER_DROP;
920 921
921 for (object *current = op->inv; current; ) 922 for (object *current = op->inv; current && cnt--; )
922 { 923 {
923 object *next = current->below; 924 object *next = current->below;
924
925 drop_object (pl, current, 0); 925 drop_object (pl, current, 0);
926
927 if (--cnt <= 0) break;
928
929 current = next; 926 current = next;
930 } 927 }
931 928
932 if (cnt <= 0) 929 if (cnt <= 0)
933 op->failmsg ("Only dropped some items, can't drop that many items at once."); 930 op->failmsg ("Only dropped some items, can't drop that many items at once.");
946 pl->contr->count = nrof; 943 pl->contr->count = nrof;
947 pick_up (pl, op); 944 pick_up (pl, op);
948 return; 945 return;
949 } 946 }
950 947
951 env = esrv_get_ob_from_count (pl, to); 948 object *env = esrv_get_ob_from_count (pl, to);
952 if (!env) 949 if (!env)
953 { 950 {
954 LOG (llevDebug, "Player '%s' tried to move object to the unknown location (%d)\n", &pl->name, to); 951 LOG (llevDebug, "Player '%s' tried to move object to the unknown location (%d)\n", &pl->name, to);
955 return; 952 return;
956 } 953 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines