Skip to content
This repository was archived by the owner on Dec 10, 2022. It is now read-only.

Commit 9fa43aa

Browse files
committed
disallow to use multilize strings in animation script
Try/OpenGothic#232
1 parent 27c1590 commit 9fa43aa

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

zenload/modelScriptParser.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ MdsParserTxt::TokType MdsParserTxt::nextTok(std::string& buf) {
6969
const char cur = zen.readChar();
7070
if(cur=='\"')
7171
break;
72+
if(cur=='\r' || cur=='\n') {
73+
// Invalid syntax
74+
break; // G1 wolf.mds is missing closing " - need to workaround it
75+
}
7276
buf.push_back(cur);
7377
}
7478
return TokType::TK_String;
@@ -132,6 +136,10 @@ void MdsParserTxt::endArgs() {
132136
const TokType tt = nextTok(buf);
133137
if(tt==TK_BracketR)
134138
return;
139+
if(tt==TK_End) {
140+
zen.setSeek(zen.getSeek()-1); // unget
141+
break;
142+
}
135143
}
136144
}
137145

@@ -140,7 +148,7 @@ void MdsParserTxt::implReadItem(MdsParserTxt::TokType dest) {
140148
const TokType tt = nextTok(buf);
141149
if(tt==dest)
142150
return;
143-
if(tt==TK_BracketR){
151+
if(tt==TK_BracketR || tt==TK_End) {
144152
zen.setSeek(zen.getSeek()-1); // unget
145153
break;
146154
}

0 commit comments

Comments
 (0)