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

dreammaster paulfgilbert at gmail.com
Sat May 2 23:53:43 UTC 2020


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

Summary:
1a2e3884ce ULTIMA4: Properly get combat focused character for actions
0d8cafe477 ULTIMA4: Combat locate action
2f8feda600 ULTIMA4: Combat ready weapon
f6646f26cc ULTIMA4: Move combat triggers key to debugger
fccc6e4cc6 ULTIMA4: Remainder of combat keypress code refactored


Commit: 1a2e3884ce976ea87da0a929c16135b455d225b6
    https://github.com/scummvm/scummvm/commit/1a2e3884ce976ea87da0a929c16135b455d225b6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-05-02T16:52:59-07:00

Commit Message:
ULTIMA4: Properly get combat focused character for actions

Changed paths:
    engines/ultima/ultima4/controllers/combat_controller.cpp
    engines/ultima/ultima4/core/debugger.cpp
    engines/ultima/ultima4/core/debugger.h
    engines/ultima/ultima4/core/debugger_actions.cpp
    engines/ultima/ultima4/core/debugger_actions.h


diff --git a/engines/ultima/ultima4/controllers/combat_controller.cpp b/engines/ultima/ultima4/controllers/combat_controller.cpp
index 6e9e0fb60d..a2e367f21c 100644
--- a/engines/ultima/ultima4/controllers/combat_controller.cpp
+++ b/engines/ultima/ultima4/controllers/combat_controller.cpp
@@ -56,8 +56,6 @@ namespace Ultima4 {
 
 CombatController *g_combat;
 
-extern void gameDestroyAllCreatures();
-
 /**
  * Returns true if 'map' points to a Combat Map
  */
@@ -864,11 +862,6 @@ bool CombatController::keyPressed(int key) {
 	bool endTurn = true;
 
 	switch (key) {
-	case 'g':
-		g_screen->screenMessage("Get Chest!\n");
-		g_debugger->getChest(_focus);
-		break;
-
 	case 'l':
 		if (settings._debug) {
 			Coords coords = getCurrentPlayer()->getCoords();
diff --git a/engines/ultima/ultima4/core/debugger.cpp b/engines/ultima/ultima4/core/debugger.cpp
index e7ac34f811..8eb0d56d78 100644
--- a/engines/ultima/ultima4/core/debugger.cpp
+++ b/engines/ultima/ultima4/core/debugger.cpp
@@ -62,7 +62,7 @@ Debugger::Debugger() : Shared::Debugger() {
 	registerCmd("enter", WRAP_METHOD(Debugger, cmdEnter));
 	registerCmd("exit", WRAP_METHOD(Debugger, cmdExit));
 	registerCmd("fire", WRAP_METHOD(Debugger, cmdFire));
-	registerCmd("get", WRAP_METHOD(Debugger, cmdGet));
+	registerCmd("get", WRAP_METHOD(Debugger, cmdGetChest));
 	registerCmd("hole", WRAP_METHOD(Debugger, cmdHoleUp));
 	registerCmd("ignite", WRAP_METHOD(Debugger, cmdIgnite));
 	registerCmd("interact", WRAP_METHOD(Debugger, cmdInteract));
@@ -205,7 +205,7 @@ void Debugger::getChest(int player) {
 	Common::String param = Common::String::format("%d", player);
 	const char *argv[2] = { "get", param.c_str() };
 
-	cmdGet(2, argv);
+	cmdGetChest(2, argv);
 }
 
 void Debugger::readyWeapon(int player) {
@@ -303,7 +303,9 @@ bool Debugger::cmdCastSpell(int argc, const char **argv) {
 		player = strToInt(argv[1]);
 
 	print("Cast Spell!");
-	if (player == -1) {
+	if (isCombat()) {
+		player = getCombatFocus();
+	} else if (player == -1) {
 		printN("Player: ");
 		player = gameGetPlayer(false, true);
 	}
@@ -546,10 +548,12 @@ bool Debugger::cmdFire(int argc, const char **argv) {
 	return isDebuggerActive();
 }
 
-bool Debugger::cmdGet(int argc, const char **argv) {
+bool Debugger::cmdGetChest(int argc, const char **argv) {
 	int player = -1;
 	if (argc == 2)
 		player = strToInt(argv[1]);
+	else if (isCombat())
+		player = getCombatFocus();
 
 	print("Get Chest!");
 
@@ -700,7 +704,7 @@ bool Debugger::cmdInteract(int argc, const char **argv) {
 		MapTile *tile = g_context->_location->_map->tileAt(g_context->_location->_coords, WITH_GROUND_OBJECTS);
 
 		if (tile->getTileType()->isChest())
-			return cmdGet(argc, argv);
+			return cmdGetChest(argc, argv);
 	}
 
 	// Otherwise default to search
diff --git a/engines/ultima/ultima4/core/debugger.h b/engines/ultima/ultima4/core/debugger.h
index 39e8a96902..8710b5178e 100644
--- a/engines/ultima/ultima4/core/debugger.h
+++ b/engines/ultima/ultima4/core/debugger.h
@@ -126,7 +126,7 @@ private:
 	/**
 	 * Get chest
 	 */
-	bool cmdGet(int argc, const char **argv);
+	bool cmdGetChest(int argc, const char **argv);
 
 	/**
 	 * Hole Up
@@ -380,7 +380,6 @@ private:
 	 * Set wind direction or locks the direction
 	 */
 	bool cmdWind(int argc, const char **argv);
-
 public:
 	bool _collisionOverride;
 public:
diff --git a/engines/ultima/ultima4/core/debugger_actions.cpp b/engines/ultima/ultima4/core/debugger_actions.cpp
index 299d4bfb38..db680957ab 100644
--- a/engines/ultima/ultima4/core/debugger_actions.cpp
+++ b/engines/ultima/ultima4/core/debugger_actions.cpp
@@ -483,5 +483,15 @@ void DebuggerActions::gameLordBritishCheckLevels() {
 	g_screen->screenMessage("\nWhat would thou\nask of me?\n");
 }
 
+bool DebuggerActions::isCombat() const {
+	return dynamic_cast<CombatController *>(eventHandler->getController()) != nullptr;
+}
+
+int DebuggerActions::getCombatFocus() const {
+	CombatController *cc = dynamic_cast<CombatController *>(eventHandler->getController());
+	assert(cc);
+	return cc->getFocus();
+}
+
 } // End of namespace Ultima4
 } // End of namespace Ultima
diff --git a/engines/ultima/ultima4/core/debugger_actions.h b/engines/ultima/ultima4/core/debugger_actions.h
index a1bf8bf6c4..b386774149 100644
--- a/engines/ultima/ultima4/core/debugger_actions.h
+++ b/engines/ultima/ultima4/core/debugger_actions.h
@@ -64,6 +64,16 @@ protected:
 	 * game screen if not
 	 */
 	virtual void printN(const char *fmt, ...) = 0;
+
+	/**
+	 * Returns true if combat is currently active
+	 */
+	bool isCombat() const;
+
+	/**
+	 * Returns currently focused character in combat mode
+	 */
+	int getCombatFocus() const;
 public:
 	virtual ~DebuggerActions() {}
 


Commit: 0d8cafe477f8963afb6da0b204d64fcd3bc37fb0
    https://github.com/scummvm/scummvm/commit/0d8cafe477f8963afb6da0b204d64fcd3bc37fb0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-05-02T16:52:59-07:00

Commit Message:
ULTIMA4: Combat locate action

Changed paths:
    engines/ultima/ultima4/controllers/combat_controller.cpp
    engines/ultima/ultima4/core/debugger.cpp


diff --git a/engines/ultima/ultima4/controllers/combat_controller.cpp b/engines/ultima/ultima4/controllers/combat_controller.cpp
index a2e367f21c..e078d72dbf 100644
--- a/engines/ultima/ultima4/controllers/combat_controller.cpp
+++ b/engines/ultima/ultima4/controllers/combat_controller.cpp
@@ -862,16 +862,6 @@ bool CombatController::keyPressed(int key) {
 	bool endTurn = true;
 
 	switch (key) {
-	case 'l':
-		if (settings._debug) {
-			Coords coords = getCurrentPlayer()->getCoords();
-			g_screen->screenMessage("\nLocation:\nx:%d\ny:%d\nz:%d\n", coords.x, coords.y, coords.z);
-			g_screen->screenPrompt();
-			valid = false;
-		} else
-			g_screen->screenMessage("Not here!\n");
-		break;
-
 	case 'r':
 		g_debugger->readyWeapon(getFocus());
 		break;
diff --git a/engines/ultima/ultima4/core/debugger.cpp b/engines/ultima/ultima4/core/debugger.cpp
index 8eb0d56d78..39a799acee 100644
--- a/engines/ultima/ultima4/core/debugger.cpp
+++ b/engines/ultima/ultima4/core/debugger.cpp
@@ -730,8 +730,16 @@ bool Debugger::cmdJimmy(int argc, const char **argv) {
 }
 
 bool Debugger::cmdLocate(int argc, const char **argv) {
-	// can't use sextant in dungeon or in combat
-	if (g_context->_location->_context & ~(CTX_DUNGEON | CTX_COMBAT)) {
+	// Normally Locate isn't allowed in combat, but allow for a special
+	// debug display if this command is explicitly run in the debugger
+	if (isCombat() && isDebuggerActive()) {
+		CombatController *cc = static_cast<CombatController *>(eventHandler->getController());
+		Coords coords = cc->getCurrentPlayer()->getCoords();
+		print("Location: x:%d, y:%d, z:%d", coords.x, coords.y, coords.z);
+		dontEndTurn();
+	}
+	// Otherwise can't use sextant in dungeon or in combat
+	else if (g_context->_location->_context & ~(CTX_DUNGEON | CTX_COMBAT)) {
 		if (g_ultima->_saveGame->_sextants >= 1)
 			print("Locate position\nwith sextant\n Latitude: %c'%c\"\nLongitude: %c'%c\"",
 				g_context->_location->_coords.y / 16 + 'A', g_context->_location->_coords.y % 16 + 'A',


Commit: 2f8feda6002cc32a9bb1aeeb0e26d10126056d1b
    https://github.com/scummvm/scummvm/commit/2f8feda6002cc32a9bb1aeeb0e26d10126056d1b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-05-02T16:52:59-07:00

Commit Message:
ULTIMA4: Combat ready weapon

Changed paths:
    engines/ultima/ultima4/controllers/combat_controller.cpp
    engines/ultima/ultima4/core/debugger.cpp
    engines/ultima/ultima4/core/debugger.h


diff --git a/engines/ultima/ultima4/controllers/combat_controller.cpp b/engines/ultima/ultima4/controllers/combat_controller.cpp
index e078d72dbf..38848e7c50 100644
--- a/engines/ultima/ultima4/controllers/combat_controller.cpp
+++ b/engines/ultima/ultima4/controllers/combat_controller.cpp
@@ -862,10 +862,6 @@ bool CombatController::keyPressed(int key) {
 	bool endTurn = true;
 
 	switch (key) {
-	case 'r':
-		g_debugger->readyWeapon(getFocus());
-		break;
-
 	case 't':
 		if (settings._debug && _map->isDungeonRoom()) {
 			Dungeon *dungeon = dynamic_cast<Dungeon *>(g_context->_location->_prev->_map);
diff --git a/engines/ultima/ultima4/core/debugger.cpp b/engines/ultima/ultima4/core/debugger.cpp
index 39a799acee..4f829463aa 100644
--- a/engines/ultima/ultima4/core/debugger.cpp
+++ b/engines/ultima/ultima4/core/debugger.cpp
@@ -208,14 +208,6 @@ void Debugger::getChest(int player) {
 	cmdGetChest(2, argv);
 }
 
-void Debugger::readyWeapon(int player) {
-	Common::String param = Common::String::format("%d", player);
-	const char *argv[2] = { "ready", param.c_str() };
-
-	cmdReadyWeapon(2, argv);
-}
-
-
 bool Debugger::cmdMove(int argc, const char **argv) {
 	Direction dir;
 
@@ -927,6 +919,8 @@ bool Debugger::cmdReadyWeapon(int argc, const char **argv) {
 	int player = -1;
 	if (argc == 2)
 		player = strToInt(argv[1]);
+	else if (isCombat())
+		player = getCombatFocus();
 
 	// get the player if not provided
 	if (player == -1) {
diff --git a/engines/ultima/ultima4/core/debugger.h b/engines/ultima/ultima4/core/debugger.h
index 8710b5178e..b4d2f462ee 100644
--- a/engines/ultima/ultima4/core/debugger.h
+++ b/engines/ultima/ultima4/core/debugger.h
@@ -392,11 +392,6 @@ public:
 	 * user. Otherwise, a non-negative player number is expected
 	 */
 	void getChest(int player = -2);
-
-	/**
-	 * Ready a weapon
-	 */
-	void readyWeapon(int player);
 };
 
 extern Debugger *g_debugger;


Commit: f6646f26cc3f9f2a71c055a488863df7ffdeb93f
    https://github.com/scummvm/scummvm/commit/f6646f26cc3f9f2a71c055a488863df7ffdeb93f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-05-02T16:53:00-07:00

Commit Message:
ULTIMA4: Move combat triggers key to debugger

Changed paths:
    engines/ultima/ultima4/controllers/combat_controller.cpp
    engines/ultima/ultima4/core/debugger.cpp
    engines/ultima/ultima4/core/debugger.h
    engines/ultima/ultima4/core/debugger_actions.h


diff --git a/engines/ultima/ultima4/controllers/combat_controller.cpp b/engines/ultima/ultima4/controllers/combat_controller.cpp
index 38848e7c50..1aab005a2b 100644
--- a/engines/ultima/ultima4/controllers/combat_controller.cpp
+++ b/engines/ultima/ultima4/controllers/combat_controller.cpp
@@ -862,31 +862,6 @@ bool CombatController::keyPressed(int key) {
 	bool endTurn = true;
 
 	switch (key) {
-	case 't':
-		if (settings._debug && _map->isDungeonRoom()) {
-			Dungeon *dungeon = dynamic_cast<Dungeon *>(g_context->_location->_prev->_map);
-			assert(dungeon);
-			Trigger *triggers = dungeon->_rooms[dungeon->_currentRoom]._triggers;
-			assert(triggers);
-			int i;
-
-			g_screen->screenMessage("Triggers!\n");
-
-			for (i = 0; i < 4; i++) {
-				g_screen->screenMessage("%.1d)xy tile xy xy\n", i + 1);
-				g_screen->screenMessage("  %.1X%.1X  %.3d %.1X%.1X %.1X%.1X\n",
-				              triggers[i].x, triggers[i].y,
-				              triggers[i]._tile,
-				              triggers[i]._changeX1, triggers[i]._changeY1,
-				              triggers[i].changeX2, triggers[i].changeY2);
-			}
-			g_screen->screenPrompt();
-			valid = false;
-
-		} else
-			g_screen->screenMessage("Not here!\n");
-		break;
-
 	case 'u':
 		g_screen->screenMessage("Use which item:\n");
 		g_context->_stats->setView(STATS_ITEMS);
diff --git a/engines/ultima/ultima4/core/debugger.cpp b/engines/ultima/ultima4/core/debugger.cpp
index 4f829463aa..ea49c4cabc 100644
--- a/engines/ultima/ultima4/core/debugger.cpp
+++ b/engines/ultima/ultima4/core/debugger.cpp
@@ -112,6 +112,7 @@ Debugger::Debugger() : Shared::Debugger() {
 	registerCmd("summon", WRAP_METHOD(Debugger, cmdSummon));
 	registerCmd("torch", WRAP_METHOD(Debugger, cmdTorch));
 	registerCmd("transport", WRAP_METHOD(Debugger, cmdTransport));
+	registerCmd("triggers", WRAP_METHOD(Debugger, cmdListTriggers));
 	registerCmd("up", WRAP_METHOD(Debugger, cmdUp));
 	registerCmd("down", WRAP_METHOD(Debugger, cmdDown));
 	registerCmd("virtue", WRAP_METHOD(Debugger, cmdVirtue));
@@ -154,6 +155,11 @@ void Debugger::printN(const char *fmt, ...) {
 	}
 }
 
+void Debugger::prompt() {
+	if (isDebuggerActive())
+		g_screen->screenPrompt();
+}
+
 bool Debugger::handleCommand(int argc, const char **argv, bool &keepRunning) {
 	static const char *DUNGEON_DISALLOWED[] = {
 		"attack", "board", "enter", "fire", "jimmy", "locate",
@@ -1756,5 +1762,37 @@ bool Debugger::cmdWind(int argc, const char **argv) {
 	return false;
 }
 
+bool Debugger::cmdListTriggers(int argc, const char **argv) {
+	CombatMap *map = nullptr;
+
+	if (isCombat() && (map = static_cast<CombatController *>(
+			eventHandler->getController())->getMap()) != nullptr
+			&& map->isDungeonRoom()) {
+		Dungeon *dungeon = dynamic_cast<Dungeon *>(g_context->_location->_prev->_map);
+		assert(dungeon);
+		Trigger *triggers = dungeon->_rooms[dungeon->_currentRoom]._triggers;
+		assert(triggers);
+		int i;
+
+		print("Triggers!");
+
+		for (i = 0; i < 4; i++) {
+			print("%.1d)xy tile xy xy", i + 1);
+			print("  %.1X%.1X  %.3d %.1X%.1X %.1X%.1X",
+				triggers[i].x, triggers[i].y,
+				triggers[i]._tile,
+				triggers[i]._changeX1, triggers[i]._changeY1,
+				triggers[i].changeX2, triggers[i].changeY2);
+		}
+		prompt();
+		dontEndTurn();
+
+	} else {
+		print("Not here!");
+	}
+
+	return isDebuggerActive();
+}
+
 } // End of namespace Ultima4
 } // End of namespace Ultima
diff --git a/engines/ultima/ultima4/core/debugger.h b/engines/ultima/ultima4/core/debugger.h
index b4d2f462ee..1f0b567a0e 100644
--- a/engines/ultima/ultima4/core/debugger.h
+++ b/engines/ultima/ultima4/core/debugger.h
@@ -65,6 +65,11 @@ protected:
 	 */
 	void printN(const char *fmt, ...) override;
 
+	/**
+	 * Prompts for input, but only if debugger isn't running
+	 */
+	void prompt() override;
+
 	/**
 	 * Gets the direction for an action
 	 */
@@ -380,6 +385,11 @@ private:
 	 * Set wind direction or locks the direction
 	 */
 	bool cmdWind(int argc, const char **argv);
+
+	/**
+	 * Lists the triggers in a dungeon room
+	 */
+	bool cmdListTriggers(int argc, const char **argv);
 public:
 	bool _collisionOverride;
 public:
diff --git a/engines/ultima/ultima4/core/debugger_actions.h b/engines/ultima/ultima4/core/debugger_actions.h
index b386774149..1db72c4a17 100644
--- a/engines/ultima/ultima4/core/debugger_actions.h
+++ b/engines/ultima/ultima4/core/debugger_actions.h
@@ -65,6 +65,11 @@ protected:
 	 */
 	virtual void printN(const char *fmt, ...) = 0;
 
+	/**
+	 * Prompts for input, but only if debugger isn't running
+	 */
+	virtual void prompt() = 0;
+
 	/**
 	 * Returns true if combat is currently active
 	 */


Commit: fccc6e4cc6a7abcf24bff8a699c55a109137f76d
    https://github.com/scummvm/scummvm/commit/fccc6e4cc6a7abcf24bff8a699c55a109137f76d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-05-02T16:53:00-07:00

Commit Message:
ULTIMA4: Remainder of combat keypress code refactored

Changed paths:
    engines/ultima/ultima4/controllers/combat_controller.cpp
    engines/ultima/ultima4/controllers/combat_controller.h
    engines/ultima/ultima4/core/debugger.cpp


diff --git a/engines/ultima/ultima4/controllers/combat_controller.cpp b/engines/ultima/ultima4/controllers/combat_controller.cpp
index 1aab005a2b..fcc9dc8acb 100644
--- a/engines/ultima/ultima4/controllers/combat_controller.cpp
+++ b/engines/ultima/ultima4/controllers/combat_controller.cpp
@@ -857,92 +857,6 @@ void CombatController::keybinder(KeybindingAction action) {
 	MetaEngine::executeAction(action);
 }
 
-bool CombatController::keyPressed(int key) {
-	bool valid = true;
-	bool endTurn = true;
-
-	switch (key) {
-	case 'u':
-		g_screen->screenMessage("Use which item:\n");
-		g_context->_stats->setView(STATS_ITEMS);
-#ifdef IOS_ULTIMA4
-		U4IOS::IOSConversationHelper::setIntroString("Use which item?");
-#endif
-		g_items->itemUse(gameGetInput().c_str());
-		break;
-
-	case 'v':
-		if (g_music->toggle())
-			g_screen->screenMessage("Volume On!\n");
-		else
-			g_screen->screenMessage("Volume Off!\n");
-		endTurn = false;
-		break;
-
-	case 'z': {
-		g_context->_stats->setView(StatsView(STATS_CHAR1 + getFocus()));
-
-		/* reset the spell mix menu and un-highlight the current item,
-		   and hide reagents that you don't have */
-		g_context->_stats->resetReagentsMenu();
-
-		g_screen->screenMessage("Ztats\n");
-		ZtatsController ctrl;
-		eventHandler->pushController(&ctrl);
-		ctrl.waitFor();
-	}
-	break;
-
-	case 'b':
-	case 'e':
-	case 'd':
-	case 'f':
-	case 'h':
-	case 'i':
-	case 'j':
-	case 'k':
-	case 'm':
-	case 'n':
-	case 'o':
-	case 'p':
-	case 'q':
-	case 's':
-	case 'w':
-	case 'x':
-	case 'y':
-		g_screen->screenMessage("Not here!\n");
-		break;
-
-	case '0':
-	case '1':
-	case '2':
-	case '3':
-	case '4':
-	case '5':
-	case '6':
-	case '7':
-	case '8':
-	case '9':
-		if (settings._enhancements && settings._enhancementsOptions._activePlayer)
-			gameSetActivePlayer(key - '1');
-		else g_screen->screenMessage("Bad command\n");
-
-		break;
-
-	default:
-		valid = false;
-		break;
-	}
-
-	if (valid) {
-		g_context->_lastCommandTime = g_system->getMillis();
-		if (endTurn && (eventHandler->getController() == this))
-			g_context->_location->_turnCompleter->finishTurn();
-	}
-
-	return valid;
-}
-
 void CombatController::attack(Direction dir, int distance) {
 	g_screen->screenMessage("Dir: ");
 
diff --git a/engines/ultima/ultima4/controllers/combat_controller.h b/engines/ultima/ultima4/controllers/combat_controller.h
index 74372133d1..7206cdbb22 100644
--- a/engines/ultima/ultima4/controllers/combat_controller.h
+++ b/engines/ultima/ultima4/controllers/combat_controller.h
@@ -170,9 +170,7 @@ public:
 	static void attackFlash(const Coords &coords, const Common::String &tilename, int timeFactor);
 	static void doScreenAnimationsWhilePausing(int timeFactor);
 
-	// Key handlers
 	void keybinder(KeybindingAction action) override;
-	bool keyPressed(int key) override;
 
 	void finishTurn() override;
 
diff --git a/engines/ultima/ultima4/core/debugger.cpp b/engines/ultima/ultima4/core/debugger.cpp
index ea49c4cabc..56d3c2c69c 100644
--- a/engines/ultima/ultima4/core/debugger.cpp
+++ b/engines/ultima/ultima4/core/debugger.cpp
@@ -165,16 +165,26 @@ bool Debugger::handleCommand(int argc, const char **argv, bool &keepRunning) {
 		"attack", "board", "enter", "fire", "jimmy", "locate",
 		"open", "talk", "exit", "yell", nullptr
 	};
+	static const char *COMBAT_DISALLOWED[] = {
+		"board", "climb", "descend", "enter", "exit", "fire", "hole",
+		"ignite", "jimmy", "mix", "order", "open", "peer", "quitAndSave",
+		"search", "use", "wear", "yell", nullptr
+	};
 
-	if (g_context && (g_context->_location->_context & CTX_DUNGEON)) {
-		Common::String method = argv[0];
-
-		for (const char *const *mth = DUNGEON_DISALLOWED; *mth; ++mth) {
-			if (method.equalsIgnoreCase(*mth)) {
-				print("%cNot here!%c", FG_GREY, FG_WHITE);
-				g_game->finishTurn();
-				keepRunning = false;
-				return true;
+	if (g_context && g_context->_location) {
+		int ctx = g_context->_location->_context;
+		if (ctx & (CTX_DUNGEON | CTX_COMBAT)) {
+			Common::String method = argv[0];
+			const char *const *mth = (ctx & CTX_COMBAT) ?
+				COMBAT_DISALLOWED : DUNGEON_DISALLOWED;
+
+			for (; *mth; ++mth) {
+				if (method.equalsIgnoreCase(*mth)) {
+					print("%cNot here!%c", FG_GREY, FG_WHITE);
+					g_game->finishTurn();
+					keepRunning = false;
+					return true;
+				}
 			}
 		}
 	}
@@ -1073,6 +1083,8 @@ bool Debugger::cmdStats(int argc, const char **argv) {
 	int player = -1;
 	if (argc == 2)
 		player = strToInt(argv[1]);
+	else if (isCombat())
+		player = getCombatFocus();
 
 	// get the player if not provided
 	if (player == -1) {
@@ -1080,6 +1092,8 @@ bool Debugger::cmdStats(int argc, const char **argv) {
 		player = gameGetPlayer(true, false);
 		if (player == -1)
 			return isDebuggerActive();
+	} else {
+		print("Ztats");
 	}
 
 	// Reset the reagent spell mix menu by removing




More information about the Scummvm-git-logs mailing list