aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/script_lol.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-07-20 09:27:39 -0400
committerMatthew Hoops2011-07-20 09:27:39 -0400
commitad293b249e74dd1cfbdbd721d02145efbdaf9eca (patch)
treee568d96f6d7f64c5e58b4c7cd1c4fda7e649bfc7 /engines/kyra/script_lol.cpp
parentd7411acc2b1c7702280dbff1c3e1bafee528184b (diff)
parente25e85fbb047fef895ede97c3c2c73451631052c (diff)
downloadscummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.tar.gz
scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.tar.bz2
scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.zip
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'engines/kyra/script_lol.cpp')
-rw-r--r--engines/kyra/script_lol.cpp34
1 files changed, 14 insertions, 20 deletions
diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp
index 695528b8d1..1afefcffa4 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);