Bläddra i källkod

Fixed "#cmd" nick exploit, bugreport:5188

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15338 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind 13 år sedan
förälder
incheckning
9b2e960e64
1 ändrade filer med 8 tillägg och 4 borttagningar
  1. 8 4
      src/map/atcommand.c

+ 8 - 4
src/map/atcommand.c

@@ -9197,10 +9197,14 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
 		//z always has the value of the scan that was successful
 		z = ( x > 1 ) ? x : y;
 		
-		if ( (ssd = map_nick2sd(charname)) == NULL  && ( (ssd = map_nick2sd(charname2)) == NULL ) )
-		{
-			sprintf(output, "%s failed. Player not found.", command);
-			clif_displaymessage(fd, output);
+		if ( (ssd = map_nick2sd(charname)) == NULL  && ( (ssd = map_nick2sd(charname2)) == NULL ) ) {
+			if( pc_isGM(sd) ) {
+				sprintf(output, "%s failed. Player not found.", command);
+				clif_displaymessage(fd, output);
+			} else {
+				sprintf(output, "Charcommand failed. Usage: #<command> <char name> <params>.");
+				clif_displaymessage(fd, output);			
+			}
 			return true;
 		}