Quellcode durchsuchen

Fixed bugreport:6557 players unable to use char commands will no longer get the 'charcommand failed' message, instead it'll show as a normal chat message

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16759 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind vor 12 Jahren
Ursprung
Commit
14bdbdcaf6
1 geänderte Dateien mit 10 neuen und 0 gelöschten Zeilen
  1. 10 0
      src/map/atcommand.c

+ 10 - 0
src/map/atcommand.c

@@ -8819,6 +8819,7 @@ ACMD_FUNC(cart) {
 	return 0;
 	#undef MC_CART_MDFY
 }
+
 /**
  * Fills the reference of available commands in atcommand DBMap
  **/
@@ -9256,6 +9257,15 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
 				sprintf(atcmd_msg, "%s", command);
 				break;
 			}
+			
+			if( !pc_get_group_level(sd) ) {
+				if( x >= 1 || y >= 1 ) { /* we have command */
+					info = get_atcommandinfo_byname(atcommand_checkalias(command + 1));
+					if( !info || info->char_groups[sd->group_pos] == 0 ) /* if we can't use or doesn't exist: don't even display the command failed message */
+							return false;
+				} else
+					return false;/* display as normal message */
+			}
 		
 			sprintf(output, msg_txt(1388), charcommand_symbol); // Charcommand failed (usage: %c<command> <char name> <parameters>).
 			clif_displaymessage(fd, output);