summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2015-04-10 17:40:02 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2015-04-10 17:40:02 +0800
commit08cbaa1e87760f9b1efb5e3bf8aad36c3bf67a57 (patch)
tree8c664218befd543821d7f1f5256af8e23f956a8c /src
parent94899de0397d74b0f06bdccdbfc67eabd2d06e38 (diff)
parentdf1bcac8ef95885019adc1ee03cb2ed9c663c0df (diff)
downloadhercules-08cbaa1e87760f9b1efb5e3bf8aad36c3bf67a57.tar.gz
hercules-08cbaa1e87760f9b1efb5e3bf8aad36c3bf67a57.tar.bz2
hercules-08cbaa1e87760f9b1efb5e3bf8aad36c3bf67a57.tar.xz
hercules-08cbaa1e87760f9b1efb5e3bf8aad36c3bf67a57.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules into JobDBRedesign
Diffstat (limited to 'src')
-rw-r--r--src/char/char.c2
-rw-r--r--src/map/pc.c23
2 files changed, 16 insertions, 9 deletions
diff --git a/src/char/char.c b/src/char/char.c
index e43ebbfbc..83bb36a34 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -1206,7 +1206,7 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
SQL->StmtFree(stmt);
return 0;
}
- if( SQL_ERROR == SQL->StmtNextRow(stmt) )
+ if (SQL_SUCCESS != SQL->StmtNextRow(stmt))
{
ShowError("Requested non-existant character id: %d!\n", char_id);
SQL->StmtFree(stmt);
diff --git a/src/map/pc.c b/src/map/pc.c
index dcb02d5b4..6567c2a4f 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))
@@ -9090,6 +9091,9 @@ void pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int pos
/*==========================================
* Equip item on player sd at req_pos from inventory index n
+ * Return:
+ * 0 = fail
+ * 1 = success
*------------------------------------------*/
int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
{
@@ -9221,7 +9225,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
}
sd->npc_item_flag = iflag;
- return 0;
+ return 1;
}
void pc_unequipitem_pos(struct map_session_data *sd, int n, int pos)
@@ -9287,6 +9291,9 @@ void pc_unequipitem_pos(struct map_session_data *sd, int n, int pos)
* 0 - only unequip
* 1 - calculate status after unequipping
* 2 - force unequip
+ * Return:
+ * 0 = fail
+ * 1 = success
*------------------------------------------*/
int pc_unequipitem(struct map_session_data *sd,int n,int flag) {
int i,iflag;
@@ -9412,7 +9419,7 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) {
}
sd->npc_item_flag = iflag;
- return 0;
+ return 1;
}
/*==========================================