Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions lcftrans/src/translation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,21 @@ struct ParseEvent {
case Cmd::Maniac_ShowStringPicture: {
// Show String Picture
add_evt_entry();
auto tokens = Utils::Split(lcf::ToString(estring), '\x01');
if (tokens.size() >= 4) {

if (!estring.empty() && estring[0] == '\x01') {
std::string term = "";

for (size_t i = 1; i < estring.size(); ++i) {
char c = estring[i];
if (c == '\x01' || c == '\x02' || c == '\x03') {
break;
}
term += c;
}

info.push_back(make_info(ctx));
info.push_back("Show String Picture");
for (auto& line: Utils::Split(tokens[1], '\n')) {
for (auto& line: Utils::Split(term, '\n')) {
lines.push_back(Utils::RemoveControlChars(line));
}
context = "strpic";
Expand Down Expand Up @@ -537,7 +547,7 @@ Translation Translation::fromPO(const std::string& filename) {
continue;
}
std::cerr << "Parse error (Line " << line_number << "): Expected \", got " << c << ": " << line << "\n";
return "";
return "";
}

if (!slash && c == '\\') {
Expand Down