diff options
author | Haru <haru@dotalux.com> | 2014-08-20 04:55:22 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2014-08-20 04:58:02 +0200 |
commit | 769b1d05aa5cfa8cddfe7d21b35d5c5e4da3bbd6 (patch) | |
tree | 99907d827264e501774e58ab4630e41fa7103c02 /src/map/buyingstore.c | |
parent | b294026e6614a652c23bb0cea8a0d4dc69d8b125 (diff) | |
download | hercules-769b1d05aa5cfa8cddfe7d21b35d5c5e4da3bbd6.tar.gz hercules-769b1d05aa5cfa8cddfe7d21b35d5c5e4da3bbd6.tar.bz2 hercules-769b1d05aa5cfa8cddfe7d21b35d5c5e4da3bbd6.tar.xz hercules-769b1d05aa5cfa8cddfe7d21b35d5c5e4da3bbd6.zip |
Follow-up to b294026e6614a652c23bb0cea8a0d4dc69d8b125
- Added documentation for the pc->search_item function and formalized
its return values. If the searched item is not found, now it returns
the newly introduced constant INDEX_NOT_FOUND.
- Updated pc->search_item checks to make use of INDEX_NOT_FOUND.
- Fixed an issue with anvils not detected by the weapon forginc code,
if they were in the first position of the inventory.
- Added ITEMID constants for the four anvil types.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/buyingstore.c')
-rw-r--r-- | src/map/buyingstore.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c index 80264b30d..626d102a3 100644 --- a/src/map/buyingstore.c +++ b/src/map/buyingstore.c @@ -126,8 +126,9 @@ void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha break; } - if( !id->flag.buyingstore || !itemdb->cantrade_sub(id, pc_get_group_level(sd), pc_get_group_level(sd)) || ( idx = pc->search_inventory(sd, nameid) ) == -1 ) - {// restrictions: allowed, no character-bound items and at least one must be owned + if (!id->flag.buyingstore || !itemdb->cantrade_sub(id, pc_get_group_level(sd), pc_get_group_level(sd)) + || (idx = pc->search_inventory(sd, nameid)) == INDEX_NOT_FOUND + ) { // restrictions: allowed, no character-bound items and at least one must be owned break; } |