From 3410b900c6a31d04f75b4e527b2656117029edc7 Mon Sep 17 00:00:00 2001 From: Paradox924X Date: Mon, 31 May 2010 23:54:48 +0000 Subject: Rewrote and reorganized checks in @autotrade to check and display most useful information first (bugreport:4253). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14317 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 2 ++ src/map/atcommand.c | 44 ++++++++++++++++++++++---------------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 0d374fe5e..a40eefb9d 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,8 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. +2010/05/31 + * Rewrote and reorganized checks in @autotrade to check and display most useful information first (bugreport:4253). [Paradox924X] 2010/05/30 * Damaged reflected from skills will now be shown as multiple hits if the skill used was multi-hit. [Paradox924X] 2010/05/29 diff --git a/src/map/atcommand.c b/src/map/atcommand.c index e5567aa2a..035cc5fe1 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5873,36 +5873,36 @@ int atcommand_changelook(const int fd, struct map_session_data* sd, const char* } /*========================================== - * @autotrade by durf (changed by Lupus) + * @autotrade by durf [Lupus] [Paradox924X] * Turns on/off Autotrade for a specific player *------------------------------------------*/ int atcommand_autotrade(const int fd, struct map_session_data* sd, const char* command, const char* message) { nullpo_retr(-1, sd); - if( sd->vender_id ) //check if player's vending - { - if( pc_isdead(sd) ) - { - clif_displaymessage(fd, "Cannot Autotrade if you are dead."); - return -1; - } - - if( map[sd->bl.m].flag.autotrade == battle_config.autotrade_mapflag ) - { - sd->state.autotrade = 1; - if( battle_config.at_timeout ) - { - int timeout = atoi(message); - status_change_start(&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0); - } + + if( map[sd->bl.m].flag.autotrade != battle_config.autotrade_mapflag ) { + clif_displaymessage(fd, "Autotrade is not allowed on this map."); + return -1; + } - clif_authfail_fd(fd, 15); - } else - clif_displaymessage(fd, "Autotrade is not allowed on this map."); + if( pc_isdead(sd) ) { + clif_displaymessage(fd, "Cannot Autotrade if you are dead."); + return -1; } - else + + if( !sd->vender_id ) { //check if player is vending clif_displaymessage(fd, msg_txt(549)); // You should be vending to use @Autotrade. - + return -1; + } + + sd->state.autotrade = 1; + if( battle_config.at_timeout ) + { + int timeout = atoi(message); + status_change_start(&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0); + } + clif_authfail_fd(fd, 15); + return 0; } -- cgit v1.2.3-60-g2f50