summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-08-22 16:07:11 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-08-22 16:07:11 +0000
commit10ebf4484985b98e9248c8de84b35af9b6e26d3a (patch)
tree29a1f79bd66505a80e4dfeda31230ed2df97798d /src/gui
parent353560a2829fb9b1d9d26121658ce83589c4f5ef (diff)
downloadmana-client-10ebf4484985b98e9248c8de84b35af9b6e26d3a.tar.gz
mana-client-10ebf4484985b98e9248c8de84b35af9b6e26d3a.tar.bz2
mana-client-10ebf4484985b98e9248c8de84b35af9b6e26d3a.tar.xz
mana-client-10ebf4484985b98e9248c8de84b35af9b6e26d3a.zip
Fixed an arithmetic exception in ItemShortcutContainer::draw.
Changed default sitting key back to 's'. Fixed a problem with all equipment being interpreted as weapon sprite.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/itemshortcutcontainer.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp
index d9ece8d0..1943ef93 100644
--- a/src/gui/itemshortcutcontainer.cpp
+++ b/src/gui/itemshortcutcontainer.cpp
@@ -33,6 +33,8 @@
#include "../utils/tostring.h"
ItemShortcutContainer::ItemShortcutContainer():
+ mGridWidth(1),
+ mGridHeight(1),
mItemClicked(false),
mItemMoved(NULL)
{
@@ -126,8 +128,8 @@ ItemShortcutContainer::setWidth(int width)
mGridWidth = 1;
}
- setHeight(((mMaxItems / mGridWidth) +
- (mMaxItems % mGridWidth > 0 ? 1 : 0)) * mBoxHeight);
+ setHeight((mMaxItems / mGridWidth +
+ (mMaxItems % mGridWidth > 0 ? 1 : 0)) * mBoxHeight);
mGridHeight = getHeight() / mBoxHeight;
if (mGridHeight < 1) {
@@ -213,7 +215,7 @@ ItemShortcutContainer::getIndexFromGrid(int pointX, int pointY) const
return -1;
}
const int index = ((pointY / mBoxHeight) * mGridWidth) +
- (pointX / mBoxWidth);
+ pointX / mBoxWidth;
if (index >= mMaxItems)
{
return -1;