summaryrefslogtreecommitdiff
path: root/src/beingmanager.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-03-28 11:22:46 -0600
committerJared Adams <jaxad0127@gmail.com>2009-03-28 11:22:46 -0600
commitdf095c66fdf7af74849454dbf8c4c2284616ecd7 (patch)
treed078ea9ecffd75ab1b526993c5e18846bf501867 /src/beingmanager.cpp
parent42a095de15649f0f00ef6c681268d6623205900c (diff)
downloadmana-df095c66fdf7af74849454dbf8c4c2284616ecd7.tar.gz
mana-df095c66fdf7af74849454dbf8c4c2284616ecd7.tar.bz2
mana-df095c66fdf7af74849454dbf8c4c2284616ecd7.tar.xz
mana-df095c66fdf7af74849454dbf8c4c2284616ecd7.zip
Remove #ifdefs related to Being creation
Also move the Monster type offset handling into the eAthena netcode.
Diffstat (limited to 'src/beingmanager.cpp')
-rw-r--r--src/beingmanager.cpp33
1 files changed, 7 insertions, 26 deletions
diff --git a/src/beingmanager.cpp b/src/beingmanager.cpp
index 9c671808..8c07aaab 100644
--- a/src/beingmanager.cpp
+++ b/src/beingmanager.cpp
@@ -81,46 +81,27 @@ void BeingManager::setPlayer(LocalPlayer *player)
mBeings.push_back(player);
}
-#ifdef TMWSERV_SUPPORT
-Being *BeingManager::createBeing(int id, int type, int subtype)
-#else
-Being *BeingManager::createBeing(int id, Uint16 job)
-#endif
+Being *BeingManager::createBeing(int id, Being::Type type, int subtype)
{
Being *being;
-#ifdef TMWSERV_SUPPORT
switch (type)
{
- case OBJECT_PLAYER:
+ case Being::PLAYER:
being = new Player(id, subtype, mMap);
break;
- case OBJECT_NPC:
+ case Being::NPC:
being = new NPC(id, subtype, mMap);
break;
- case OBJECT_MONSTER:
+ case Being::MONSTER:
being = new Monster(id, subtype, mMap);
break;
+ case Being::UNKNOWN:
+ being = new Being(id, subtype, mMap);
+ break;
default:
assert(false);
}
-#else
- if (job <= 25 || (job >= 4001 && job <= 4049))
- being = new Player(id, job, mMap);
- else if (job >= 46 && job <= 1000)
- being = new NPC(id, job, mMap);
- else if (job > 1000 && job <= 2000)
- being = new Monster(id, job, mMap);
- else
- being = new Being(id, job, mMap);
-
- // Player or NPC
- if (job <= 1000 || (job >= 4001 && job <= 4049))
- {
- MessageOut outMsg(0x0094);
- outMsg.writeInt32(id);//readLong(2));
- }
-#endif
mBeings.push_back(being);
return being;