diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-19 22:38:59 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-19 23:37:36 +0100 |
commit | 363527d0f95963ba3f4a6d25c8eabc1bb3ad4efe (patch) | |
tree | 117ce95d3587f913a64b71fe4dcdee716b8aea7e /src/net/manaserv/inventoryhandler.cpp | |
parent | 432d16435774cafd630e287321e882f3e8510d16 (diff) | |
download | mana-363527d0f95963ba3f4a6d25c8eabc1bb3ad4efe.tar.gz mana-363527d0f95963ba3f4a6d25c8eabc1bb3ad4efe.tar.bz2 mana-363527d0f95963ba3f4a6d25c8eabc1bb3ad4efe.tar.xz mana-363527d0f95963ba3f4a6d25c8eabc1bb3ad4efe.zip |
Fixed a crash when trying to switch servers
Ownership of the charInfo global variable wasn't well defined. It was
being locked, unlocked and generally modified from a lot of places, and
somewhere in this mess it ended up crashing when switching servers.
Now the CharHandler instances, for eAthena and manaserv respectively,
own this list of characters. A new class, Net::Character wraps up the
slot index in combination with the player dummy. The list is passed on
to the CharSelectDialog each time it changes.
Both related and unrelated cleanups were made as well.
Reviewed-by: Jared Adams
Diffstat (limited to 'src/net/manaserv/inventoryhandler.cpp')
-rw-r--r-- | src/net/manaserv/inventoryhandler.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/net/manaserv/inventoryhandler.cpp b/src/net/manaserv/inventoryhandler.cpp index 0020a4e7..3ce1aa6f 100644 --- a/src/net/manaserv/inventoryhandler.cpp +++ b/src/net/manaserv/inventoryhandler.cpp @@ -61,7 +61,7 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) { case GPMSG_INVENTORY_FULL: player_node->clearInventory(); - player_node->mEquipment->setBackend(&mEqiups); + player_node->mEquipment->setBackend(&mEquips); // no break! case GPMSG_INVENTORY: @@ -77,7 +77,7 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) int id = msg.readInt16(); if (slot < EQUIPMENT_SIZE) { - mEqiups.setEquipment(slot, id); + mEquips.setEquipment(slot, id); } else if (slot >= 32 && slot < 32 + getSize(INVENTORY)) { @@ -105,7 +105,7 @@ void InventoryHandler::unequipItem(const Item *item) // Tidy equipment directly to avoid weapon still shown bug, for instance int equipSlot = item->getInvIndex(); logger->log("Unequipping %d", equipSlot); - mEqiups.setEquipment(equipSlot, 0); + mEquips.setEquipment(equipSlot, 0); } void InventoryHandler::useItem(const Item *item) |