From d31a3c5ce117fb10f378ab735cf5e1995b3f8ffb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 31 Dec 2014 20:39:14 +0300 Subject: hercules: tmw: fix functions conversion. --- hercules/code/server/tmw/npcs.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'hercules/code/server') diff --git a/hercules/code/server/tmw/npcs.py b/hercules/code/server/tmw/npcs.py index fa8a825..4a38c9c 100644 --- a/hercules/code/server/tmw/npcs.py +++ b/hercules/code/server/tmw/npcs.py @@ -131,7 +131,7 @@ def writeScript(w, m): else: w.write("{0},{1},{2},{3}".format(m.group("map"), m.group("x"), m.group("y"), m.group("dir"))) if isFunction: - w.write("\t{0}\t{1}".format(m.group("tag"), m.group("name"))); + w.write("\t{0}\t{1}\t".format(m.group("tag"), m.group("name"))); else: class_ = m.group("class") if class_ == "0": # hidden npc @@ -159,9 +159,20 @@ def processScript(tracker): writeScript(w, m) if m.group("xs") != None: w.write(",{0},{1}".format(m.group("xs"), m.group("ys"))); - w.write(",{\n"); + try: + if m.group("function") != None: + isFunction = True + else: + isFunction = False + except: + isFunction = True + if isFunction == False: + w.write(",{\n"); + else: + w.write("{\n"); + def itemsToShop(tracker, itemsStr): itemsSplit = re.compile(",") itemsSplit2 = re.compile(":") -- cgit v1.2.3-60-g2f50