summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-19 18:44:01 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-19 18:44:01 +0000
commite3cf8d5104f6fa28e1af240ac9a98f25a5552e27 (patch)
treee37fa082ab8405c822e426042747a170e1709132 /src/map/npc.c
parentfae3410f42f3a2c4c294478c775f936881f31231 (diff)
downloadhercules-e3cf8d5104f6fa28e1af240ac9a98f25a5552e27.tar.gz
hercules-e3cf8d5104f6fa28e1af240ac9a98f25a5552e27.tar.bz2
hercules-e3cf8d5104f6fa28e1af240ac9a98f25a5552e27.tar.xz
hercules-e3cf8d5104f6fa28e1af240ac9a98f25a5552e27.zip
- Removed the max cap of autoloot so you are now allowed to set autoloot values above 100.
- Initialized w1/w2/w3/w4 before reading each npc line to avoid sending unread values to the parsers (for example, if w4 has a value in one line and none on the next, it will be parsed with the previous value of w4 on the following lines) - Updated getpartymember to receive an int which specifies what to retrieve. 0: Character names (array $@partymembername$), 1 character char ids (array $@partymembercid), 2 character account ids (array $@partynameaid). By default it returns party member names. - Updated script_commands.txt with the updated behaviour of getpartymember. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6182 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 87d6a9b17..e0dda3344 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2484,6 +2484,9 @@ void npc_parsesrcfile (char *name)
}
line[j] = '\0'; //Forget to terminate the string. From [jA 1091]
// 最初はタブ区切りでチェックしてみて、ダメならスペース区切りで確認
+ 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]\t%[^\t]\t%[^\t\r\n]\t%n%[^\t\r\n]", w1, w2, w3, &w4pos, w4)) < 3 &&
(count = sscanf(line,"%s%s%s%n%s", w1, w2, w3, &w4pos, w4)) < 3) {
continue;