… | |
… | |
736 | fix_player (op); /* This is overkill, fix_player() is called somewhere */ |
736 | fix_player (op); /* This is overkill, fix_player() is called somewhere */ |
737 | /* in object.c */ |
737 | /* in object.c */ |
738 | |
738 | |
739 | if (op->type == PLAYER) |
739 | if (op->type == PLAYER) |
740 | { |
740 | { |
741 | op->contr->socket.update_look = 1; |
741 | op->contr->socket->update_look = 1; |
742 | /* Need to update the weight for the player */ |
742 | /* Need to update the weight for the player */ |
743 | esrv_send_item (op, op); |
743 | esrv_send_item (op, op); |
744 | } |
744 | } |
745 | |
745 | |
746 | for (floor = get_map_ob (op->map, op->x, op->y); floor; floor = floor->above) |
746 | for (floor = get_map_ob (op->map, op->x, op->y); floor; floor = floor->above) |
… | |
… | |
800 | new_draw_info (NDI_UNIQUE, 0, op, "This item can't be dropped."); |
800 | new_draw_info (NDI_UNIQUE, 0, op, "This item can't be dropped."); |
801 | #endif |
801 | #endif |
802 | return; |
802 | return; |
803 | } |
803 | } |
804 | |
804 | |
805 | if (op->type == PLAYER) |
805 | if (op->type == PLAYER && op->contr->last_used == tmp) |
806 | { |
806 | op->contr->last_used = tmp->below ? tmp->below |
807 | if (op->contr->last_used == tmp && op->contr->last_used_id == tmp->count) |
807 | : tmp->above ? tmp->above |
808 | { |
808 | : 0; |
809 | object *n = NULL; |
|
|
810 | |
|
|
811 | if (tmp->below != NULL) |
|
|
812 | n = tmp->below; |
|
|
813 | else if (tmp->above != NULL) |
|
|
814 | n = tmp->above; |
|
|
815 | op->contr->last_used = n; |
|
|
816 | if (n != NULL) |
|
|
817 | op->contr->last_used_id = n->count; |
|
|
818 | else |
|
|
819 | op->contr->last_used_id = 0; |
|
|
820 | } |
|
|
821 | }; |
|
|
822 | |
809 | |
823 | if (op->container) |
810 | if (op->container) |
824 | { |
811 | { |
825 | if (op->type == PLAYER) |
812 | if (op->type == PLAYER) |
826 | { |
|
|
827 | put_object_in_sack (op, op->container, tmp, op->contr->count); |
813 | put_object_in_sack (op, op->container, tmp, op->contr->count); |
828 | } |
|
|
829 | else |
814 | else |
830 | { |
|
|
831 | put_object_in_sack (op, op->container, tmp, 0); |
815 | put_object_in_sack (op, op->container, tmp, 0); |
832 | }; |
|
|
833 | } |
816 | } |
834 | else |
817 | else |
835 | { |
818 | { |
836 | if (op->type == PLAYER) |
819 | if (op->type == PLAYER) |
837 | { |
|
|
838 | drop_object (op, tmp, op->contr->count); |
820 | drop_object (op, tmp, op->contr->count); |
839 | } |
|
|
840 | else |
821 | else |
841 | { |
|
|
842 | drop_object (op, tmp, 0); |
822 | drop_object (op, tmp, 0); |
843 | }; |
|
|
844 | } |
823 | } |
|
|
824 | |
845 | if (op->type == PLAYER) |
825 | if (op->type == PLAYER) |
846 | op->contr->count = 0; |
826 | op->contr->count = 0; |
847 | } |
827 | } |
848 | |
828 | |
849 | |
829 | |
… | |
… | |
957 | } |
937 | } |
958 | } |
938 | } |
959 | curinv = nextinv; |
939 | curinv = nextinv; |
960 | } |
940 | } |
961 | } |
941 | } |
962 | op->contr->socket.update_look = 1; |
942 | op->contr->socket->update_look = 1; |
963 | |
943 | |
964 | /* draw_look(op);*/ |
944 | /* draw_look(op);*/ |
965 | return 0; |
945 | return 0; |
966 | } |
946 | } |
967 | |
947 | |
… | |
… | |
997 | new_draw_info (NDI_UNIQUE, 0, op, "Nothing to drop."); |
977 | new_draw_info (NDI_UNIQUE, 0, op, "Nothing to drop."); |
998 | } |
978 | } |
999 | if (op->type == PLAYER) |
979 | if (op->type == PLAYER) |
1000 | { |
980 | { |
1001 | op->contr->count = 0; |
981 | op->contr->count = 0; |
1002 | op->contr->socket.update_look = 1; |
982 | op->contr->socket->update_look = 1; |
1003 | }; |
983 | }; |
1004 | |
984 | |
1005 | /* draw_look(op);*/ |
985 | /* draw_look(op);*/ |
1006 | return 0; |
986 | return 0; |
1007 | } |
987 | } |