summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-07 22:56:06 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-07 22:56:06 +0300
commit4ca6649bec3b632076d66ef7c1a449e63137c333 (patch)
tree5cebc755bf227ab315f5e5931f8640de52497db6 /src/map/pc.c
parente39a129ee298c01638913e518f8fa23fa4bbe855 (diff)
downloadhercules-4ca6649bec3b632076d66ef7c1a449e63137c333.tar.gz
hercules-4ca6649bec3b632076d66ef7c1a449e63137c333.tar.bz2
hercules-4ca6649bec3b632076d66ef7c1a449e63137c333.tar.xz
hercules-4ca6649bec3b632076d66ef7c1a449e63137c333.zip
Done show error message in client if was used item with flag KeepAfterUse.
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index ffc9b77ec..29baf0c84 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4558,14 +4558,15 @@ int pc_useitem(struct map_session_data *sd,int n) {
amount = sd->status.inventory[n].amount;
item_script = sd->inventory_data[n]->script;
//Check if the item is to be consumed immediately [Skotlex]
- if( sd->inventory_data[n]->flag.delay_consume )
+ if (sd->inventory_data[n]->flag.delay_consume || sd->inventory_data[n]->flag.keepafteruse)
clif->useitemack(sd,n,amount,true);
else {
- if (sd->status.inventory[n].expire_time == 0 && !(sd->inventory_data[n]->flag.keepafteruse)) {
- clif->useitemack(sd,n,amount-1,true);
- pc->delitem(sd,n,1,1,0,LOG_TYPE_CONSUME); // Rental Usable Items are not deleted until expiration
- } else
- clif->useitemack(sd,n,0,false);
+ if (sd->status.inventory[n].expire_time == 0) {
+ clif->useitemack(sd, n, amount - 1, true);
+ pc->delitem(sd, n, 1, 1, 0, LOG_TYPE_CONSUME); // Rental Usable Items are not deleted until expiration
+ } else {
+ clif->useitemack(sd, n, 0, false);
+ }
}
if(sd->status.inventory[n].card[0]==CARD0_CREATE &&
pc->famerank(MakeDWord(sd->status.inventory[n].card[2],sd->status.inventory[n].card[3]), MAPID_ALCHEMIST))