summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorGuilherme Menaldo <guilherme.menaldo@outlook.com>2019-10-27 19:48:03 -0300
committerGuilherme Menaldo <guilherme.menaldo@outlook.com>2019-10-27 19:58:30 -0300
commit863dea4e8693047a60da115531e7403997b1ce98 (patch)
tree55b95c9f2a30f69d212d292a143e04ca7978e972 /src/map/script.c
parent857650c4f58d347455b0d075b49a53f69e6d0c51 (diff)
downloadhercules-863dea4e8693047a60da115531e7403997b1ce98.tar.gz
hercules-863dea4e8693047a60da115531e7403997b1ce98.tar.bz2
hercules-863dea4e8693047a60da115531e7403997b1ce98.tar.xz
hercules-863dea4e8693047a60da115531e7403997b1ce98.zip
Makes HULD .po files read \r as a control character
This fixes loading .po files of NPCs that has multi-line mes split with \r.
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index bd0fbb611..6b2f0bfbe 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -5400,6 +5400,9 @@ static int script_load_translation_file(const char *file, uint8 lang_id)
if (line[i] == '\\' && line[i+1] == '"') {
VECTOR_PUSH(*msg_ptr, '"');
i++;
+ } else if (line[i] == '\\' && line[i+1] == 'r') {
+ VECTOR_PUSH(*msg_ptr, '\r');
+ i++;
} else {
VECTOR_PUSH(*msg_ptr, line[i]);
}
@@ -5418,6 +5421,9 @@ static int script_load_translation_file(const char *file, uint8 lang_id)
if (line[i] == '\\' && line[i+1] == '"') {
msgctxt[cursor] = '"';
i++;
+ } else if (line[i] == '\\' && line[i+1] == 'r') {
+ msgctxt[cursor] = '\r';
+ i++;
} else {
msgctxt[cursor] = line[i];
}
@@ -5439,6 +5445,9 @@ static int script_load_translation_file(const char *file, uint8 lang_id)
if (line[i] == '\\' && line[i+1] == '"') {
VECTOR_PUSH(msgid, '"');
i++;
+ } else if (line[i] == '\\' && line[i+1] == 'r') {
+ VECTOR_PUSH(msgid, '\r');
+ i++;
} else {
VECTOR_PUSH(msgid, line[i]);
}
@@ -5458,6 +5467,9 @@ static int script_load_translation_file(const char *file, uint8 lang_id)
if (line[i] == '\\' && line[i+1] == '"') {
VECTOR_PUSH(msgstr, '"');
i++;
+ } else if (line[i] == '\\' && line[i+1] == 'r') {
+ VECTOR_PUSH(msgstr, '\r');
+ i++;
} else {
VECTOR_PUSH(msgstr, line[i]);
}