1 | /* |
1 | /* |
2 | * This file is part of Crossfire TRT, the Roguelike Realtime MORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team |
4 | * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Crossfire TRT is free software: you can redistribute it and/or modify |
8 | * Deliantra is free software: you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation, either version 3 of the License, or |
10 | * the Free Software Foundation, either version 3 of the License, or |
11 | * (at your option) any later version. |
11 | * (at your option) any later version. |
12 | * |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
13 | * This program is distributed in the hope that it will be useful, |
… | |
… | |
16 | * GNU General Public License for more details. |
16 | * GNU General Public License for more details. |
17 | * |
17 | * |
18 | * You should have received a copy of the GNU General Public License |
18 | * You should have received a copy of the GNU General Public License |
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 | * |
20 | * |
21 | * The authors can be reached via e-mail to <crossfire@schmorp.de> |
21 | * The authors can be reached via e-mail to <support@deliantra.net> |
22 | */ |
22 | */ |
23 | |
23 | |
24 | /** |
24 | /** |
25 | * \file |
25 | * \file |
26 | * Client/server logic. |
26 | * Client/server logic. |
… | |
… | |
925 | */ |
925 | */ |
926 | if (op->inv && QUERY_FLAG (op, FLAG_APPLIED)) |
926 | if (op->inv && QUERY_FLAG (op, FLAG_APPLIED)) |
927 | { |
927 | { |
928 | object *current, *next; |
928 | object *current, *next; |
929 | |
929 | |
|
|
930 | int cnt = MAX_ITEM_PER_DROP; |
|
|
931 | |
930 | for (current = op->inv; current != NULL; current = next) |
932 | for (current = op->inv; current != NULL; current = next) |
931 | { |
933 | { |
932 | next = current->below; |
934 | next = current->below; |
933 | drop_object (pl, current, 0); |
935 | drop_object (pl, current, 0); |
|
|
936 | |
|
|
937 | if (--cnt <= 0) break; |
934 | } |
938 | } |
|
|
939 | |
|
|
940 | if (cnt <= 0) |
|
|
941 | pl->failmsg (format ( |
|
|
942 | "Moved only %d items, you can't move more than that at once.", |
|
|
943 | MAX_ITEM_PER_DROP |
|
|
944 | )); |
935 | |
945 | |
936 | esrv_update_item (UPD_WEIGHT, pl, op); |
946 | esrv_update_item (UPD_WEIGHT, pl, op); |
937 | } |
947 | } |
938 | else |
948 | else |
939 | drop_object (pl, op, nrof); |
949 | drop_object (pl, op, nrof); |