1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992 Frank Tore Johansen |
6 | * Copyright (©) 1992 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * the terms of the Affero GNU General Public License as published by the |
9 | * the terms of the Affero GNU General Public License as published by the |
… | |
… | |
503 | |
503 | |
504 | return 0; |
504 | return 0; |
505 | } |
505 | } |
506 | |
506 | |
507 | /* |
507 | /* |
508 | * This function was part of drop, now is own function. |
508 | * This function was part of drop, now is own function. |
509 | * Player 'op' tries to put object 'tmp' into sack 'sack', |
509 | * Player 'op' tries to put object 'tmp' into sack 'sack', |
510 | * if nrof is non zero, then nrof objects is tried to put into sack. |
510 | * if nrof is non zero, then nrof objects is tried to put into sack. |
511 | * |
511 | * |
512 | * Note that the 'sack' in question can now be a transport, |
512 | * Note that the 'sack' in question can now be a transport, |
513 | * so this function isn't named very good anymore. |
513 | * so this function isn't named very good anymore. |
514 | */ |
514 | */ |
515 | void |
515 | void |
… | |
… | |
608 | if (obj->destroyed () || obj->is_inserted ()) |
608 | if (obj->destroyed () || obj->is_inserted ()) |
609 | return; |
609 | return; |
610 | |
610 | |
611 | if (dropper->is_in_shop () && !obj->flag [FLAG_UNPAID] && obj->type != MONEY) |
611 | if (dropper->is_in_shop () && !obj->flag [FLAG_UNPAID] && obj->type != MONEY) |
612 | if (!sell_item (obj, dropper)) |
612 | if (!sell_item (obj, dropper)) |
613 | return; |
613 | return; |
614 | |
614 | |
615 | if (!obj->can_drop_at (dropper->map, dropper->x, dropper->y, dropper)) |
615 | if (!obj->can_drop_at (dropper->map, dropper->x, dropper->y, dropper)) |
616 | return; |
616 | return; |
617 | |
617 | |
618 | /* If nothing special happened with this object, the default action is to |
618 | /* If nothing special happened with this object, the default action is to |
… | |
… | |
737 | } |
737 | } |
738 | |
738 | |
739 | object *curinv = op->inv; |
739 | object *curinv = op->inv; |
740 | object *nextinv; |
740 | object *nextinv; |
741 | |
741 | |
742 | /* |
742 | /* |
743 | This is the default. Drops everything not locked or considered |
743 | This is the default. Drops everything not locked or considered |
744 | not something that should be dropped. |
744 | not something that should be dropped. |
745 | */ |
745 | */ |
746 | /* |
746 | /* |
747 | Care must be taken that the next item pointer is not to money as |
747 | Care must be taken that the next item pointer is not to money as |