diff options
-rw-r--r-- | src/game.cpp | 31 | ||||
-rw-r--r-- | src/gui/inventory.cpp | 6 |
2 files changed, 26 insertions, 11 deletions
diff --git a/src/game.cpp b/src/game.cpp index b372518a..01a155a6 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -607,6 +607,19 @@ void do_parse() { for (int loop = 0; loop < (RFIFOW(2) - 4) / 20; loop++) { inventoryWindow->addItem(RFIFOW(4 + loop * 20), RFIFOW(4 + loop * 20 + 2), 1, true); + char info[40]; + sprintf(info, "a4 %i %i %i %i %i %i %i %i", + RFIFOW(4+loop*20), RFIFOW(4+loop*20+2), + RFIFOB(4+loop*20+4), RFIFOB(4+loop*20+5), + RFIFOW(4+loop*20+6), RFIFOW(4+loop*20+8), + RFIFOB(4+loop*20+10), RFIFOB(4+loop*20+11)); + chatBox->chat_log(info, BY_SERVER); + if(RFIFOW(4+loop*20+8)) { + equipmentWindow->addEquipment(RFIFOB(4+loop*20), + RFIFOW(4+loop*20+2)); + inventoryWindow->items->setEquipped( + RFIFOW(4+loop*20), true); + } } break; // Can I use the item? @@ -931,7 +944,7 @@ void do_parse() { // MVP experience case 0x010b: break; - // Display MVP payer + // Display MVP player case 0x010c: chatBox->chat_log("MVP player", BY_SERVER); break; @@ -976,19 +989,25 @@ void do_parse() { case 0x00aa: if (RFIFOB(6) == 0) chatBox->chat_log("Unable to equip.", BY_SERVER); - else - inventoryWindow->items->setEquipped( - inventoryWindow->items->getIndex(), true); + else { + inventoryWindow->items->setEquipped(RFIFOW(2), true); + equipmentWindow->addEquipment(RFIFOW(2), + inventoryWindow->items->getId(RFIFOW(2))); + } break; // Equipment related case 0x01d7: /*char content[40]; sprintf(content, "%i %i %i", RFIFOB(6), RFIFOW(7), RFIFOW(9)); chatBox->chat_log(content, BY_SERVER);*/ - equipmentWindow->addEquipment(RFIFOB(6), RFIFOW(7)); + /*equipmentWindow->addEquipment(RFIFOB(6), RFIFOW(7)); if(inventoryWindow->items->getIndex(RFIFOW(7))); inventoryWindow->items->setEquipped( - inventoryWindow->items->getIndex(RFIFOW(7)), true); + inventoryWindow->items->getIndex(RFIFOW(7)), true);*/ + char info[40]; + sprintf(info, "1d7 %i %i %i %i", RFIFOL(2), RFIFOB(6), + RFIFOW(7), RFIFOW(9)); + chatBox->chat_log(info, BY_SERVER); break; // Answer to unequip item case 0x00ac: diff --git a/src/gui/inventory.cpp b/src/gui/inventory.cpp index 67d6fecb..d891db48 100644 --- a/src/gui/inventory.cpp +++ b/src/gui/inventory.cpp @@ -49,9 +49,7 @@ InventoryWindow::InventoryWindow(): items = new ItemContainer(); items->setSize(318, 40); items->setPosition(2, 2); - add(items); - - + add(items); } InventoryWindow::~InventoryWindow() @@ -140,8 +138,6 @@ void InventoryWindow::action(const std::string &eventId) if(items->isEquipment(items->getIndex())) { if(items->isEquipped(items->getIndex())) { unequipItem(items->getIndex()); - std::cout << "Blah\n"; - } else { equipItem(items->getIndex()); |