diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-02-23 21:00:48 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-02-23 21:00:48 +0000 |
commit | 97215867bc7799ffe1166313aa58b57ae2b1a776 (patch) | |
tree | 797b7741f30b6ee26b0b125e39eb6ead428cc8ea /src/map | |
parent | 8fdc11ce3e6db27667df3f4e4676fc28ed61c97d (diff) | |
download | hercules-97215867bc7799ffe1166313aa58b57ae2b1a776.tar.gz hercules-97215867bc7799ffe1166313aa58b57ae2b1a776.tar.bz2 hercules-97215867bc7799ffe1166313aa58b57ae2b1a776.tar.xz hercules-97215867bc7799ffe1166313aa58b57ae2b1a776.zip |
* Updates to various custom stuff that buying stores might/are expected to support (follow up to r14713).
- Buying store no longer works on novending maps/cells (bugreport:4778).
- MANNER_NOROOM mute flag now affects buying stores as well (like vending).
- Enabled @autotrade for buying stores.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14724 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.c | 4 | ||||
-rw-r--r-- | src/map/buyingstore.c | 28 | ||||
-rw-r--r-- | src/map/status.c | 3 |
3 files changed, 32 insertions, 3 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 6abee5223..ab55e952c 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5945,8 +5945,8 @@ ACMD_FUNC(autotrade) return -1; } - if( !sd->vender_id ) { //check if player is vending - clif_displaymessage(fd, msg_txt(549)); // You should be vending to use @Autotrade. + if( !sd->vender_id && !sd->state.buyingstore ) { //check if player is vending or buying + clif_displaymessage(fd, msg_txt(549)); // "You should have a shop open to use @autotrade." return -1; } diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c index 6871797c8..cf40b0231 100644 --- a/src/map/buyingstore.c +++ b/src/map/buyingstore.c @@ -50,6 +50,17 @@ bool buyingstore_setup(struct map_session_data* sd, unsigned char slots) return false; } + if( sd->sc.data[SC_NOCHAT] && (sd->sc.data[SC_NOCHAT]->val1&MANNER_NOROOM) ) + {// custom: mute limitation + return false; + } + + if( map[sd->bl.m].flag.novending || map_getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING) ) + {// custom: no vending maps/cells + clif_displaymessage(sd->fd, msg_txt(276)); // "You can't open a shop on this map" + return false; + } + if( slots > MAX_BUYINGSTORE_SLOTS ) { ShowWarning("buyingstore_setup: Requested %d slots, but server supports only %d slots.\n", (int)slots, MAX_BUYINGSTORE_SLOTS); @@ -88,6 +99,17 @@ void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha return; } + if( sd->sc.data[SC_NOCHAT] && (sd->sc.data[SC_NOCHAT]->val1&MANNER_NOROOM) ) + {// custom: mute limitation + return; + } + + if( map[sd->bl.m].flag.novending || map_getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING) ) + {// custom: no vending maps/cells + clif_displaymessage(sd->fd, msg_txt(276)); // "You can't open a shop on this map" + return; + } + weight = sd->weight; // check item list @@ -171,6 +193,12 @@ void buyingstore_close(struct map_session_data* sd) // notify other players clif_buyingstore_disappear_entry(sd); + + // remove auto-trader + if( sd->state.autotrade ) + { + map_quit(sd); + } } } diff --git a/src/map/status.c b/src/map/status.c index a44fbdd44..33da5fb14 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -6747,7 +6747,8 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid) case SC_AUTOTRADE: if (tid == INVALID_TIMER) break; - vending_closevending(sd); + // Note: vending/buying is closed by unit_remove_map, no + // need to do it here. map_quit(sd); // Because map_quit calls status_change_end with tid -1 // from here it's not neccesary to continue |