summaryrefslogtreecommitdiff
path: root/src/map/trade.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-01-23 19:35:01 +0100
committerHaru <haru@dotalux.com>2015-06-01 10:11:40 +0200
commitad958235cfc56b86da89bdc2aa1e5155b0c006a1 (patch)
tree8b5d66a4620d28edeeefae1aec67881b98ac0530 /src/map/trade.c
parent42e1df9e61f8efb6340ed1c9238cd247d553d9b8 (diff)
downloadhercules-ad958235cfc56b86da89bdc2aa1e5155b0c006a1.tar.gz
hercules-ad958235cfc56b86da89bdc2aa1e5155b0c006a1.tar.bz2
hercules-ad958235cfc56b86da89bdc2aa1e5155b0c006a1.tar.xz
hercules-ad958235cfc56b86da89bdc2aa1e5155b0c006a1.zip
Replaced some of the hardcoded values with constants (map)
- Replaced several hardcoded values with the appropriate enums. - Added documentation for some hardcoded values that haven't been replaced by enums (yet) - Minor code legibility improvements. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/trade.c')
-rw-r--r--src/map/trade.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/trade.c b/src/map/trade.c
index 72e64e45d..a17938779 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -145,8 +145,8 @@ void trade_tradeack(struct map_session_data *sd, int type) {
}
//Check if you can start trade.
- if (sd->npc_id || sd->state.vending || sd->state.buyingstore || sd->state.storage_flag
- || tsd->npc_id || tsd->state.vending || tsd->state.buyingstore || tsd->state.storage_flag
+ if (sd->npc_id || sd->state.vending || sd->state.buyingstore || sd->state.storage_flag != STORAGE_FLAG_CLOSED
+ || tsd->npc_id || tsd->state.vending || tsd->state.buyingstore || tsd->state.storage_flag != STORAGE_FLAG_CLOSED
) {
//Fail
clif->tradestart(sd, 2);
@@ -561,7 +561,7 @@ void trade_tradecommit(struct map_session_data *sd) {
flag = pc->additem(tsd, &sd->status.inventory[n], sd->deal.item[trade_i].amount,LOG_TYPE_TRADE);
if (flag == 0)
- pc->delitem(sd, n, sd->deal.item[trade_i].amount, 1, 6, LOG_TYPE_TRADE);
+ pc->delitem(sd, n, sd->deal.item[trade_i].amount, 1, DELITEM_SOLD, LOG_TYPE_TRADE);
else
clif->additem(sd, n, sd->deal.item[trade_i].amount, 0);
sd->deal.item[trade_i].index = 0;
@@ -573,7 +573,7 @@ void trade_tradecommit(struct map_session_data *sd) {
flag = pc->additem(sd, &tsd->status.inventory[n], tsd->deal.item[trade_i].amount,LOG_TYPE_TRADE);
if (flag == 0)
- pc->delitem(tsd, n, tsd->deal.item[trade_i].amount, 1, 6, LOG_TYPE_TRADE);
+ pc->delitem(tsd, n, tsd->deal.item[trade_i].amount, 1, DELITEM_SOLD, LOG_TYPE_TRADE);
else
clif->additem(tsd, n, tsd->deal.item[trade_i].amount, 0);
tsd->deal.item[trade_i].index = 0;