summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-13 01:04:05 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-13 01:04:05 +0300
commitea0b61e18f36f28806940b00a2cddaef912c3340 (patch)
tree616205f44832d4ced4fc0b50b650eedb0fbf435c /src/net
parent814e88e5ca69bc54837be27429dbf42dd41f7ac6 (diff)
downloadplus-ea0b61e18f36f28806940b00a2cddaef912c3340.tar.gz
plus-ea0b61e18f36f28806940b00a2cddaef912c3340.tar.bz2
plus-ea0b61e18f36f28806940b00a2cddaef912c3340.tar.xz
plus-ea0b61e18f36f28806940b00a2cddaef912c3340.zip
Move actor type into separate file.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ea/beinghandler.cpp50
-rw-r--r--src/net/ea/chathandler.cpp4
-rw-r--r--src/net/ea/guildhandler.cpp6
-rw-r--r--src/net/ea/partyhandler.cpp4
-rw-r--r--src/net/eathena/beinghandler.cpp22
-rw-r--r--src/net/eathena/guildhandler.cpp2
-rw-r--r--src/net/eathena/partyhandler.cpp2
-rw-r--r--src/net/tmwa/beinghandler.cpp8
-rw-r--r--src/net/tmwa/guildhandler.cpp2
-rw-r--r--src/net/tmwa/partyhandler.cpp2
10 files changed, 51 insertions, 51 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index 34beab5ad..c983cfd9d 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -70,33 +70,33 @@ Being *BeingHandler::createBeing(const int id, const int16_t job) const
if (!actorManager)
return nullptr;
- ActorSprite::Type type = ActorSprite::UNKNOWN;
+ ActorType::Type type = ActorType::UNKNOWN;
if (job <= 25 || (job >= 4001 && job <= 4049))
- type = ActorSprite::PLAYER;
+ type = ActorType::PLAYER;
else if (job >= 46 && job <= 1000)
- type = ActorSprite::NPC;
+ type = ActorType::NPC;
else if (job > 1000 && job <= 2000)
- type = ActorSprite::MONSTER;
+ type = ActorType::MONSTER;
else if (job == 45)
- type = ActorSprite::PORTAL;
+ type = ActorType::PORTAL;
Being *const being = actorManager->createBeing(id, type, job);
- if (type == ActorSprite::PLAYER || type == ActorSprite::NPC)
+ if (type == ActorType::PLAYER || type == ActorType::NPC)
{
being->updateFromCache();
requestNameById(id);
if (player_node)
player_node->checkNewName(being);
}
- if (type == Being::PLAYER)
+ if (type == ActorType::PLAYER)
{
if (botCheckerWindow)
botCheckerWindow->updateList();
if (socialWindow)
socialWindow->updateActiveList();
}
- else if (type == Being::NPC)
+ else if (type == ActorType::NPC)
{
if (questsWindow)
questsWindow->addEffect(being);
@@ -141,7 +141,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
Being *dstBeing = actorManager->findBeing(id);
- if (dstBeing && dstBeing->getType() == Being::MONSTER
+ if (dstBeing && dstBeing->getType() == ActorType::MONSTER
&& !dstBeing->isAlive())
{
actorManager->destroy(dstBeing);
@@ -169,7 +169,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
}
else
{
- if (dstBeing->getType() == Being::NPC)
+ if (dstBeing->getType() == ActorType::NPC)
{
actorManager->undelete(dstBeing);
if (serverVersion < 1)
@@ -177,7 +177,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
}
}
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->setMoveTime();
if (spawnId)
@@ -198,7 +198,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
const int hairStyle = msg.readInt8();
const uint8_t look = msg.readInt8();
dstBeing->setSubtype(job, look);
- if (dstBeing->getType() == ActorSprite::MONSTER && player_node)
+ if (dstBeing->getType() == ActorType::MONSTER && player_node)
player_node->checkNewName(dstBeing);
dstBeing->setWalkSpeed(Vector(speed, speed, 0));
const uint16_t weapon = msg.readInt16();
@@ -215,7 +215,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
const uint16_t shoes = msg.readInt16(); // clothes color
uint16_t gloves;
- if (dstBeing->getType() == ActorSprite::MONSTER)
+ if (dstBeing->getType() == ActorType::MONSTER)
{
if (serverVersion > 0)
{
@@ -246,7 +246,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
msg.readInt16(); // manner
dstBeing->setStatusEffectBlock(32, msg.readInt16()); // opt3
- if (serverVersion > 0 && dstBeing->getType() == ActorSprite::MONSTER)
+ if (serverVersion > 0 && dstBeing->getType() == ActorType::MONSTER)
{
const int attackRange = msg.readInt8(); // karma
dstBeing->setAttackRange(attackRange);
@@ -257,7 +257,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
}
uint8_t gender = msg.readInt8();
- if (!disguiseId && dstBeing->getType() == ActorSprite::PLAYER)
+ if (!disguiseId && dstBeing->getType() == ActorType::PLAYER)
{
// reserving bits for future usage
gender &= 3;
@@ -275,7 +275,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
if (!mHideShield)
setSprite(dstBeing, EA_SPRITE_SHIELD, shield);
}
- else if (dstBeing->getType() == ActorSprite::NPC)
+ else if (dstBeing->getType() == ActorType::NPC)
{
switch (gender)
{
@@ -369,7 +369,7 @@ void BeingHandler::processBeingMove2(Net::MessageIn &msg) const
dstBeing->setAction(BeingAction::STAND, 0);
dstBeing->setTileCoords(srcX, srcY);
dstBeing->setDestination(dstX, dstY);
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->setMoveTime();
}
@@ -415,7 +415,7 @@ void BeingHandler::processBeingRemove(Net::MessageIn &msg) const
}
else
{
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
{
if (botCheckerWindow)
botCheckerWindow->updateList();
@@ -493,11 +493,11 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg) const
case Being::FLEE: // Lucky Dodge
if (srcBeing)
{
- if (srcSpeed && srcBeing->getType() == Being::PLAYER)
+ if (srcSpeed && srcBeing->getType() == ActorType::PLAYER)
srcBeing->setAttackDelay(srcSpeed);
// attackid=1, type
srcBeing->handleAttack(dstBeing, param1, 1);
- if (srcBeing->getType() == Being::PLAYER)
+ if (srcBeing->getType() == ActorType::PLAYER)
srcBeing->setAttackTime();
}
if (dstBeing)
@@ -517,7 +517,7 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg) const
if (srcBeing)
{
srcBeing->setAction(BeingAction::SIT, 0);
- if (srcBeing->getType() == Being::PLAYER)
+ if (srcBeing->getType() == ActorType::PLAYER)
{
srcBeing->setMoveTime();
if (player_node)
@@ -530,7 +530,7 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg) const
if (srcBeing)
{
srcBeing->setAction(BeingAction::STAND, 0);
- if (srcBeing->getType() == Being::PLAYER)
+ if (srcBeing->getType() == ActorType::PLAYER)
{
srcBeing->setMoveTime();
if (player_node)
@@ -568,7 +568,7 @@ void BeingHandler::processBeingSelfEffect(Net::MessageIn &msg) const
effectManager->trigger(effectType, being);
// +++ need dehard code effectType == 3
- if (effectType == 3 && being->getType() == Being::PLAYER
+ if (effectType == 3 && being->getType() == ActorType::PLAYER
&& socialWindow)
{ // reset received damage
socialWindow->resetDamage(being->getName());
@@ -593,7 +593,7 @@ void BeingHandler::processBeingEmotion(Net::MessageIn &msg) const
player_node->imitateEmote(dstBeing, emote);
}
}
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->setOtherTime();
}
@@ -617,7 +617,7 @@ void BeingHandler::processNameResponse(Net::MessageIn &msg) const
dstBeing->updateGuild();
dstBeing->addToCache();
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->updateColors();
if (player_node)
diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp
index 4ae292860..cc43de8cd 100644
--- a/src/net/ea/chathandler.cpp
+++ b/src/net/ea/chathandler.cpp
@@ -294,7 +294,7 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg,
std::string chatMsg = msg.readRawString(chatMsgLength);
- if (being->getType() == Being::PLAYER)
+ if (being->getType() == ActorType::PLAYER)
being->setTalkTime();
const size_t pos = chatMsg.find(" : ", 0);
@@ -309,7 +309,7 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg,
sender_name = "?";
}
else if (sender_name != being->getName()
- && being->getType() == Being::PLAYER)
+ && being->getType() == ActorType::PLAYER)
{
if (!being->getName().empty())
sender_name = being->getName();
diff --git a/src/net/ea/guildhandler.cpp b/src/net/ea/guildhandler.cpp
index fc1ef8def..18877c686 100644
--- a/src/net/ea/guildhandler.cpp
+++ b/src/net/ea/guildhandler.cpp
@@ -274,7 +274,7 @@ void GuildHandler::processGuildMemberList(Net::MessageIn &msg) const
if (actorManager)
{
Being *const being = actorManager->findBeingByName(
- name, Being::PLAYER);
+ name, ActorType::PLAYER);
if (being)
{
being->setGuildName(taGuild->getName());
@@ -476,7 +476,7 @@ void GuildHandler::processGuildLeave(Net::MessageIn &msg) const
if (actorManager)
{
Being *const b = actorManager->findBeingByName(
- nick, Being::PLAYER);
+ nick, ActorType::PLAYER);
if (b)
b->clearGuilds();
@@ -519,7 +519,7 @@ void GuildHandler::processGuildExpulsion(Net::MessageIn &msg) const
if (actorManager)
{
Being *const b = actorManager->findBeingByName(
- nick, Being::PLAYER);
+ nick, ActorType::PLAYER);
if (b)
b->clearGuilds();
diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp
index 32b08046e..a6476d4fa 100644
--- a/src/net/ea/partyhandler.cpp
+++ b/src/net/ea/partyhandler.cpp
@@ -222,7 +222,7 @@ void PartyHandler::processPartyInvited(Net::MessageIn &msg) const
const Being *const being = actorManager->findBeing(id);
if (being)
{
- if (being->getType() == Being::PLAYER)
+ if (being->getType() == ActorType::PLAYER)
nick = being->getName();
}
}
@@ -360,7 +360,7 @@ void PartyHandler::processPartyLeave(Net::MessageIn &msg) const
if (actorManager)
{
Being *const b = actorManager->findBeing(id);
- if (b && b->getType() == Being::PLAYER)
+ if (b && b->getType() == ActorType::PLAYER)
{
b->setParty(nullptr);
b->setPartyName("");
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index a6716a661..e07062585 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -286,7 +286,7 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg,
// color.clear();
}
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->setOtherTime();
if (!player_node)
@@ -401,7 +401,7 @@ void BeingHandler::processNameResponse2(Net::MessageIn &msg)
dstBeing->updateGuild();
dstBeing->addToCache();
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->updateColors();
if (player_node)
@@ -611,7 +611,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
msg.readInt8(); // unknown
- if (dstBeing->getType() != Being::PLAYER
+ if (dstBeing->getType() != ActorType::PLAYER
|| msgType != 3)
{
dstBeing->setActionTime(tick_time);
@@ -623,7 +623,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
dstBeing->setStatusEffectBlock(16, static_cast<uint16_t>(
statusEffects & 0xffffU));
- if (msgType == 3 && dstBeing->getType() == Being::PLAYER)
+ if (msgType == 3 && dstBeing->getType() == ActorType::PLAYER)
dstBeing->setMoveTime();
}
@@ -652,7 +652,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
Being *dstBeing = actorManager->findBeing(id);
- if (dstBeing && dstBeing->getType() == Being::MONSTER
+ if (dstBeing && dstBeing->getType() == ActorType::MONSTER
&& !dstBeing->isAlive())
{
actorManager->destroy(dstBeing);
@@ -681,11 +681,11 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
else
{
// undeleting marked for deletion being
- if (dstBeing->getType() == Being::NPC)
+ if (dstBeing->getType() == ActorType::NPC)
actorManager->undelete(dstBeing);
}
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->setMoveTime();
if (spawnId)
@@ -705,7 +705,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
dstBeing->setWalkSpeed(Vector(speed, speed, 0));
dstBeing->setSubtype(job, 0);
- if (dstBeing->getType() == ActorSprite::MONSTER && player_node)
+ if (dstBeing->getType() == ActorType::MONSTER && player_node)
player_node->checkNewName(dstBeing);
const int hairStyle = msg.readInt16();
@@ -719,7 +719,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
const uint16_t shoes = msg.readInt16(); // clothes color
uint16_t gloves;
- if (dstBeing->getType() == ActorSprite::MONSTER)
+ if (dstBeing->getType() == ActorType::MONSTER)
{
msg.readInt32();
msg.readInt32();
@@ -737,7 +737,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
msg.readInt8(); // karma
uint8_t gender = msg.readInt8();
- if (dstBeing->getType() == ActorSprite::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
{
gender &= 3;
dstBeing->setGender(Being::intToGender(gender));
@@ -753,7 +753,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
if (!mHideShield)
setSprite(dstBeing, SPRITE_SHIELD, shield);
}
- else if (dstBeing->getType() == ActorSprite::NPC)
+ else if (dstBeing->getType() == ActorType::NPC)
{
switch (gender)
{
diff --git a/src/net/eathena/guildhandler.cpp b/src/net/eathena/guildhandler.cpp
index edde95a89..33ff12a57 100644
--- a/src/net/eathena/guildhandler.cpp
+++ b/src/net/eathena/guildhandler.cpp
@@ -206,7 +206,7 @@ void GuildHandler::invite(const int guildId A_UNUSED,
return;
const Being *const being = actorManager->findBeingByName(
- name, Being::PLAYER);
+ name, ActorType::PLAYER);
if (being)
{
MessageOut msg(CMSG_GUILD_INVITE);
diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp
index 6d39fe85b..b41fd36d1 100644
--- a/src/net/eathena/partyhandler.cpp
+++ b/src/net/eathena/partyhandler.cpp
@@ -125,7 +125,7 @@ void PartyHandler::invite(const std::string &name) const
return;
const Being *const being = actorManager->findBeingByName(
- name, Being::PLAYER);
+ name, ActorType::PLAYER);
if (being)
{
MessageOut outMsg(CMSG_PARTY_INVITE);
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index 314f9ee49..5bd39457a 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -287,7 +287,7 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg,
id2 = 1;
}
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->setOtherTime();
if (!player_node)
@@ -410,7 +410,7 @@ void BeingHandler::processNameResponse2(Net::MessageIn &msg)
dstBeing->updateGuild();
dstBeing->addToCache();
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->updateColors();
if (player_node)
@@ -636,7 +636,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
msg.readInt8(); // unknown
- if (dstBeing->getType() != Being::PLAYER
+ if (dstBeing->getType() != ActorType::PLAYER
|| msgType != 3)
{
dstBeing->setActionTime(tick_time);
@@ -648,7 +648,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
dstBeing->setStatusEffectBlock(16, static_cast<uint16_t>(
statusEffects & 0xffff));
- if (msgType == 3 && dstBeing->getType() == Being::PLAYER)
+ if (msgType == 3 && dstBeing->getType() == ActorType::PLAYER)
dstBeing->setMoveTime();
}
diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp
index 4db171545..af45d63cc 100644
--- a/src/net/tmwa/guildhandler.cpp
+++ b/src/net/tmwa/guildhandler.cpp
@@ -212,7 +212,7 @@ void GuildHandler::invite(const int guildId A_UNUSED,
return;
const Being *const being = actorManager->findBeingByName(
- name, Being::PLAYER);
+ name, ActorType::PLAYER);
if (being)
{
MessageOut msg(CMSG_GUILD_INVITE);
diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp
index a7088e33b..310d71783 100644
--- a/src/net/tmwa/partyhandler.cpp
+++ b/src/net/tmwa/partyhandler.cpp
@@ -127,7 +127,7 @@ void PartyHandler::invite(const std::string &name) const
return;
const Being *const being = actorManager->findBeingByName(
- name, Being::PLAYER);
+ name, ActorType::PLAYER);
if (being)
{
MessageOut outMsg(CMSG_PARTY_INVITE);