diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-07-02 18:39:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-07-02 18:54:59 +0300 |
commit | eccc5b95809428347fc18099f21680a531b9cf85 (patch) | |
tree | 8a69571dae94cbf82faf76e5e55ca82717b84ab3 /src/map | |
parent | ad92652c76fbfea5a439a35c881c61d63a1d2bd8 (diff) | |
download | hercules-eccc5b95809428347fc18099f21680a531b9cf85.tar.gz hercules-eccc5b95809428347fc18099f21680a531b9cf85.tar.bz2 hercules-eccc5b95809428347fc18099f21680a531b9cf85.tar.xz hercules-eccc5b95809428347fc18099f21680a531b9cf85.zip |
Fix wrong item deletion in guild creation code if emperium item not in inventory.
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/guild.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/map/guild.c b/src/map/guild.c index 1929808ca..ae3887aca 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -399,8 +399,11 @@ int guild_created(int account_id,int guild_id) { //struct guild *g; sd->status.guild_id=guild_id; clif->guild_created(sd,0); // Success - if(battle_config.guild_emperium_check) - pc->delitem(sd, pc->search_inventory(sd, ITEMID_EMPERIUM), 1, 0, DELITEM_NORMAL, LOG_TYPE_CONSUME); //emperium consumption + if (battle_config.guild_emperium_check) { + int n = pc->search_inventory(sd, ITEMID_EMPERIUM); + if (n != INDEX_NOT_FOUND) + pc->delitem(sd, n, 1, 0, DELITEM_NORMAL, LOG_TYPE_CONSUME); //emperium consumption + } return 0; } |