… | |
… | |
895 | |
895 | |
896 | /** Move an object to a new location */ |
896 | /** Move an object to a new location */ |
897 | void |
897 | void |
898 | esrv_move_object (object *pl, tag_t to, tag_t tag, long nrof) |
898 | esrv_move_object (object *pl, tag_t to, tag_t tag, long nrof) |
899 | { |
899 | { |
900 | object *op, *env; |
|
|
901 | |
|
|
902 | op = esrv_get_ob_from_count (pl, tag); |
900 | object *op = esrv_get_ob_from_count (pl, tag); |
903 | if (!op) |
901 | if (!op) |
904 | { |
902 | { |
905 | LOG (llevDebug, "Player '%s' tried to move an unknown object (%ld)\n", &pl->name, tag); |
903 | LOG (llevDebug, "Player '%s' tried to move an unknown object (%ld)\n", &pl->name, tag); |
906 | return; |
904 | return; |
907 | } |
905 | } |
… | |
… | |
916 | */ |
914 | */ |
917 | if (op->inv && QUERY_FLAG (op, FLAG_APPLIED)) |
915 | if (op->inv && QUERY_FLAG (op, FLAG_APPLIED)) |
918 | { |
916 | { |
919 | int cnt = MAX_ITEM_PER_DROP; |
917 | int cnt = MAX_ITEM_PER_DROP; |
920 | |
918 | |
921 | for (object *current = op->inv; current; ) |
919 | for (object *current = op->inv; current && cnt--; ) |
922 | { |
920 | { |
923 | object *next = current->below; |
921 | object *next = current->below; |
924 | |
|
|
925 | drop_object (pl, current, 0); |
922 | drop_object (pl, current, 0); |
926 | |
|
|
927 | if (--cnt <= 0) break; |
|
|
928 | |
|
|
929 | current = next; |
923 | current = next; |
930 | } |
924 | } |
931 | |
925 | |
932 | if (cnt <= 0) |
926 | if (cnt <= 0) |
933 | op->failmsg ("Only dropped some items, can't drop that many items at once."); |
927 | op->failmsg ("Only dropped some items, can't drop that many items at once."); |