From 97b0d5988ade1a2453e268706343d6aaacceb5de Mon Sep 17 00:00:00 2001 From: richiesams Date: Sat, 31 Aug 2013 17:53:13 -0500 Subject: ZVISION: Fix how LeverControl return routes are parsed --- engines/zvision/lever_control.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'engines') 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( to ) + tokenizer.nextToken(); + tokenizer.nextToken(); + token = tokenizer.nextToken(); + uint to = atoi(token.c_str()); _frameInfo[frameNumber].returnRoute.push_back(to); } -- cgit v1.2.3