1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-03 18:15:35 +00:00

use Class::getInventoryStore instead of casting ContainerStore.

This commit is contained in:
scrawl 2012-05-19 16:04:34 +02:00
parent 4fb30544d4
commit 2a4c55f1ab
2 changed files with 6 additions and 6 deletions

View file

@ -142,7 +142,7 @@ namespace MWGui
if (mDragAndDrop->mDraggedFrom != this)
{
// add item to the player's inventory
MWWorld::InventoryStore& invStore = static_cast<MWWorld::InventoryStore&>(MWWorld::Class::get(mContainer).getContainerStore(mContainer));
MWWorld::ContainerStore& invStore = MWWorld::Class::get(mContainer).getContainerStore(mContainer);
MWWorld::ContainerStoreIterator it = invStore.begin();
int origCount = ptr.getRefData().getCount();
@ -179,7 +179,7 @@ namespace MWGui
std::vector<MWWorld::Ptr> InventoryWindow::getEquippedItems()
{
MWWorld::InventoryStore& invStore = static_cast<MWWorld::InventoryStore&>(MWWorld::Class::get(mContainer).getContainerStore(mContainer));
MWWorld::InventoryStore& invStore = MWWorld::Class::get(mContainer).getInventoryStore(mContainer);
std::vector<MWWorld::Ptr> items;
@ -197,7 +197,7 @@ namespace MWGui
void InventoryWindow::_unequipItem(MWWorld::Ptr item)
{
MWWorld::InventoryStore& invStore = static_cast<MWWorld::InventoryStore&>(MWWorld::Class::get(mContainer).getContainerStore(mContainer));
MWWorld::InventoryStore& invStore = MWWorld::Class::get(mContainer).getInventoryStore(mContainer);
for (int slot=0; slot < MWWorld::InventoryStore::Slots; ++slot)
{
@ -231,7 +231,7 @@ namespace MWGui
int InventoryWindow::getPlayerGold()
{
MWWorld::InventoryStore& invStore = static_cast<MWWorld::InventoryStore&>(MWWorld::Class::get(mContainer).getContainerStore(mContainer));
MWWorld::InventoryStore& invStore = MWWorld::Class::get(mContainer).getInventoryStore(mContainer);
for (MWWorld::ContainerStoreIterator it = invStore.begin();
it != invStore.end(); ++it)

View file

@ -268,7 +268,7 @@ namespace MWGui
return items;
}
MWWorld::InventoryStore& invStore = static_cast<MWWorld::InventoryStore&>(MWWorld::Class::get(mContainer).getContainerStore(mContainer));
MWWorld::InventoryStore& invStore = MWWorld::Class::get(mContainer).getInventoryStore(mContainer);
for (int slot=0; slot < MWWorld::InventoryStore::Slots; ++slot)
{
@ -327,7 +327,7 @@ namespace MWGui
std::vector<MWWorld::Ptr> TradeWindow::itemsToIgnore()
{
std::vector<MWWorld::Ptr> items;
MWWorld::InventoryStore& invStore = static_cast<MWWorld::InventoryStore&>(MWWorld::Class::get(mContainer).getContainerStore(mContainer));
MWWorld::ContainerStore& invStore = MWWorld::Class::get(mContainer).getContainerStore(mContainer);
for (MWWorld::ContainerStoreIterator it = invStore.begin();
it != invStore.end(); ++it)