Browse Source

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 năm trước cách đây
mục cha
commit
369799a6c5
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  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;