summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index ce73319e2..b2d486520 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -5479,12 +5479,19 @@ ACMD(autotrade) {
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->chsys_quit(sd);
clif->authfail_fd(sd->fd, 15);
+
+#ifdef AUTOTRADE_PERSISTENCY
+ pc->autotrade_prepare(sd);
+
+ return false;/* we fail to not cause it to proceed on is_atcommand */
+#else
return true;
+#endif
}
/*==========================================
@@ -8437,12 +8444,12 @@ ACMD(set) {
break;
case '#':
if( reg[1] == '#' )
- data->u.str = pc_readaccountreg2str(sd, reg);// global
+ data->u.str = pc_readaccountreg2str(sd, script->add_str(reg));// global
else
- data->u.str = pc_readaccountregstr(sd, reg);// local
+ data->u.str = pc_readaccountregstr(sd, script->add_str(reg));// local
break;
default:
- data->u.str = pc_readglobalreg_str(sd, reg);
+ data->u.str = pc_readglobalreg_str(sd, script->add_str(reg));
break;
}
@@ -8466,12 +8473,12 @@ ACMD(set) {
break;
case '#':
if( reg[1] == '#' )
- data->u.num = pc_readaccountreg2(sd, reg);// global
+ data->u.num = pc_readaccountreg2(sd, script->add_str(reg));// global
else
- data->u.num = pc_readaccountreg(sd, reg);// local
+ data->u.num = pc_readaccountreg(sd, script->add_str(reg));// local
break;
default:
- data->u.num = pc_readglobalreg(sd, reg);
+ data->u.num = pc_readglobalreg(sd, script->add_str(reg));
break;
}
@@ -8640,7 +8647,7 @@ ACMD(join) {
} else if( hChSys.ally && sd->status.guild_id && strcmpi(name + 1, hChSys.ally_name) == 0 ) {
struct guild *g = sd->guild;
if( !g ) return false;/* unlikely, but we wont let it crash anyway. */
- channel = (struct hChSysCh *)g->channel;
+ channel = g->channel;
} else if( !( channel = strdb_get(clif->channel_db, name + 1) ) ) {
sprintf(atcmd_output, msg_txt(1400),name,command); // Unknown Channel '%s' (usage: %s <#channel_name>)
clif->message(fd, atcmd_output);
@@ -8684,8 +8691,8 @@ ACMD(join) {
int i;
for (i = 0; i < MAX_GUILDALLIANCE; i++) {
if( g->alliance[i].opposition == 0 && g->alliance[i].guild_id && (sg = guild->search(g->alliance[i].guild_id) ) ) {
- if( !(((struct hChSysCh*)sg->channel)->banned && idb_exists(((struct hChSysCh*)sg->channel)->banned, sd->status.account_id))) {
- clif->chsys_join((struct hChSysCh *)sg->channel,sd);
+ if( !(sg->channel->banned && idb_exists(sg->channel->banned, sd->status.account_id))) {
+ clif->chsys_join(sg->channel,sd);
}
}
}
@@ -8815,7 +8822,7 @@ ACMD(channel) {
if( hChSys.ally && sd->status.guild_id ) {
struct guild *g = sd->guild;
if( !g ) { dbi_destroy(iter); return false; }
- sprintf(atcmd_output, msg_txt(1409), hChSys.ally_name, db_size(((struct hChSysCh *)g->channel)->users));// - #%s ( %d users )
+ sprintf(atcmd_output, msg_txt(1409), hChSys.ally_name, db_size(g->channel->users));// - #%s ( %d users )
clif->message(fd, atcmd_output);
}
for(channel = dbi_first(iter); dbi_exists(iter); channel = dbi_next(iter)) {