summaryrefslogtreecommitdiff
path: root/src/resources/monsterdb.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-05-17 21:58:00 -0600
committerJared Adams <jaxad0127@gmail.com>2010-05-17 22:00:17 -0600
commit36832f3a5378f739da7040f0711b7101dbc2af02 (patch)
treed53ccf51b07a1189465fd0d700ac95555515d4c6 /src/resources/monsterdb.cpp
parent3b4e7795c9ab3036988a1a7dfe6f5ed2ad12199d (diff)
downloadmana-36832f3a5378f739da7040f0711b7101dbc2af02.tar.gz
mana-36832f3a5378f739da7040f0711b7101dbc2af02.tar.bz2
mana-36832f3a5378f739da7040f0711b7101dbc2af02.tar.xz
mana-36832f3a5378f739da7040f0711b7101dbc2af02.zip
Add support for different target cursor sizes for NPCs
Moves the parsing logic for the size strings into BeingInfo to share the code. Reviewed-by: Freeyorp
Diffstat (limited to 'src/resources/monsterdb.cpp')
-rw-r--r--src/resources/monsterdb.cpp27
1 files changed, 4 insertions, 23 deletions
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp
index c70cee94..da89302d 100644
--- a/src/resources/monsterdb.cpp
+++ b/src/resources/monsterdb.cpp
@@ -23,14 +23,14 @@
#include "log.h"
+#include "net/net.h"
+
#include "resources/beinginfo.h"
#include "utils/dtor.h"
#include "utils/gettext.h"
#include "utils/xml.h"
-#include "net/net.h"
-
#define OLD_TMWATHENA_OFFSET 1002
namespace
@@ -74,27 +74,8 @@ void MonsterDB::load()
currentInfo->setName(XML::getProperty(monsterNode, "name", _("unnamed")));
- std::string targetCursor;
- targetCursor = XML::getProperty(monsterNode, "targetCursor", "medium");
- if (targetCursor == "small")
- {
- currentInfo->setTargetCursorSize(ActorSprite::TC_SMALL);
- }
- else if (targetCursor == "medium")
- {
- currentInfo->setTargetCursorSize(ActorSprite::TC_MEDIUM);
- }
- else if (targetCursor == "large")
- {
- currentInfo->setTargetCursorSize(ActorSprite::TC_LARGE);
- }
- else
- {
- logger->log("MonsterDB: Unknown target cursor type \"%s\" for %s -"
- "using medium sized one",
- targetCursor.c_str(), currentInfo->getName().c_str());
- currentInfo->setTargetCursorSize(ActorSprite::TC_MEDIUM);
- }
+ currentInfo->setTargetCursorSize(XML::getProperty(monsterNode,
+ "targetCursor", "medium"));
SpriteDisplay display;