diff options
author | Marisa-Chan | 2013-11-07 16:46:54 +0700 |
---|---|---|
committer | Marisa-Chan | 2013-11-07 16:46:54 +0700 |
commit | b635fab6e663b0fac154d4fa75d221db4aabb1f5 (patch) | |
tree | e1cc84630c2d9f6fbdc19754af02d4dff71e1e24 /engines | |
parent | 5da10e99b25bfd866b1ef73cadee71bf9b825c52 (diff) | |
download | scummvm-rg350-b635fab6e663b0fac154d4fa75d221db4aabb1f5.tar.gz scummvm-rg350-b635fab6e663b0fac154d4fa75d221db4aabb1f5.tar.bz2 scummvm-rg350-b635fab6e663b0fac154d4fa75d221db4aabb1f5.zip |
ZVISION: ActionAssign value can be another slot, ValueSlot must be used.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/actions.cpp | 12 | ||||
-rw-r--r-- | engines/zvision/actions.h | 3 |
2 files changed, 12 insertions, 3 deletions
diff --git a/engines/zvision/actions.cpp b/engines/zvision/actions.cpp index 3dd6382060..4fe288d228 100644 --- a/engines/zvision/actions.cpp +++ b/engines/zvision/actions.cpp @@ -61,11 +61,19 @@ bool ActionAdd::execute() { ActionAssign::ActionAssign(ZVision *engine, const Common::String &line) : ResultAction(engine) { - sscanf(line.c_str(), "%*[^(](%u, %u)", &_key, &_value); + char buf[64]; + memset(buf, 0, 64); + sscanf(line.c_str(), "%*[^(](%u, %s)", &_key, buf); + _value = new ValueSlot(_engine->getScriptManager(), buf); +} + +ActionAssign::~ActionAssign() { + if (_value) + delete _value; } bool ActionAssign::execute() { - _engine->getScriptManager()->setStateValue(_key, _value); + _engine->getScriptManager()->setStateValue(_key, _value->getValue()); return true; } diff --git a/engines/zvision/actions.h b/engines/zvision/actions.h index 7464d83b09..1d7a815819 100644 --- a/engines/zvision/actions.h +++ b/engines/zvision/actions.h @@ -100,11 +100,12 @@ private: class ActionAssign : public ResultAction { public: ActionAssign(ZVision *engine, const Common::String &line); + ~ActionAssign(); bool execute(); private: uint32 _key; - uint _value; + ValueSlot *_value; }; class ActionAttenuate : public ResultAction { |