diff options
author | Paradox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-05-31 23:54:48 +0000 |
---|---|---|
committer | Paradox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-05-31 23:54:48 +0000 |
commit | 3410b900c6a31d04f75b4e527b2656117029edc7 (patch) | |
tree | 467c97f321712bace955586bef77aaf51f0c6b6c /src | |
parent | 9bc92b06cefa99a8d5595bac9ac6c292b729be03 (diff) | |
download | hercules-3410b900c6a31d04f75b4e527b2656117029edc7.tar.gz hercules-3410b900c6a31d04f75b4e527b2656117029edc7.tar.bz2 hercules-3410b900c6a31d04f75b4e527b2656117029edc7.tar.xz hercules-3410b900c6a31d04f75b4e527b2656117029edc7.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/map/atcommand.c | 44 |
1 files changed, 22 insertions, 22 deletions
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; } |