diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-31 21:03:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-31 21:03:59 +0300 |
commit | 538a95cb0d9022c5c253a53b618557160569a495 (patch) | |
tree | 2a1d66cac8ae6eb2277de42f90efea46807b6b22 | |
parent | d31a3c5ce117fb10f378ab735cf5e1995b3f8ffb (diff) | |
download | evol-tools-538a95cb0d9022c5c253a53b618557160569a495.tar.gz evol-tools-538a95cb0d9022c5c253a53b618557160569a495.tar.bz2 evol-tools-538a95cb0d9022c5c253a53b618557160569a495.tar.xz evol-tools-538a95cb0d9022c5c253a53b618557160569a495.zip |
hercules: tmw: fix DailyQuestPoints variable and function name conflict.
-rw-r--r-- | hercules/code/server/tmw/npcs.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/hercules/code/server/tmw/npcs.py b/hercules/code/server/tmw/npcs.py index 4a38c9c..938f8ac 100644 --- a/hercules/code/server/tmw/npcs.py +++ b/hercules/code/server/tmw/npcs.py @@ -131,7 +131,10 @@ 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}\t".format(m.group("tag"), m.group("name"))); + funcName = m.group("name") + if funcName == "DailyQuestPoints": + funcName = "DailyQuestPointsFunc" + w.write("\t{0}\t{1}\t".format(m.group("tag"), funcName)); else: class_ = m.group("class") if class_ == "0": # hidden npc @@ -156,11 +159,6 @@ def processScript(tracker): # m.group("map"), m.group("x"), m.group("y"), m.group("dir"), # m.group("tag"), m.group("name"), m.group("class"), m.group("xs"), m.group("ys")) - writeScript(w, m) - if m.group("xs") != None: - w.write(",{0},{1}".format(m.group("xs"), m.group("ys"))); - - try: if m.group("function") != None: isFunction = True @@ -168,6 +166,12 @@ def processScript(tracker): isFunction = False except: isFunction = True + + writeScript(w, m) + + if m.group("xs") != None: + w.write(",{0},{1}".format(m.group("xs"), m.group("ys"))); + if isFunction == False: w.write(",{\n"); else: @@ -291,8 +295,13 @@ def processStrReplace(tracker): line = line.replace("sc_poison", "SC_POISON") line = line.replace("sc_slowpoison", "SC_SLOWPOISON") line = line.replace("countitem(", "countitemcolor(") + line = line.replace("Bugleg", "BugLeg") line = re.sub("([^@^$])@([^@])", "\\1.@\\2", line) line = line.replace(".@menu", "@menu") + + # fix at same time usage with same name function and variable + line = line.replace("\"DailyQuestPoints\"", "\"DailyQuestPointsFunc\"") + idx = line.find("getmapmobs(") if idx >= 0: idx2 = line.find("\"", idx + len("getmapmobs(") + 1) |