mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-02 14:51:40 +00:00
ZVISION: Implement indirect addressing in add()
Some ZGI scripts use action:add(14999, [...]) to add to the score. Without this, it would always add 0 instead. This affected the puzzles where you use the snapdragon and where you open the first time tunnel.
This commit is contained in:
parent
022a65ee52
commit
02a1552efe
@ -60,13 +60,15 @@ ResultAction::ResultAction(ZVision *engine, int32 slotKey) :
|
||||
ActionAdd::ActionAdd(ZVision *engine, int32 slotKey, const Common::String &line) :
|
||||
ResultAction(engine, slotKey) {
|
||||
_key = 0;
|
||||
_value = 0;
|
||||
|
||||
sscanf(line.c_str(), "%u,%d", &_key, &_value);
|
||||
char buf[64];
|
||||
memset(buf, 0, 64);
|
||||
sscanf(line.c_str(), "%u,%s", &_key, buf);
|
||||
_value = new ValueSlot(_scriptManager, buf);
|
||||
}
|
||||
|
||||
bool ActionAdd::execute() {
|
||||
_scriptManager->setStateValue(_key, _scriptManager->getStateValue(_key) + _value);
|
||||
_scriptManager->setStateValue(_key, _scriptManager->getStateValue(_key) + _value->getValue());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
|
||||
private:
|
||||
uint32 _key;
|
||||
int _value;
|
||||
ValueSlot *_value;
|
||||
};
|
||||
|
||||
class ActionAssign : public ResultAction {
|
||||
|
Loading…
x
Reference in New Issue
Block a user