From 5316951ba6e4403a388e49a1e23fc7858d1c3980 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 17 Apr 2016 23:09:06 -0400 Subject: TITANIC: Fix item debugger command to immediately show PET inventory --- engines/titanic/debugger.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/engines/titanic/debugger.cpp b/engines/titanic/debugger.cpp index e532a9b0f4..e02f1c8f64 100644 --- a/engines/titanic/debugger.cpp +++ b/engines/titanic/debugger.cpp @@ -210,6 +210,9 @@ bool Debugger::cmdPET(int argc, const char **argv) { } bool Debugger::cmdItem(int argc, const char **argv) { + CGameManager &gameManager = *g_vm->_window->_gameManager; + CGameState &gameState = gameManager._gameState; + if (argc == 1) { // No parameters, so list the available items debugPrintf("item [ [ add ]]\n"); @@ -243,11 +246,11 @@ bool Debugger::cmdItem(int argc, const char **argv) { debugPrintf("Current location: %s\n", fullName.c_str()); } else if (CString(argv[2]) == "add") { - CPetControl *pet = item->getPetControl(); - assert(pet); - - pet->_visible = true; + // Ensure the PET is active and add the item to the inventory + gameState._petActive = true; + gameManager.initBounds(); item->addToInventory(); + return false; } else { debugPrintf("Unknown command\n"); -- cgit v1.2.3