Переглянути джерело

- Fixed the new npc parsing code not accounting for windows-style line terminators, which as a side effect messed up mapflag parsing if the file had windows-style terminators, which coincidentally was the case for the nopvp file, which unfortunately meant that all towns became pvp!

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9363 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 18 роки тому
батько
коміт
72ee155c06
2 змінених файлів з 5 додано та 1 видалено
  1. 4 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/npc.c

+ 4 - 0
Changelog-Trunk.txt

@@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2006/11/29
+	* Fixed the new npc parsing code not accounting for windows-style line
+	  terminators, which as a side effect messed up mapflag parsing if the file
+	  had windows-style terminators, which coincidentally was the case for the
+	  nopvp file, which unfortunately meant that all towns became pvp! [Skotlex]
 	* HT_PHANTASMIC no longer knocks back even when it misses. [Skotlex]
 	* Earned exp by dead homuns will now be lost (same treatment as earned exp
 	  from players that died) [Skotlex]

+ 1 - 1
src/map/npc.c

@@ -2643,7 +2643,7 @@ void npc_parsesrcfile (char *name)
 		w1[0] = w2[0] = w3[0] = w4[0] = '\0'; //It's best to initialize values
 		//to prevent passing previously parsed values to the parsers when not all
 		//fields are specified. [Skotlex]
-		if ((count = sscanf(line, "%[^\t\n]\t%[^\t\n]\t%[^\t\n]\t%n%[^\n]", w1, w2, w3, &w4pos, w4)) < 3)
+		if ((count = sscanf(line, "%[^\t\r\n]\t%[^\t\r\n]\t%[^\t\r\n]\t%n%[^\r\n]", w1, w2, w3, &w4pos, w4)) < 3)
 		{
 			if ((count = sscanf(line, "%s %s %[^\t]\t %n%[^\n]", w1, w2, w3, &w4pos, w4)) == 4 ||
 			(count = sscanf(line, "%s %s %s %n%[^\n]\n", w1, w2, w3, &w4pos, w4)) >= 3)