[Scummvm-cvs-logs] scummvm master -> 71a1c0a27f71b4ac3de790e2490b24a757d1e795

athrxx athrxx at scummvm.org
Sun Apr 21 13:18:13 CEST 2013


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

Summary:
e37a542cfe KYRA: (EOB) - add debugger function (list_monsters)
5d943f6f67 KYRA: (EOB) - minor cleanup
71a1c0a27f KYRA: (EOB) - fix bug #3611077


Commit: e37a542cfefd388dd2af2ef30e06d9b857155d73
    https://github.com/scummvm/scummvm/commit/e37a542cfefd388dd2af2ef30e06d9b857155d73
Author: athrxx (athrxx at scummvm.org)
Date: 2013-04-21T04:14:35-07:00

Commit Message:
KYRA: (EOB) - add debugger function (list_monsters)

Changed paths:
    engines/kyra/debugger.cpp
    engines/kyra/debugger.h



diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp
index 7598195..084c436 100644
--- a/engines/kyra/debugger.cpp
+++ b/engines/kyra/debugger.cpp
@@ -482,8 +482,9 @@ Debugger_EoB::Debugger_EoB(EoBCoreEngine *vm) : Debugger(vm), _vm(vm) {
 }
 
 void Debugger_EoB::initialize() {
-	DCmd_Register("import_savefile",         WRAP_METHOD(Debugger_EoB, cmd_importSaveFile));
-	DCmd_Register("save_original",      WRAP_METHOD(Debugger_EoB, cmd_saveOriginal));
+	DCmd_Register("import_savefile", WRAP_METHOD(Debugger_EoB, cmd_importSaveFile));
+	DCmd_Register("save_original", WRAP_METHOD(Debugger_EoB, cmd_saveOriginal));
+	DCmd_Register("list_monsters", WRAP_METHOD(Debugger_EoB, cmd_listMonsters));
 }
 
 bool Debugger_EoB::cmd_importSaveFile(int argc, const char **argv) {
@@ -558,6 +559,20 @@ bool Debugger_EoB::cmd_saveOriginal(int argc, const char **argv) {
 	return true;
 }
 
+bool Debugger_EoB::cmd_listMonsters(int, const char **) {
+	DebugPrintf("\nCurrent level: %d\n----------------------\n\n", _vm->_currentLevel);
+	DebugPrintf("Id        Type      Unit      Block     Position  Direction Sub Level Mode      Dst.block HP        Flags\n--------------------------------------------------------------------------------------------------------------\n");
+
+	for (int i = 0; i < 30; i++) {
+		EoBMonsterInPlay *m = &_vm->_monsters[i];
+		DebugPrintf("%.02d        %.02d        %.02d        0x%.04x    %d         %d         %d         %.02d        0x%.04x    %.03d/%.03d   0x%.02x\n", i, m->type, m->unit, m->block, m->pos, m->dir, m->sub, m->mode, m->dest, m->hitPointsCur, m->hitPointsMax, m->flags);
+	}
+
+	DebugPrintf("\n");
+
+	return true;
+}
+
 #endif // ENABLE_EOB
 
 } // End of namespace Kyra
diff --git a/engines/kyra/debugger.h b/engines/kyra/debugger.h
index e4ab391..d741e19 100644
--- a/engines/kyra/debugger.h
+++ b/engines/kyra/debugger.h
@@ -121,6 +121,7 @@ protected:
 
 	bool cmd_importSaveFile(int argc, const char **argv);
 	bool cmd_saveOriginal(int argc, const char **argv);
+	bool cmd_listMonsters(int argc, const char **argv);
 };
 #endif // ENABLE_EOB
 


Commit: 5d943f6f67bf31264ba4cd914cb34726502c8d41
    https://github.com/scummvm/scummvm/commit/5d943f6f67bf31264ba4cd914cb34726502c8d41
Author: athrxx (athrxx at scummvm.org)
Date: 2013-04-21T04:14:37-07:00

Commit Message:
KYRA: (EOB) - minor cleanup

Changed paths:
    engines/kyra/eob.cpp
    engines/kyra/eob.h
    engines/kyra/eobcommon.h
    engines/kyra/sprites_eob.cpp



diff --git a/engines/kyra/eob.cpp b/engines/kyra/eob.cpp
index 1fb4d0a..05b1e03 100644
--- a/engines/kyra/eob.cpp
+++ b/engines/kyra/eob.cpp
@@ -338,6 +338,14 @@ void EoBEngine::replaceMonster(int unit, uint16 block, int pos, int dir, int typ
 	}
 }
 
