[Scummvm-cvs-logs] scummvm master -> 48e5bd36e9722d87787d077e34ca28a454cc14f1

athrxx athrxx at scummvm.org
Sun Jun 19 01:04:16 CEST 2011


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:
48e5bd36e9 LOL: fix bug reported on forum


Commit: 48e5bd36e9722d87787d077e34ca28a454cc14f1
    https://github.com/scummvm/scummvm/commit/48e5bd36e9722d87787d077e34ca28a454cc14f1
Author: athrxx (athrxx at scummvm.org)
Date: 2011-06-18T15:59:16-07:00

Commit Message:
LOL: fix bug reported on forum

In cases where the script failed to delete a certain character from the party (because that character was not a party member) it would add this character to the party instead. E.g. when returning to Gladstone without having picked up Timothy, he would get added to the party after the throne room scene. The same happened with Lora at the Draracle if she wasn't picked up on the way.

Changed paths:
    engines/kyra/lol.h
    engines/kyra/script_lol.cpp



diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h
index 943bb7f..06a4f29 100644
--- a/engines/kyra/lol.h
+++ b/engines/kyra/lol.h
@@ -717,7 +717,7 @@ private:
 	int olol_setScriptTimer(EMCState *script);
 	int olol_createHandItem(EMCState *script);
 	int olol_playAttackSound(EMCState *script);
-	int olol_characterJoinsParty(EMCState *script);
+	int olol_addRemoveCharacter(EMCState *script);
 	int olol_giveItem(EMCState *script);
 	int olol_loadTimScript(EMCState *script);
 	int olol_runTimScript(EMCState *script);
diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp
index 695528b..1afefcf 100644
--- a/engines/kyra/script_lol.cpp
+++ b/engines/kyra/script_lol.cpp
@@ -1088,33 +1088,27 @@ int LoLEngine::olol_playAttackSound(EMCState *script) {
 	return 1;
 }
 
-int LoLEngine::olol_characterJoinsParty(EMCState *script) {
-	debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_characterJoinsParty(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+int LoLEngine::olol_addRemoveCharacter(EMCState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_addRemoveCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
 
 	int16 id = stackPos(0);
-	if (id < 0)
+	if (id < 0) {
 		id = -id;
+		for (int i = 0; i < 4; i++) {
+			if (!(_characters[i].flags & 1) || _characters[i].id != id)
+				continue;
 
-	for (int i = 0; i < 4; i++) {
-		if (!(_characters[i].flags & 1) || _characters[i].id != id)
-			continue;
-
-		_characters[i].flags &= 0xfffe;
-		calcCharPortraitXpos();
+			_characters[i].flags &= 0xfffe;
+			calcCharPortraitXpos();
 
-		if (!_updateFlags) {
-			gui_enableDefaultPlayfieldButtons();
-			gui_drawPlayField();
+			if (_selectedCharacter == i)
+				_selectedCharacter = 0;
+			break;
 		}
-
-		if (_selectedCharacter == i)
-			_selectedCharacter = 0;
-
-		return 1;
+	} else {
+		addCharacter(id);
 	}
 
-	addCharacter(id);
-
 	if (!_updateFlags) {
 		gui_enableDefaultPlayfieldButtons();
 		gui_drawPlayField();
@@ -2823,7 +2817,7 @@ void LoLEngine::setupOpcodeTable() {
 	Opcode(olol_setScriptTimer);
 	Opcode(olol_createHandItem);
 	Opcode(olol_playAttackSound);
-	Opcode(olol_characterJoinsParty);
+	Opcode(olol_addRemoveCharacter);
 
 	// 0x4C
 	Opcode(olol_giveItem);






More information about the Scummvm-git-logs mailing list