summaryrefslogtreecommitdiff
path: root/src/map/buyingstore.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/buyingstore.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/buyingstore.c')
-rw-r--r--src/map/buyingstore.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c
index 2c2fc13ae..fd6e6fd6e 100644
--- a/src/map/buyingstore.c
+++ b/src/map/buyingstore.c
@@ -91,8 +91,9 @@ static void buyingstore_create(struct map_session_data *sd, int zenylimit, unsig
return;
}
- if( !battle_config.feature_buying_store || pc_istrading(sd) || sd->state.prevend || sd->buyingstore.slots == 0 || count > sd->buyingstore.slots || zenylimit <= 0 || zenylimit > sd->status.zeny || !storename[0] )
- {// disabled or invalid input
+ if (battle_config.feature_buying_store == 0 || pc_istrading_except_npc(sd) || sd->state.prevend != 0
+ || (sd->npc_id != 0 && sd->state.using_megaphone == 0) || sd->buyingstore.slots == 0
+ || count > sd->buyingstore.slots || zenylimit <= 0 || zenylimit > sd->status.zeny || *storename == '\0') { // Disabled or invalid input.
sd->buyingstore.slots = 0;
clif->buyingstore_open_failed(sd, BUYINGSTORE_CREATE, 0);
return;
@@ -218,8 +219,8 @@ static void buyingstore_open(struct map_session_data *sd, int account_id)
struct map_session_data* pl_sd;
nullpo_retv(sd);
- if (!battle_config.feature_buying_store || pc_istrading(sd) || sd->state.prevend)
- {// not allowed to sell
+ if (battle_config.feature_buying_store == 0 || pc_istrading_except_npc(sd) || sd->state.prevend != 0
+ || (sd->npc_id != 0 && sd->state.using_megaphone == 0)) { // Not allowed to sell.
return;
}
@@ -255,8 +256,8 @@ static void buyingstore_trade(struct map_session_data* sd, int account_id, unsig
return;
}
- if (!battle_config.feature_buying_store || pc_istrading(sd) || sd->state.prevend)
- {// not allowed to sell
+ if (battle_config.feature_buying_store == 0 || pc_istrading_except_npc(sd) || sd->state.prevend != 0
+ || (sd->npc_id != 0 && sd->state.using_megaphone == 0)) { // Not allowed to sell.
clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, 0);
return;
}