aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorrichiesams2013-08-31 17:53:13 -0500
committerWillem Jan Palenstijn2013-09-24 13:59:39 +0200
commit97b0d5988ade1a2453e268706343d6aaacceb5de (patch)
treea06a3c453e65f4a4ebebd95aa160b18458bc8dc6 /engines/zvision
parent94f350b1542e3129ad6c9597fe3fefdface444ae (diff)
downloadscummvm-rg350-97b0d5988ade1a2453e268706343d6aaacceb5de.tar.gz
scummvm-rg350-97b0d5988ade1a2453e268706343d6aaacceb5de.tar.bz2
scummvm-rg350-97b0d5988ade1a2453e268706343d6aaacceb5de.zip
ZVISION: Fix how LeverControl return routes are parsed
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/lever_control.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/zvision/lever_control.cpp b/engines/zvision/lever_control.cpp
index 2a5fe4fcac..3c452c3dd8 100644
--- a/engines/zvision/lever_control.cpp
+++ b/engines/zvision/lever_control.cpp
@@ -153,7 +153,7 @@ void LeverControl::parseLevFile(const Common::String &fileName) {
_frameInfo[frameNumber].hotspot.bottom = y + _hotspotDelta.y;
}
- Common::StringTokenizer tokenizer(line, " ^=");
+ Common::StringTokenizer tokenizer(line, " ^=()");
tokenizer.nextToken();
tokenizer.nextToken();
@@ -168,8 +168,11 @@ void LeverControl::parseLevFile(const Common::String &fileName) {
_frameInfo[frameNumber].directions.push_back(Direction(angle, toFrame));
} else if (token.hasPrefix("P")) {
- uint to;
- sscanf(token.c_str(), "P(%*u to %u)", &to);
+ // Format: P(<from> to <to>)
+ tokenizer.nextToken();
+ tokenizer.nextToken();
+ token = tokenizer.nextToken();
+ uint to = atoi(token.c_str());
_frameInfo[frameNumber].returnRoute.push_back(to);
}