… | |
… | |
259 | /* IF the player is flying & trying to take the item out of a container |
259 | /* IF the player is flying & trying to take the item out of a container |
260 | * that is in his inventory, let him. tmp->env points to the container |
260 | * that is in his inventory, let him. tmp->env points to the container |
261 | * (sack, luggage, etc), tmp->env->env then points to the player (nested |
261 | * (sack, luggage, etc), tmp->env->env then points to the player (nested |
262 | * containers not allowed as of now) |
262 | * containers not allowed as of now) |
263 | */ |
263 | */ |
264 | if ((pl->move_type & MOVE_FLYING) && !QUERY_FLAG (pl, FLAG_WIZ) && is_player_inv (tmp) != pl) |
264 | if ((pl->move_type & MOVE_FLYING) && !QUERY_FLAG (pl, FLAG_WIZ) && tmp->in_player () != pl) |
265 | { |
265 | { |
266 | new_draw_info (NDI_UNIQUE, 0, pl, "You are levitating, you can't reach the ground!"); |
266 | new_draw_info (NDI_UNIQUE, 0, pl, "You are levitating, you can't reach the ground!"); |
267 | return; |
267 | return; |
268 | } |
268 | } |
269 | |
269 | |
… | |
… | |
633 | else |
633 | else |
634 | tmp->remove (); |
634 | tmp->remove (); |
635 | |
635 | |
636 | new_draw_info_format (NDI_UNIQUE, 0, op, "You put the %s in %s.", query_name (tmp), query_name (sack)); |
636 | new_draw_info_format (NDI_UNIQUE, 0, op, "You put the %s in %s.", query_name (tmp), query_name (sack)); |
637 | tmp2 = insert_ob_in_ob (tmp, sack); |
637 | tmp2 = insert_ob_in_ob (tmp, sack); |
638 | fix_player (op); /* This is overkill, fix_player() is called somewhere */ |
638 | op->update_stats (); /* This is overkill, fix_player() is called somewhere */ |
639 | /* in object.c */ |
639 | /* in object.c */ |
640 | |
640 | |
641 | /* If an object merged (and thus, different object), we need to |
641 | /* If an object merged (and thus, different object), we need to |
642 | * delete the original. |
642 | * delete the original. |
643 | */ |
643 | */ |
… | |
… | |
707 | |
707 | |
708 | if (op->type == PLAYER) |
708 | if (op->type == PLAYER) |
709 | esrv_del_item (op->contr, tmp->count); |
709 | esrv_del_item (op->contr, tmp->count); |
710 | |
710 | |
711 | tmp->destroy (); |
711 | tmp->destroy (); |
712 | fix_player (op); |
712 | op->update_stats (); |
713 | return; |
713 | return; |
714 | } |
714 | } |
715 | |
715 | |
716 | /* If SAVE_INTERVAL is commented out, we never want to save |
716 | /* If SAVE_INTERVAL is commented out, we never want to save |
717 | * the player here. |
717 | * the player here. |
… | |
… | |
722 | * of what he is dropping? |
722 | * of what he is dropping? |
723 | */ |
723 | */ |
724 | if (op->type == PLAYER && !QUERY_FLAG (tmp, FLAG_UNPAID) && |
724 | if (op->type == PLAYER && !QUERY_FLAG (tmp, FLAG_UNPAID) && |
725 | (tmp->nrof ? tmp->value * tmp->nrof : tmp->value > 2000) && (op->contr->last_save_time + SAVE_INTERVAL) <= time (NULL)) |
725 | (tmp->nrof ? tmp->value * tmp->nrof : tmp->value > 2000) && (op->contr->last_save_time + SAVE_INTERVAL) <= time (NULL)) |
726 | { |
726 | { |
727 | save_player (op, 1); |
727 | op->contr->save (); |
728 | op->contr->last_save_time = time (NULL); |
728 | op->contr->last_save_time = time (NULL); |
729 | } |
729 | } |
730 | #endif /* SAVE_INTERVAL */ |
730 | #endif /* SAVE_INTERVAL */ |
731 | |
731 | |
732 | if (op->type == PLAYER) |
732 | if (op->type == PLAYER) |
733 | esrv_del_item (op->contr, tmp->count); |
733 | esrv_del_item (op->contr, tmp->count); |
734 | |
734 | |
735 | /* Call this before we update the various windows/players. At least |
735 | /* Call this before we update the various windows/players. At least |
736 | * that we, we know the weight is correct. |
736 | * that we, we know the weight is correct. |
737 | */ |
737 | */ |
738 | fix_player (op); /* This is overkill, fix_player() is called somewhere */ |
738 | op->update_stats (); /* This is overkill, fix_player() is called somewhere */ |
739 | /* in object.c */ |
739 | /* in object.c */ |
740 | |
740 | |
741 | if (op->type == PLAYER) |
741 | if (op->type == PLAYER) |
742 | { |
742 | { |
743 | /* Need to update the weight for the player */ |
743 | /* Need to update the weight for the player */ |
744 | esrv_send_item (op, op); |
744 | esrv_send_item (op, op); |
745 | op->contr->socket->floorbox_update (); |
745 | op->contr->ns->floorbox_update (); |
746 | } |
746 | } |
747 | |
747 | |
748 | for (floor = get_map_ob (op->map, op->x, op->y); floor; floor = floor->above) |
748 | for (floor = GET_MAP_OB (op->map, op->x, op->y); floor; floor = floor->above) |
749 | if (INVOKE_OBJECT (DROP_ON, floor, ARG_OBJECT (tmp), ARG_OBJECT (op))) |
749 | if (INVOKE_OBJECT (DROP_ON, floor, ARG_OBJECT (tmp), ARG_OBJECT (op))) |
750 | return; |
750 | return; |
751 | |
751 | |
752 | if (is_in_shop (op) && !QUERY_FLAG (tmp, FLAG_UNPAID) && tmp->type != MONEY) |
752 | if (is_in_shop (op) && !QUERY_FLAG (tmp, FLAG_UNPAID) && tmp->type != MONEY) |
753 | sell_item (tmp, op); |
753 | sell_item (tmp, op); |
… | |
… | |
940 | } |
940 | } |
941 | curinv = nextinv; |
941 | curinv = nextinv; |
942 | } |
942 | } |
943 | } |
943 | } |
944 | |
944 | |
945 | op->contr->socket->floorbox_update (); |
945 | op->contr->ns->floorbox_update (); |
946 | |
946 | |
947 | /* draw_look(op);*/ |
947 | /* draw_look(op);*/ |
948 | return 0; |
948 | return 0; |
949 | } |
949 | } |
950 | |
950 | |
… | |
… | |
980 | new_draw_info (NDI_UNIQUE, 0, op, "Nothing to drop."); |
980 | new_draw_info (NDI_UNIQUE, 0, op, "Nothing to drop."); |
981 | } |
981 | } |
982 | if (op->type == PLAYER) |
982 | if (op->type == PLAYER) |
983 | { |
983 | { |
984 | op->contr->count = 0; |
984 | op->contr->count = 0; |
985 | op->contr->socket->floorbox_update (); |
985 | op->contr->ns->floorbox_update (); |
986 | }; |
986 | }; |
987 | |
987 | |
988 | /* draw_look(op);*/ |
988 | /* draw_look(op);*/ |
989 | return 0; |
989 | return 0; |
990 | } |
990 | } |
… | |
… | |
1561 | new_draw_info (NDI_UNIQUE, 0, op, "items containing the word 'magic+1'."); |
1561 | new_draw_info (NDI_UNIQUE, 0, op, "items containing the word 'magic+1'."); |
1562 | return 1; |
1562 | return 1; |
1563 | } |
1563 | } |
1564 | op->contr->search_str[0] = '\0'; |
1564 | op->contr->search_str[0] = '\0'; |
1565 | new_draw_info (NDI_UNIQUE, 0, op, "Search mode turned off."); |
1565 | new_draw_info (NDI_UNIQUE, 0, op, "Search mode turned off."); |
1566 | fix_player (op); |
1566 | op->update_stats (); |
1567 | return 1; |
1567 | return 1; |
1568 | } |
1568 | } |
1569 | if ((int) strlen (params) >= MAX_BUF) |
1569 | if ((int) strlen (params) >= MAX_BUF) |
1570 | { |
1570 | { |
1571 | new_draw_info (NDI_UNIQUE, 0, op, "Search string too long."); |
1571 | new_draw_info (NDI_UNIQUE, 0, op, "Search string too long."); |
1572 | return 1; |
1572 | return 1; |
1573 | } |
1573 | } |
1574 | strcpy (op->contr->search_str, params); |
1574 | strcpy (op->contr->search_str, params); |
1575 | sprintf (buf, "Searching for '%s'.", op->contr->search_str); |
1575 | sprintf (buf, "Searching for '%s'.", op->contr->search_str); |
1576 | new_draw_info (NDI_UNIQUE, 0, op, buf); |
1576 | new_draw_info (NDI_UNIQUE, 0, op, buf); |
1577 | fix_player (op); |
1577 | op->update_stats (); |
1578 | return 1; |
1578 | return 1; |
1579 | } |
1579 | } |
1580 | |
1580 | |