From ea0b61e18f36f28806940b00a2cddaef912c3340 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 13 May 2014 01:04:05 +0300 Subject: Move actor type into separate file. --- src/net/ea/beinghandler.cpp | 50 ++++++++++++++++++++++----------------------- src/net/ea/chathandler.cpp | 4 ++-- src/net/ea/guildhandler.cpp | 6 +++--- src/net/ea/partyhandler.cpp | 4 ++-- 4 files changed, 32 insertions(+), 32 deletions(-) (limited to 'src/net/ea') 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(""); -- cgit v1.2.3-60-g2f50