diff options
author | shennetsind <ind@henn.et> | 2013-11-30 14:44:44 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-11-30 14:44:44 -0200 |
commit | 6fc1cae2088dd9f450e15728ca4bf4a82fcb8070 (patch) | |
tree | 1b43199b27c13d9db23d14a012c41a5b68bda577 /src/map/atcommand.c | |
parent | 098dbcf672e04657553b9f1629550e6bc8771af3 (diff) | |
download | hercules-6fc1cae2088dd9f450e15728ca4bf4a82fcb8070.tar.gz hercules-6fc1cae2088dd9f450e15728ca4bf4a82fcb8070.tar.bz2 hercules-6fc1cae2088dd9f450e15728ca4bf4a82fcb8070.tar.xz hercules-6fc1cae2088dd9f450e15728ca4bf4a82fcb8070.zip |
Minor adjustments
- improved @makehomun -1 so that if the homun data hasnt been loaded it is requested.
- instances of private types (party/guild/char) no longer create channels, however global types still does (IOT_NONE).
- Fixed an issue with party/guild instance data not being freed when either is destroyed (Special Thanks to Yommy).
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index c355f6bbd..3976c8427 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -6812,8 +6812,10 @@ ACMD(makehomun) { homunid = atoi(message); - if( homunid == -1 && sd->status.hom_id && !homun_alive(sd->hd) ) { - if( sd->hd->homunculus.vaporize ) + if( homunid == -1 && sd->status.hom_id && !(sd->hd && homun_alive(sd->hd)) ) { + if( !sd->hd ) + homun->call(sd); + else if( sd->hd->homunculus.vaporize ) homun->ressurect(sd, 100, sd->bl.x, sd->bl.y); else homun->call(sd); @@ -8615,7 +8617,7 @@ ACMD(cart) { } /* [Ind/Hercules] */ ACMD(join) { - struct hChSysCh *channel; + struct hChSysCh *channel = NULL; char name[HCHSYS_NAME_LENGTH], pass[HCHSYS_NAME_LENGTH]; if( !message || !*message || sscanf(message, "%s %s", name, pass) < 1 ) { @@ -8626,7 +8628,8 @@ ACMD(join) { if( hChSys.local && strcmpi(name + 1, hChSys.local_name) == 0 ) { if( !map->list[sd->bl.m].channel ) { clif->chsys_mjoin(sd); - return true; + if( map->list[sd->bl.m].channel ) /* mjoin might have refused, map has chatting capabilities disabled */ + return true; } else channel = map->list[sd->bl.m].channel; } else if( hChSys.ally && sd->status.guild_id && strcmpi(name + 1, hChSys.ally_name) == 0 ) { @@ -8639,6 +8642,13 @@ ACMD(join) { return false; } + if( !channel ) { + sprintf(atcmd_output, msg_txt(1400),name,command); // Unknown Channel '%s' (usage: %s <#channel_name>) + clif->message(fd, atcmd_output); + return false; + } + + if( idb_exists(channel->users, sd->status.char_id) ) { sprintf(atcmd_output, msg_txt(1475),name); // You're already in the '%s' channel clif->message(fd, atcmd_output); |