[Scummvm-git-logs] scummvm master -> c5caf9825e0d02036795afa87f49b7aa274cc983

dreammaster dreammaster at scummvm.org
Fri Nov 24 13:02:05 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c5caf9825e XEEN: Load opcode messages needed by some opcodes


Commit: c5caf9825e0d02036795afa87f49b7aa274cc983
    https://github.com/scummvm/scummvm/commit/c5caf9825e0d02036795afa87f49b7aa274cc983
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-11-24T07:01:55-05:00

Commit Message:
XEEN: Load opcode messages needed by some opcodes

Changed paths:
    engines/xeen/scripts.cpp


diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index 6d74262..cb49586 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -340,6 +340,7 @@ void Scripts::openGrate(int wallVal, int action) {
 }
 
 bool Scripts::doOpcode(MazeEvent &event) {
+	Map &map = *_vm->_map;
 	typedef bool(Scripts::*ScriptMethodPtr)(ParamsIterator &);
 	static const ScriptMethodPtr COMMAND_LIST[] = {
 		&Scripts::cmdDoNothing, &Scripts::cmdDisplay1, &Scripts::cmdDoorTextSml,
@@ -367,6 +368,12 @@ bool Scripts::doOpcode(MazeEvent &event) {
 	};
 
 	_event = &event;
+
+	// Some opcodes use the first parameter as a message
+	int msgId = event._parameters.empty() ? 0 : event._parameters[0];
+	_message = msgId >= map._events._text.size() ? "" : map._events._text[msgId];
+
+	// Execute the opcode
 	ParamsIterator params = event._parameters.getIterator();
 	bool result = (this->*COMMAND_LIST[event._opcode])(params);
 	if (result)





More information about the Scummvm-git-logs mailing list