diff options
author | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-06-25 08:09:10 +0200 |
---|---|---|
committer | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-06-25 08:09:10 +0200 |
commit | 0f11b668aebc5197281a4747b202cc9fa7549d72 (patch) | |
tree | f1f106ab30b34a1197b0c4a081916c475e7b10c2 /src | |
parent | 7da438ed9885aa05f4d2748e655ad889b4d39c85 (diff) | |
download | hercules-0f11b668aebc5197281a4747b202cc9fa7549d72.tar.gz hercules-0f11b668aebc5197281a4747b202cc9fa7549d72.tar.bz2 hercules-0f11b668aebc5197281a4747b202cc9fa7549d72.tar.xz hercules-0f11b668aebc5197281a4747b202cc9fa7549d72.zip |
Enable buying store features while Megaphone input box is present
Diffstat (limited to 'src')
-rw-r--r-- | src/map/buyingstore.c | 13 | ||||
-rw-r--r-- | src/map/clif.c | 2 |
2 files changed, 8 insertions, 7 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; } diff --git a/src/map/clif.c b/src/map/clif.c index 715e829f0..2b2865255 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -19190,7 +19190,7 @@ static void clif_parse_ReqOpenBuyingStore(int fd, struct map_session_data *sd) _ /// 1 = open static void clif_parse_ReqOpenBuyingStore(int fd, struct map_session_data *sd) { - if (pc_istrading(sd) || pc_isdead(sd)) + if (pc_istrading_except_npc(sd) || (sd->npc_id != 0 && sd->state.using_megaphone == 0) || pc_isdead(sd)) return; const unsigned int blocksize = sizeof(struct PACKET_CZ_REQ_OPEN_BUYING_STORE_sub); |