diff options
author | Emistry Haoyan <equinox1991@gmail.com> | 2019-04-14 21:59:17 +0800 |
---|---|---|
committer | Emistry Haoyan <equinox1991@gmail.com> | 2019-04-14 21:59:17 +0800 |
commit | 5495b64907b0c5987ef8efeffbf7e559c49c2cf9 (patch) | |
tree | 3b293a0fc96866d61a55a16d2b6d3f8c17b7e3ec /src | |
parent | ab81d4012eac5c2c00c485971fc9b89bf69761be (diff) | |
download | hercules-5495b64907b0c5987ef8efeffbf7e559c49c2cf9.tar.gz hercules-5495b64907b0c5987ef8efeffbf7e559c49c2cf9.tar.bz2 hercules-5495b64907b0c5987ef8efeffbf7e559c49c2cf9.tar.xz hercules-5495b64907b0c5987ef8efeffbf7e559c49c2cf9.zip |
Disable chatroom creation if cell_chknochat
- doesn't allow chatroom creation/switch if the coordinated cell are set
with cell_chknochat.
- chatroom will be auto deleted.
Diffstat (limited to 'src')
-rw-r--r-- | src/map/chat.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/map/chat.c b/src/map/chat.c index d9b642219..77a12a560 100644 --- a/src/map/chat.c +++ b/src/map/chat.c @@ -255,6 +255,14 @@ static int chat_leavechat(struct map_session_data *sd, bool kicked) } if( leavechar == 0 && cd->owner->type == BL_PC ) { + + // check if new location are CELL_CHKNOCHAT + if (map->getcell(cd->usersd[0]->bl.m, NULL, cd->usersd[0]->bl.x, cd->usersd[0]->bl.y, CELL_CHKNOCHAT)) { + for (i = (cd->users - 1); i >= 0; i--) + chat->leave(cd->usersd[i], false); + return 2; + } + // Set and announce new owner cd->owner = &cd->usersd[0]->bl; clif->changechatowner(cd, cd->usersd[0]); |