summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-06-19 01:05:45 +0200
committerHaru <haru@dotalux.com>2015-08-09 21:14:02 +0200
commit01a596069aadd4dd50b67ec35db4258c0f899464 (patch)
treee092dcabdc391530ac56d0c7a43ee07ee6c7da24
parent1c293cfb122b8d3e60d591d90083291331e29a15 (diff)
downloadhercules-01a596069aadd4dd50b67ec35db4258c0f899464.tar.gz
hercules-01a596069aadd4dd50b67ec35db4258c0f899464.tar.bz2
hercules-01a596069aadd4dd50b67ec35db4258c0f899464.tar.xz
hercules-01a596069aadd4dd50b67ec35db4258c0f899464.zip
Improved validation of monster/boss_monster top-level script objects
- xs, ys, delay1, delay2 and event are now required, as described in the documentation. Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--src/map/npc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 50c2ee95b..6acb93266 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -3531,10 +3531,10 @@ const char* npc_parse_mob(char* w1, char* w2, char* w3, char* w4, const char* st
// w1=<map name>,<x>,<y>,<xs>,<ys>
// w3=<mob name>{,<mob level>}
- // w4=<mob id>,<amount>,<delay1>,<delay2>,<event>{,<mob size>,<mob ai>}
- if( sscanf(w1, "%31[^,],%d,%d,%d,%d", mapname, &x, &y, &xs, &ys) < 3
+ // w4=<mob id>,<amount>,<delay1>,<delay2>{,<event>,<mob size>,<mob ai>}
+ if( sscanf(w1, "%31[^,],%d,%d,%d,%d", mapname, &x, &y, &xs, &ys) < 5
|| sscanf(w3, "%23[^,],%d", mobname, &mob_lv) < 1
- || sscanf(w4, "%d,%d,%u,%u,%50[^,],%d,%d[^\t\r\n]", &class_, &num, &mobspawn.delay1, &mobspawn.delay2, mobspawn.eventname, &size, &ai) < 2
+ || sscanf(w4, "%d,%d,%u,%u,%50[^,],%d,%d[^\t\r\n]", &class_, &num, &mobspawn.delay1, &mobspawn.delay2, mobspawn.eventname, &size, &ai) < 4
) {
ShowError("npc_parse_mob: Invalid mob definition in file '%s', line '%d'.\n * w1=%s\n * w2=%s\n * w3=%s\n * w4=%s\n", filepath, strline(buffer,start-buffer), w1, w2, w3, w4);
if (retval) *retval = EXIT_FAILURE;