summaryrefslogtreecommitdiff
path: root/src/map/script-parse.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/script-parse.py')
-rw-r--r--src/map/script-parse.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/map/script-parse.py b/src/map/script-parse.py
index 0309f54..199e348 100644
--- a/src/map/script-parse.py
+++ b/src/map/script-parse.py
@@ -20,6 +20,8 @@ class ScriptBuffer(object):
FUNC_REF,
'''.replace(',', '').split()
ci = int(b[i])
+ if ci < 0:
+ ci += 256
if ci >= 0x80:
rv = 0
sh = 0
@@ -35,6 +37,8 @@ class ScriptBuffer(object):
i = next(r)
ci = int(b[i])
+ if ci < 0:
+ ci += 256
rv += (ci & 0x7f) << sh
sh += 6
if not (ci >= 0xc0):
@@ -81,7 +85,7 @@ class ScriptBuffer(object):
if ci == 0:
break
buf.append(ci)
- return 'STR "%s"' % str(buf).replace('\\', '\\\\').replace('"', '\\"')
+ return 'STR "%s"' % bytes(buf).decode("utf-8").replace('\\', '\\\\').replace('"', '\\"')
elif cs == 'EOL':
return cs + '\n'
return cs