+bool EoBEngine::killMonsterExtra(EoBMonsterInPlay *m) {
+	if (m->type == 21) {
+		_playFinale = true;
+		_runFlag = false;
+	}
+	return true;
+}
+
 void EoBEngine::updateScriptTimersExtra() {
 	int cnt = 0;
 	for (int i = 1; i < 30; i++) {
diff --git a/engines/kyra/eob.h b/engines/kyra/eob.h
index bf5440b..b423b0d 100644
--- a/engines/kyra/eob.h
+++ b/engines/kyra/eob.h
@@ -74,6 +74,7 @@ private:
 
 	// Monsters
 	void replaceMonster(int unit, uint16 block, int d, int dir, int type, int shpIndex, int mode, int h2, int randItem, int fixedItem);
+	bool killMonsterExtra(EoBMonsterInPlay *m);
 	void updateScriptTimersExtra();
 
 	// Level
diff --git a/engines/kyra/eobcommon.h b/engines/kyra/eobcommon.h
index 1a74321..6421159 100644
--- a/engines/kyra/eobcommon.h
+++ b/engines/kyra/eobcommon.h
@@ -487,7 +487,7 @@ protected:
 	void placeMonster(EoBMonsterInPlay *m, uint16 block, int dir);
 	virtual void replaceMonster(int b, uint16 block, int pos, int dir, int type, int shpIndex, int mode, int h2, int randItem, int fixedItem) = 0;
 	void killMonster(EoBMonsterInPlay *m, bool giveExperience);
-	virtual bool killMonsterExtra(EoBMonsterInPlay *m);
+	virtual bool killMonsterExtra(EoBMonsterInPlay *m) = 0;
 	int countSpecificMonsters(int type);
 	void updateAttackingMonsterFlags();
 
diff --git a/engines/kyra/sprites_eob.cpp b/engines/kyra/sprites_eob.cpp
index 1d4c143..b96f2ec 100644
--- a/engines/kyra/sprites_eob.cpp
+++ b/engines/kyra/sprites_eob.cpp
@@ -213,20 +213,11 @@ void EoBCoreEngine::killMonster(EoBMonsterInPlay *m, bool giveExperience) {
 	if (killMonsterExtra(m)) {
 		placeMonster(m, 0, -1);
 
-		if ((_flags.gameID == GI_EOB1) && (m->type == 21)) {
-			_playFinale = true;
-			_runFlag = false;
-		}
-
 		if (m->mode == 8)
 			updateAttackingMonsterFlags();
 	}
 }
 
-bool EoBCoreEngine::killMonsterExtra(EoBMonsterInPlay *) {
-	return true;
-}
-
 int EoBCoreEngine::countSpecificMonsters(int type) {
 	int res = 0;
 	for (int i = 0; i < 30; i++) {


Commit: 71a1c0a27f71b4ac3de790e2490b24a757d1e795
    https://github.com/scummvm/scummvm/commit/71a1c0a27f71b4ac3de790e2490b24a757d1e795
Author: athrxx (athrxx at scummvm.org)
Date: 2013-04-21T04:14:39-07:00

Commit Message:
KYRA: (EOB) - fix bug #3611077

Changed paths:
    engines/kyra/darkmoon.cpp



diff --git a/engines/kyra/darkmoon.cpp b/engines/kyra/darkmoon.cpp
index 130fb10..a694a4a 100644
--- a/engines/kyra/darkmoon.cpp
+++ b/engines/kyra/darkmoon.cpp
@@ -243,6 +243,17 @@ void DarkMoonEngine::replaceMonster(int unit, uint16 block, int pos, int dir, in
 		if (_monsters[i].flags & 0x40)
 			continue;
 
+		// WORKAROUND for bug #3611077 (Dran's dragon transformation sequence triggered prematurely):
+		// The boss level and the mindflayer level share the same monster data. If you hang around
+		// long enough in the mindflayer level all 30 monster slots will be used up. When this
+		// happens it will trigger the dragon transformation sequence when Dran is moved around by script.
+		// We avoid removing Dran here by prefering monster slots occupied by monsters from another
+		// sub level.
+		if (_monsters[i].sub != _currentSub) {
+			index = i;
+			break;
+		}
+
 		int dist = getBlockDistance(_monsters[i].block, _currentBlock);
 
 		if (dist > maxDist) {
@@ -261,7 +272,10 @@ void DarkMoonEngine::replaceMonster(int unit, uint16 block, int pos, int dir, in
 }
 
 bool DarkMoonEngine::killMonsterExtra(EoBMonsterInPlay *m) {
-	if (_currentLevel == 16 && _currentSub == 1 && (_monsterProps[m->type].capsFlags & 4)) {
+	// WORKAROUND for bug #3611077 (see DarkMoonEngine::replaceMonster())
+	// The mindflayers have monster type 0, just like Dran. Using a monster slot occupied by a mindflayer would trigger the dragon transformation
+	// sequence when all 30 monster slots are used up. We avoid this by checking for m->sub == 1.
+	if (_currentLevel == 16 && _currentSub == 1 && m->sub == 1 && (_monsterProps[m->type].capsFlags & 4)) {
 		if (m->type) {
 			_playFinale = true;
 			_runFlag = false;






More information about the Scummvm-git-logs mailing list