From a319f473f6502b4acd2b7da4aa5220a965335081 Mon Sep 17 00:00:00 2001 From: lukaslw Date: Tue, 24 Jun 2014 03:57:40 +0200 Subject: PRINCE: LMB outside of inventory - update --- engines/prince/prince.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'engines/prince/prince.cpp') diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index 7fefae9f5f..04901d78fa 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -1685,8 +1685,11 @@ void PrinceEngine::drawInvItems() { } void PrinceEngine::leftMouseButton() { + int option = 0; + if (_optionsFlag) { if (_optionEnabled < _optionsNumber) { + option = _optionEnabled; _optionsFlag = 0; // edi = optionsMob // ebp = optionsMobNumber @@ -1701,12 +1704,31 @@ void PrinceEngine::leftMouseButton() { // @@walkto - TODO return; } + option = 0; } //do_option // selectedMob = optionsMobNumber if (_currentPointerNumber != 2) { //skip_use_code - + int optionScriptOffset = _script->getOptionScript(_room->_walkTo, option); + int optionEvent; + if (optionScriptOffset != 0) { + optionEvent = _script->scanMobEvents(_optionsMob, optionScriptOffset); + } else { + optionEvent = -1; + } + if (optionEvent == -1) { + if (option == 0) { + //@@walkto - TODO + return; + } else { + optionEvent = _script->getOptionScript(_script->_scriptInfo.stdExamine, option - 1); + } + } + // eax <- return (int)READ_UINT16(&_data[optionEvent]); + // store_new_pc: + // storeNewPC(); + return; } else if (_selectedMode != 0) { //give_item -- cgit v1.2.3