Prechádzať zdrojové kódy

* Charcommands no longer default to self if no target is found.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13413 54d463be-8e91-2dee-dedb-b68131a5f0ec
sketchyphoenix 16 rokov pred
rodič
commit
4a5a9de682
1 zmenil súbory, kde vykonal 7 pridanie a 2 odobranie
  1. 7 2
      src/map/atcommand.c

+ 7 - 2
src/map/atcommand.c

@@ -8965,8 +8965,13 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
 
 	if (*message == charcommand_symbol)
 	{
-		if (sscanf(message, "%99s \"%23[^\"]\" %99[^\n]", cmd, charname, param) > 2
-		|| sscanf(message, "%99s %23s %99[^\n]", cmd, charname, param) > 2)
+		if( sscanf(message, "%99s %99[^\n]", cmd, param) == 1 ) {
+				sprintf(output, "%s failed. Please enter a player name.", cmd);
+				clif_displaymessage(fd, output);
+				return true;
+		}
+		else if (sscanf(message, "%99s \"%23[^\"]\" %99[^\n]", cmd, charname, param) > 1
+		|| sscanf(message, "%99s %23s %99[^\n]", cmd, charname, param) > 1)
 		{
 			if ( (pl_sd = map_nick2sd(charname)) == NULL )
 			{