From 5495b64907b0c5987ef8efeffbf7e559c49c2cf9 Mon Sep 17 00:00:00 2001 From: Emistry Haoyan Date: Sun, 14 Apr 2019 21:59:17 +0800 Subject: 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. --- src/map/chat.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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]); -- cgit v1.2.3-60-g2f50