diff options
author | richiesams | 2013-08-31 17:53:13 -0500 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-09-24 13:59:39 +0200 |
commit | 97b0d5988ade1a2453e268706343d6aaacceb5de (patch) | |
tree | a06a3c453e65f4a4ebebd95aa160b18458bc8dc6 /engines | |
parent | 94f350b1542e3129ad6c9597fe3fefdface444ae (diff) | |
download | scummvm-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')
-rw-r--r-- | engines/zvision/lever_control.cpp | 9 |
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); } |