summaryrefslogtreecommitdiff
path: root/src/map/trade.c
diff options
context:
space:
mode:
authoramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-04-04 19:32:34 +0000
committeramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-04-04 19:32:34 +0000
commit6acbd82fb5b77315853f42a9a31b7439a7e58bb9 (patch)
tree343173d795a6a7acfe990a8c0fe91b9fa3492296 /src/map/trade.c
parent26bf6b6dacd8029a1ed48255518a78dfb11b4ce4 (diff)
downloadhercules-6acbd82fb5b77315853f42a9a31b7439a7e58bb9.tar.gz
hercules-6acbd82fb5b77315853f42a9a31b7439a7e58bb9.tar.bz2
hercules-6acbd82fb5b77315853f42a9a31b7439a7e58bb9.tar.xz
hercules-6acbd82fb5b77315853f42a9a31b7439a7e58bb9.zip
Fixes for logging trades [MouseJstr]
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1407 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/trade.c')
-rw-r--r--src/map/trade.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/map/trade.c b/src/map/trade.c
index d98eed2a0..eb1d45ba2 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -16,6 +16,7 @@
#include "storage.h"
#include "intif.h"
#include "atcommand.h"
+#include "log.h"
/*==========================================
* 取引要請を相手に送る
@@ -33,15 +34,15 @@ void trade_traderequest(struct map_session_data *sd, int target_id) {
return;
}
}
- if(pc_isGM(sd) && pc_isGM(sd) < battle_config.gm_can_drop_lv) {
+ if(pc_isGM(sd) && pc_isGM(target_sd) < battle_config.gm_can_drop_lv) {
clif_displaymessage(sd->fd, msg_txt(246));
trade_tradecancel(sd); // GM is not allowed to trade
} else if ((target_sd->trade_partner != 0) || (sd->trade_partner != 0)) {
trade_tradecancel(sd); // person is in another trade
} else {
- if (sd->bl.m != target_sd->bl.m ||
+ if (!pc_isGM(sd) && (sd->bl.m != target_sd->bl.m ||
(sd->bl.x - target_sd->bl.x <= -5 || sd->bl.x - target_sd->bl.x >= 5) ||
- (sd->bl.y - target_sd->bl.y <= -5 || sd->bl.y - target_sd->bl.y >= 5)) {
+ (sd->bl.y - target_sd->bl.y <= -5 || sd->bl.y - target_sd->bl.y >= 5))) {
clif_tradestart(sd, 0); // too far
} else if (sd != target_sd) {
target_sd->trade_partner = sd->status.account_id;
@@ -328,6 +329,7 @@ void trade_tradecommit(struct map_session_data *sd) {
if (sd->status.inventory[n].amount < sd->deal_item_amount[trade_i])
sd->deal_item_amount[trade_i] = sd->status.inventory[n].amount;
+ log_trade(sd, target_sd, n, sd->deal_item_amount[trade_i]);
flag = pc_additem(target_sd, &sd->status.inventory[n], sd->deal_item_amount[trade_i]);
if (flag == 0)
@@ -336,6 +338,7 @@ void trade_tradecommit(struct map_session_data *sd) {
clif_additem(sd, n, sd->deal_item_amount[trade_i], 0);
sd->deal_item_index[trade_i] = 0;
sd->deal_item_amount[trade_i] = 0;
+
}
if (target_sd->deal_item_amount[trade_i] != 0) {
int n = target_sd->deal_item_index[trade_i] - 2;
@@ -343,6 +346,7 @@ void trade_tradecommit(struct map_session_data *sd) {
if (target_sd->status.inventory[n].amount < target_sd->deal_item_amount[trade_i])
target_sd->deal_item_amount[trade_i] = target_sd->status.inventory[n].amount;
+ log_trade(target_sd, sd, n, target_sd->deal_item_amount[trade_i]);
flag = pc_additem(sd, &target_sd->status.inventory[n], target_sd->deal_item_amount[trade_i]);
if (flag == 0)
pc_delitem(target_sd, n, target_sd->deal_item_amount[trade_i], 1);