summaryrefslogtreecommitdiff
path: root/src/map/trade.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2020-06-28 03:21:28 +0200
committerGitHub <noreply@github.com>2020-06-28 03:21:28 +0200
commit9b22213254d64b2c155c6700030303852fd5b912 (patch)
tree7eb4047ade3194749eee98d62beca06fdf820a39 /src/map/trade.c
parent44513531ea39c6bdb464ef74ef60a21d70084904 (diff)
parent1d00e2268b7a20077d9d61dc8989b9f770344e59 (diff)
downloadhercules-9b22213254d64b2c155c6700030303852fd5b912.tar.gz
hercules-9b22213254d64b2c155c6700030303852fd5b912.tar.bz2
hercules-9b22213254d64b2c155c6700030303852fd5b912.tar.xz
hercules-9b22213254d64b2c155c6700030303852fd5b912.zip
Merge pull request #2775 from Kenpachi2k13/megaphone
Fix Megaphone behaviour
Diffstat (limited to 'src/map/trade.c')
-rw-r--r--src/map/trade.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/map/trade.c b/src/map/trade.c
index e727c3c70..31970fbf9 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -63,7 +63,7 @@ static void trade_traderequest(struct map_session_data *sd, struct map_session_d
return;
}
- if (target_sd->npc_id) {
+ if (target_sd->npc_id != 0 && target_sd->state.using_megaphone == 0) {
//Trade fails if you are using an NPC.
clif->tradestart(sd, 2);
return;
@@ -166,9 +166,10 @@ static 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.prevend || sd->state.buyingstore || sd->state.storage_flag != STORAGE_FLAG_CLOSED
- || tsd->npc_id || tsd->state.vending || tsd->state.prevend || tsd->state.buyingstore || tsd->state.storage_flag != STORAGE_FLAG_CLOSED
- ) {
+ if ((sd->npc_id != 0 && sd->state.using_megaphone == 0) || sd->state.vending != 0 || sd->state.prevend != 0
+ || sd->state.buyingstore != 0 || sd->state.storage_flag != STORAGE_FLAG_CLOSED
+ || (tsd->npc_id != 0 && tsd->state.using_megaphone == 0) || tsd->state.vending != 0 || tsd->state.prevend != 0
+ || tsd->state.buyingstore != 0 || tsd->state.storage_flag != STORAGE_FLAG_CLOSED) {
//Fail
clif->tradestart(sd, 2);
clif->tradestart(tsd, 2);