소스 검색

Made atcommand channel unusable by non-players. Closed #1342.
* The command can still be used in scripts if there is a player attached to the script.

Jittapan Pluemsumran 8 년 전
부모
커밋
369799a6c5
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      src/map/atcommand.c

+ 5 - 0
src/map/atcommand.c

@@ -9364,6 +9364,11 @@ ACMD_FUNC(channel) {
 	char key[NAME_LENGTH], sub1[CHAN_NAME_LENGTH], sub2[64];
 	sub1[0] = sub2[0] = '\0';
 
+	if (sd->bl.type == BL_NPC) {
+		ShowError("Atcommand channel is not available in scripts.\n");
+		return 0;
+	}
+
 	if( !message || !*message || sscanf(message, "%23s %19s %63[^\n]", key, sub1, sub2) < 1 ) {
 		atcmd_channel_help(sd,command);
 		return 0;