summaryrefslogtreecommitdiff
path: root/src/gui/itemcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/itemcontainer.cpp')
-rw-r--r--src/gui/itemcontainer.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp
index 8139e85e..8a780eb4 100644
--- a/src/gui/itemcontainer.cpp
+++ b/src/gui/itemcontainer.cpp
@@ -1,9 +1,8 @@
/*
- * Aethyra
+ * The Mana World
* Copyright (C) 2004 The Mana World Development Team
*
- * This file is part of Aethyra based on original code
- * from The Mana World.
+ * This file is part of The Mana World.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -51,7 +50,7 @@ ItemContainer::ItemContainer(Inventory *inventory, int offset):
mLastSelectedItemId(NO_ITEM),
mOffset(offset)
{
- mItemPopup = new ItemPopup();
+ mItemPopup = new ItemPopup;
mItemPopup->setOpaque(false);
ResourceManager *resman = ResourceManager::getInstance();
@@ -171,7 +170,6 @@ void ItemContainer::refindSelectedItem()
{
if (mSelectedItemIndex != NO_ITEM)
{
-
if (mInventory->getItem(mSelectedItemIndex) &&
mInventory->getItem(mSelectedItemIndex)->getId() == mLastSelectedItemId)
return; // we're already fine
@@ -204,6 +202,7 @@ void ItemContainer::setSelectedItemIndex(int index)
newSelectedItemIndex = NO_ITEM;
else
newSelectedItemIndex = index;
+
if (mSelectedItemIndex != newSelectedItemIndex)
{
mSelectedItemIndex = newSelectedItemIndex;
@@ -274,7 +273,7 @@ void ItemContainer::mouseExited(gcn::MouseEvent &event)
mItemPopup->setVisible(false);
}
-int ItemContainer::getSlotIndex(const int posX, const int posY) const
+int ItemContainer::getSlotIndex(int posX, int posY) const
{
int columns = getWidth() / gridWidth;
int index = posX / gridWidth + ((posY / gridHeight) * columns) + mOffset;