summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c44
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;
}