diff options
Diffstat (limited to 'engines/mohawk')
-rw-r--r-- | engines/mohawk/livingbooks_code.cpp | 10 | ||||
-rw-r--r-- | engines/mohawk/livingbooks_code.h | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp index 3b2941a6f4..298569c050 100644 --- a/engines/mohawk/livingbooks_code.cpp +++ b/engines/mohawk/livingbooks_code.cpp @@ -858,7 +858,7 @@ CodeCommandInfo generalCommandInfo[NUM_GENERAL_COMMANDS] = { { "traceRect", 0 }, { "sqrt", 0 }, // 0x20 - { "deleteVar", 0 }, + { "deleteVar", &LBCode::cmdDeleteVar }, { "saveVars", 0 }, { "scriptLink", 0 }, { "setViewOrigin", &LBCode::cmdUnimplemented }, @@ -1279,6 +1279,14 @@ void LBCode::cmdGetProperty(const Common::Array<LBValue> ¶ms) { _stack.push(target->_variables[name]); } +void LBCode::cmdDeleteVar(const Common::Array<LBValue> ¶ms) { + if (params.size() != 1) + error("incorrect number of parameters (%d) to deleteVar", params.size()); + + const Common::String &string = params[0].toString(); + _vm->_variables.erase(string); +} + void LBCode::cmdExec(const Common::Array<LBValue> ¶ms) { if (params.size() != 1) error("incorrect number of parameters (%d) to exec", params.size()); diff --git a/engines/mohawk/livingbooks_code.h b/engines/mohawk/livingbooks_code.h index b6b38b61fc..c9d62ff799 100644 --- a/engines/mohawk/livingbooks_code.h +++ b/engines/mohawk/livingbooks_code.h @@ -275,6 +275,7 @@ public: void cmdDeleteAt(const Common::Array<LBValue> ¶ms); void cmdSetProperty(const Common::Array<LBValue> ¶ms); void cmdGetProperty(const Common::Array<LBValue> ¶ms); + void cmdDeleteVar(const Common::Array<LBValue> ¶ms); void cmdExec(const Common::Array<LBValue> ¶ms); void cmdReturn(const Common::Array<LBValue> ¶ms); void cmdSetPlayParams(const Common::Array<LBValue> ¶ms); |