diff options
author | Ľubomír Remák | 2018-03-09 21:24:02 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-25 23:12:01 +0200 |
commit | d3e281e24cb0ce522dc943b2d2a6bdde0766b62c (patch) | |
tree | 8f2c00acdadff4109451f4f0692de8b6b2f0d020 /engines/mutationofjb/commands | |
parent | b4dad9bca7593029ab368bc99f7bd96c71cbf4d8 (diff) | |
download | scummvm-rg350-d3e281e24cb0ce522dc943b2d2a6bdde0766b62c.tar.gz scummvm-rg350-d3e281e24cb0ce522dc943b2d2a6bdde0766b62c.tar.bz2 scummvm-rg350-d3e281e24cb0ce522dc943b2d2a6bdde0766b62c.zip |
MUTATIONOFJB: Fix uninitialized ChangeOperation, fix parsing tag in IF command and add some comments.
Diffstat (limited to 'engines/mutationofjb/commands')
-rw-r--r-- | engines/mutationofjb/commands/changecommand.cpp | 3 | ||||
-rw-r--r-- | engines/mutationofjb/commands/ifcommand.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/engines/mutationofjb/commands/changecommand.cpp b/engines/mutationofjb/commands/changecommand.cpp index e9bb9cc2e6..e4699ebb74 100644 --- a/engines/mutationofjb/commands/changecommand.cpp +++ b/engines/mutationofjb/commands/changecommand.cpp @@ -195,8 +195,9 @@ bool ChangeSceneCommandParser::parse(const Common::String &line, ScriptParseCont } int ChangeCommandParser::parseInteger(const char *val, ChangeCommand::ChangeOperation &op) { + op = ChangeCommand::SetValue; + if (!val || !(*val)) { - op = ChangeCommand::SetValue; return 0; } diff --git a/engines/mutationofjb/commands/ifcommand.cpp b/engines/mutationofjb/commands/ifcommand.cpp index 0643c3e161..a2816c7edd 100644 --- a/engines/mutationofjb/commands/ifcommand.cpp +++ b/engines/mutationofjb/commands/ifcommand.cpp @@ -64,7 +64,7 @@ bool IfCommandParser::parse(const Common::String &line, ScriptParseContext &pars } const char *const cstr = line.c_str(); - const char tag = cstr[2]; + const char tag = cstr[2] == ' ' ? 0 : cstr[2]; const uint8 sceneId = atoi(cstr + 3); const uint8 objectId = atoi(cstr + 6); const uint8 value = atoi(cstr + 9); |