summaryrefslogtreecommitdiff
path: root/src/net/eathena/beingrecv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena/beingrecv.cpp')
-rw-r--r--src/net/eathena/beingrecv.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp
index da175c2e8..9d8c65389 100644
--- a/src/net/eathena/beingrecv.cpp
+++ b/src/net/eathena/beingrecv.cpp
@@ -222,16 +222,17 @@ void BeingRecv::processBeingChangeLookCards(Net::MessageIn &msg)
Being *dstBeing = nullptr;
int cards[maxCards];
+ const BeingId beingId = msg.readBeingId("being id");
+
if (actorManager == nullptr)
{ // here can be look from char server
Net::Characters &chars = Net::CharServerHandler::mCharacters;
- const BeingId id = msg.readBeingId("being id");
FOR_EACH (Net::Characters::iterator, it, chars)
{
const Net::Character *const character = *it;
if (character->dummy != nullptr &&
- character->dummy->getId() == id)
+ character->dummy->getId() == beingId)
{
dstBeing = character->dummy;
break;
@@ -240,8 +241,7 @@ void BeingRecv::processBeingChangeLookCards(Net::MessageIn &msg)
}
else
{
- dstBeing = actorManager->findBeing(
- msg.readBeingId("being id"));
+ dstBeing = actorManager->findBeing(beingId);
}
const uint8_t type = msg.readUInt8("type");
@@ -1496,14 +1496,12 @@ void BeingRecv::processBeingSpecialEffect(Net::MessageIn &msg)
const BeingId id = msg.readBeingId("being id");
Being *const being = actorManager->findBeing(id);
- if (being == nullptr)
- {
- msg.readInt32("effect type");
- return;
- }
const int effectType = msg.readInt32("effect type");
+ if (being == nullptr)
+ return;
+
if (ParticleEngine::enabled)
effectManager->trigger(effectType, being, 0);
@@ -1895,15 +1893,15 @@ void BeingRecv::processBeingSelfEffect(Net::MessageIn &msg)
const BeingId id = msg.readBeingId("being id");
Being *const being = actorManager->findBeing(id);
+ const int effectType = msg.readInt32("effect type");
+
if (being == nullptr)
{
DEBUGLOGSTR("insible player?");
- msg.readInt32("effect type");
BLOCK_END("BeingRecv::processBeingSelfEffect")
return;
}
- const int effectType = msg.readInt32("effect type");
if (ParticleEngine::enabled)
effectManager->trigger(effectType, being, 0);