From 9b30cad049d8f3ac9c63290331e73515d51c0260 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Fri, 30 Jul 2010 13:33:13 +0200 Subject: Fixed a little mistake done in Monster::setAttribute. It was using at() for setting. Also I changed the unsigned int to int as the default returned was -1 in the MonsterManager::reload() function. --- src/game-server/monster.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/game-server/monster.hpp b/src/game-server/monster.hpp index 86a69ac8..0d5d9688 100644 --- a/src/game-server/monster.hpp +++ b/src/game-server/monster.hpp @@ -98,13 +98,13 @@ class MonsterClass /** * Sets a being base attribute. */ - void setAttribute(size_t attribute, int value) - { mAttributes.at(attribute) = value; } + void setAttribute(int attribute, double value) + { mAttributes[attribute] = value; } /** * Returns a being base attribute. */ - int getAttribute(unsigned int attribute) const + double getAttribute(int attribute) const { return mAttributes.at(attribute); } /** Sets collision circle radius. */ @@ -181,7 +181,7 @@ class MonsterClass private: unsigned short mID; MonsterDrops mDrops; - std::map mAttributes; /**< Base attributes of the monster. */ + std::map mAttributes; /**< Base attributes of the monster. */ float mSpeed; /**< The monster class speed in tiles per second */ int mSize; int mExp; -- cgit v1.2.3-70-g09d2