diff options
author | Haru <haru@dotalux.com> | 2013-11-03 20:19:26 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2013-11-03 20:27:13 +0100 |
commit | 6728c0fa88b84fccb6f179ae13cf8a15c1ea23a4 (patch) | |
tree | 91816da66c35d44a01778ea92ea2cc522f1212e1 /src/map | |
parent | 649e7b98a7ec4fbf3363597daad3d1c57383051f (diff) | |
download | hercules-6728c0fa88b84fccb6f179ae13cf8a15c1ea23a4.tar.gz hercules-6728c0fa88b84fccb6f179ae13cf8a15c1ea23a4.tar.bz2 hercules-6728c0fa88b84fccb6f179ae13cf8a15c1ea23a4.tar.xz hercules-6728c0fa88b84fccb6f179ae13cf8a15c1ea23a4.zip |
Allow warp duplicates without a 'facing' value
- Warps don't require a facing, so their duplicates shouldn't either.
- Credits to jaBote.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/npc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index f0bdd7bd0..90f588a26 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2547,8 +2547,10 @@ const char* npc_parse_duplicate(char* w1, char* w2, char* w3, char* w4, const ch x = y = dir = 0; m = -1; } else { - if( sscanf(w1, "%31[^,],%d,%d,%d", mapname, &x, &y, &dir) != 4 )// <map name>,<x>,<y>,<facing> - { + int fields = sscanf(w1, "%31[^,],%d,%d,%d", mapname, &x, &y, &dir); + if( type == WARP && fields == 3 ) { // <map name>,<x>,<y> + dir = 0; + } else if( fields != 4 ) {// <map name>,<x>,<y>,<facing> ShowError("npc_parse_duplicate: Invalid placement format for duplicate in file '%s', line '%d'. Skipping line...\n * w1=%s\n * w2=%s\n * w3=%s\n * w4=%s\n", filepath, strline(buffer,start-buffer), w1, w2, w3, w4); return end;// next line, try to continue } |