From fd050698f74b5dc7a9867bc93ba6b7c65ef2462f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 17 Sep 2014 10:55:20 +0300 Subject: Remove getter for inventoryHandler. --- src/being/localplayer.cpp | 2 +- src/being/playerinfo.cpp | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/being') diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index aa92cf6d7..f01a3171a 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -2925,7 +2925,7 @@ void LocalPlayer::imitateOutfit(const Being *const player, else { // logger->log("have unequip %d", sprite); - const int equipmentSlot = Net::getInventoryHandler() + const int equipmentSlot = inventoryHandler ->convertFromServerSlot(sprite); // logger->log("equipmentSlot: " + toString(equipmentSlot)); if (equipmentSlot == ItemSlot::PROJECTILE_SLOT) diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp index b84fb72a9..3768b6e35 100644 --- a/src/being/playerinfo.cpp +++ b/src/being/playerinfo.cpp @@ -188,7 +188,7 @@ Inventory *getInventory() Inventory *getStorageInventory() { - return Net::getInventoryHandler()->getStorage(); + return inventoryHandler->getStorage(); } void clearInventory() @@ -233,21 +233,21 @@ void equipItem(const Item *const item, const bool sfx) { if (sfx) ItemSoundManager::playSfx(item, ItemSoundEvent::EQUIP); - Net::getInventoryHandler()->equipItem(item); + inventoryHandler->equipItem(item); } void unequipItem(const Item *const item, const bool sfx) { if (sfx) ItemSoundManager::playSfx(item, ItemSoundEvent::UNEQUIP); - Net::getInventoryHandler()->unequipItem(item); + inventoryHandler->unequipItem(item); } void useItem(const Item *const item, const bool sfx) { if (sfx) ItemSoundManager::playSfx(item, ItemSoundEvent::USE); - Net::getInventoryHandler()->useItem(item); + inventoryHandler->useItem(item); } void useEquipItem(const Item *const item, const bool sfx) @@ -260,20 +260,20 @@ void useEquipItem(const Item *const item, const bool sfx) { if (sfx) ItemSoundManager::playSfx(item, ItemSoundEvent::UNEQUIP); - Net::getInventoryHandler()->unequipItem(item); + inventoryHandler->unequipItem(item); } else { if (sfx) ItemSoundManager::playSfx(item, ItemSoundEvent::EQUIP); - Net::getInventoryHandler()->equipItem(item); + inventoryHandler->equipItem(item); } } else { if (mProtectedItems.find(item->getId()) == mProtectedItems.end()) { - Net::getInventoryHandler()->useItem(item); + inventoryHandler->useItem(item); if (sfx) ItemSoundManager::playSfx(item, ItemSoundEvent::USE); } @@ -291,13 +291,13 @@ void useEquipItem2(const Item *const item, const bool sfx) { if (sfx) ItemSoundManager::playSfx(item, ItemSoundEvent::UNEQUIP); - Net::getInventoryHandler()->unequipItem(item); + inventoryHandler->unequipItem(item); } else { if (sfx) ItemSoundManager::playSfx(item, ItemSoundEvent::EQUIP); - Net::getInventoryHandler()->equipItem(item); + inventoryHandler->equipItem(item); } } else @@ -306,7 +306,7 @@ void useEquipItem2(const Item *const item, const bool sfx) { if (sfx) ItemSoundManager::playSfx(item, ItemSoundEvent::USE); - Net::getInventoryHandler()->useItem(item); + inventoryHandler->useItem(item); } } } @@ -318,7 +318,7 @@ void dropItem(const Item *const item, const int amount, const bool sfx) { if (sfx) ItemSoundManager::playSfx(item, ItemSoundEvent::DROP); - Net::getInventoryHandler()->dropItem(item, amount); + inventoryHandler->dropItem(item, amount); } } -- cgit v1.2.3-70-g09d2