From 87c59212f8590a8dd72fac3e320fcb2ada781355 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 11 May 2014 19:28:57 +0300 Subject: Move player attributes into separate file. --- src/gui/windows/shopwindow.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/gui/windows/shopwindow.cpp') diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index b44dcc19e..edd3efbc7 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -48,6 +48,7 @@ #include "soundconsts.h" #include "soundmanager.h" +#include "being/attributes.h" #include "being/localplayer.h" #include "being/playerinfo.h" #include "being/playerrelations.h" @@ -593,9 +594,9 @@ void ShopWindow::giveList(const std::string &nick, const int mode) { int amount = item->getQuantity(); if (item->getPrice() * amount > PlayerInfo::getAttribute( - PlayerInfo::MONEY)) + Attributes::MONEY)) { - amount = PlayerInfo::getAttribute(PlayerInfo::MONEY) + amount = PlayerInfo::getAttribute(Attributes::MONEY) / item->getPrice(); } @@ -655,9 +656,9 @@ void ShopWindow::showList(const std::string &nick, std::string data) return; if (buyDialog) - buyDialog->setMoney(PlayerInfo::getAttribute(PlayerInfo::MONEY)); + buyDialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY)); if (sellDialog) - sellDialog->setMoney(PlayerInfo::getAttribute(PlayerInfo::MONEY)); + sellDialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY)); for (unsigned f = 0; f < data.length(); f += 9) { -- cgit v1.2.3-70-g09d2