diff options
| -rw-r--r-- | engines/adl/adl.cpp | 15 | ||||
| -rw-r--r-- | engines/adl/adl.h | 1 | ||||
| -rw-r--r-- | engines/adl/adl_v3.cpp | 12 | ||||
| -rw-r--r-- | engines/adl/adl_v3.h | 1 | 
4 files changed, 28 insertions, 1 deletions
| diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp index 98895ce8dd..fdbb2aa3b7 100644 --- a/engines/adl/adl.cpp +++ b/engines/adl/adl.cpp @@ -58,6 +58,7 @@ AdlEngine::AdlEngine(OSystem *syst, const AdlGameDescription *gd) :  		_graphics(nullptr),  		_isRestarting(false),  		_isRestoring(false), +		_skipOneCommand(false),  		_gameDescription(gd),  		_saveVerb(0),  		_saveNoun(0), @@ -1192,6 +1193,12 @@ bool AdlEngine::doOneCommand(const Commands &commands, byte verb, byte noun) {  	Commands::const_iterator cmd;  	for (cmd = commands.begin(); cmd != commands.end(); ++cmd) { + +		if (_skipOneCommand) { +			_skipOneCommand = false; +			continue; +		} +  		ScriptEnv env(*cmd, _state.room, verb, noun);  		if (matchCommand(env)) {  			doActions(env); @@ -1199,6 +1206,7 @@ bool AdlEngine::doOneCommand(const Commands &commands, byte verb, byte noun) {  		}  	} +	_skipOneCommand = false;  	return false;  } @@ -1206,6 +1214,11 @@ void AdlEngine::doAllCommands(const Commands &commands, byte verb, byte noun) {  	Commands::const_iterator cmd;  	for (cmd = commands.begin(); cmd != commands.end(); ++cmd) { +		if (_skipOneCommand) { +			_skipOneCommand = false; +			continue; +		} +  		ScriptEnv env(*cmd, _state.room, verb, noun);  		if (matchCommand(env)) {  			doActions(env); @@ -1214,6 +1227,8 @@ void AdlEngine::doAllCommands(const Commands &commands, byte verb, byte noun) {  				return;  		}  	} + +	_skipOneCommand = false;  }  Common::String AdlEngine::toAscii(const Common::String &str) { diff --git a/engines/adl/adl.h b/engines/adl/adl.h index e5fbf35d3b..06d378eac3 100644 --- a/engines/adl/adl.h +++ b/engines/adl/adl.h @@ -356,6 +356,7 @@ protected:  	State _state;  	bool _isRestarting, _isRestoring; +	bool _skipOneCommand;  private:  	virtual void runIntro() const { } diff --git a/engines/adl/adl_v3.cpp b/engines/adl/adl_v3.cpp index 608c22b871..e326b05af5 100644 --- a/engines/adl/adl_v3.cpp +++ b/engines/adl/adl_v3.cpp @@ -66,7 +66,7 @@ void AdlEngine_v3::setupOpcodeTables() {  	// 0x08  	Opcode(o3_isVarGT);  	Opcode(o1_isCurPicEQ); -	Opcode(o1_isItemPicEQ); +	Opcode(o3_skipOneCommand);  	SetOpcodeTable(_actOpcodes);  	// 0x00 @@ -122,4 +122,14 @@ int AdlEngine_v3::o3_isVarGT(ScriptEnv &e) {  	return -1;  } +// FIXME: Move to HiRes6 class? +int AdlEngine_v3::o3_skipOneCommand(ScriptEnv &e) { +	OP_DEBUG_0("\t&& SKIP_NEXT_COMMAND()"); + +	_skipOneCommand = true; +	setVar(2, 0); + +	return -1; +} +  } // End of namespace Adl diff --git a/engines/adl/adl_v3.h b/engines/adl/adl_v3.h index c0b7fad3a5..f99e0bd1e8 100644 --- a/engines/adl/adl_v3.h +++ b/engines/adl/adl_v3.h @@ -46,6 +46,7 @@ protected:  	virtual Common::String loadMessage(uint idx) const;  	int o3_isVarGT(ScriptEnv &e); +	int o3_skipOneCommand(ScriptEnv &e);  };  } // End of namespace Adl | 
