summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-04-05 16:40:30 -0300
committershennetsind <ind@henn.et>2013-04-05 16:40:30 -0300
commitdaccb6e3ec7f7301cb67e2aafa4ff8ecc7393af0 (patch)
tree0a6ede6445113b4fafaf45d1ee66a1d3a68e8c6b /src/map
parent79ab86b005e6f12ddddd5a4a11774a13933bfcb8 (diff)
downloadhercules-daccb6e3ec7f7301cb67e2aafa4ff8ecc7393af0.tar.gz
hercules-daccb6e3ec7f7301cb67e2aafa4ff8ecc7393af0.tar.bz2
hercules-daccb6e3ec7f7301cb67e2aafa4ff8ecc7393af0.tar.xz
hercules-daccb6e3ec7f7301cb67e2aafa4ff8ecc7393af0.zip
Character now leaves all channels upon @at
could cause a crash depending on the OS. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index b7e50e378..7780d12e7 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -5651,8 +5651,8 @@ ACMD_FUNC(changelook)
* @autotrade by durf [Lupus] [Paradox924X]
* Turns on/off Autotrade for a specific player
*------------------------------------------*/
-ACMD_FUNC(autotrade)
-{
+ACMD_FUNC(autotrade) {
+ int i;
nullpo_retr(-1, sd);
if( map[sd->bl.m].flag.autotrade != battle_config.autotrade_mapflag ) {
@@ -5675,6 +5675,29 @@ ACMD_FUNC(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);
}
+
+ if( hChSys.ally && sd->status.guild_id ) {
+ struct guild *g = sd->guild, *sg;
+ if( g ) {
+ if( idb_exists(((struct hChSysCh *)g->channel)->users, sd->status.char_id) )
+ clif->chsys_left((struct hChSysCh *)g->channel,sd);
+ for (i = 0; i < MAX_GUILDALLIANCE; i++) {
+ if( g->alliance[i].guild_id && (sg = guild_search(g->alliance[i].guild_id) ) ) {
+ if( idb_exists(((struct hChSysCh *)sg->channel)->users, sd->status.char_id) )
+ clif->chsys_left((struct hChSysCh *)sg->channel,sd);
+ break;
+ }
+ }
+ }
+ }
+
+ if( sd->channel_count ) {
+ for( i = 0; i < sd->channel_count; i++ ) {
+ if( sd->channels[i] != NULL )
+ clif->chsys_left(sd->channels[i],sd);
+ }
+ }
+
clif->authfail_fd(sd->fd, 15);
return 0;