diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-11-01 21:33:51 +0100 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-11-01 22:21:00 +0100 |
commit | 63ff01f1d53f2c362beb60fdba664efe19593131 (patch) | |
tree | 8ae409671e587fdb0263e8814ff8a614bec06884 /src/game-server/monster.hpp | |
parent | 6129e5bf1fe0128eb7742a7270e1264b65798bbb (diff) | |
download | manaserv-63ff01f1d53f2c362beb60fdba664efe19593131.tar.gz manaserv-63ff01f1d53f2c362beb60fdba664efe19593131.tar.bz2 manaserv-63ff01f1d53f2c362beb60fdba664efe19593131.tar.xz manaserv-63ff01f1d53f2c362beb60fdba664efe19593131.zip |
Prevented a crash in the monster loading code.
The server was trying to insert attributes value not in monster scope.
The monster code is to be rewritten anyway.
Resolves: Mana-Mantis #212.
Diffstat (limited to 'src/game-server/monster.hpp')
-rw-r--r-- | src/game-server/monster.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/game-server/monster.hpp b/src/game-server/monster.hpp index 0d5d9688..b25e9c17 100644 --- a/src/game-server/monster.hpp +++ b/src/game-server/monster.hpp @@ -107,6 +107,13 @@ class MonsterClass double getAttribute(int attribute) const { return mAttributes.at(attribute); } + /** + * Returns whether the monster has got the attribute. + */ + bool hasAttribute(int attribute) const + { return (mAttributes.find(attribute) != mAttributes.end()); } + + /** Sets collision circle radius. */ void setSize(int size) { mSize = size; } |