summaryrefslogtreecommitdiff
path: root/src/net/ea/beinghandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/ea/beinghandler.cpp')
-rw-r--r--src/net/ea/beinghandler.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index d3f6dd0e..90831e9f 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -107,7 +107,7 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
int type, guild;
Uint16 status;
Being *srcBeing, *dstBeing;
- Player *player;
+ Player *player = 0;
int hairStyle, hairColor, flag;
std::string player_followed;
@@ -140,7 +140,8 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
dstBeing = createBeing(id, job);
}
- player = dynamic_cast<Player*>(dstBeing);
+ if (dstBeing->getType() == Being::PLAYER)
+ player = static_cast<Player*>(dstBeing);
// Fix monster jobs
if (dstBeing->getType() == Being::MONSTER)
@@ -420,7 +421,8 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
break;
}
- player = dynamic_cast<Player*>(dstBeing);
+ if (dstBeing->getType() == Being::PLAYER)
+ player = static_cast<Player*>(dstBeing);
int type = msg.readInt8();
int id = 0;
@@ -529,7 +531,8 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
dstBeing = createBeing(id, job);
}
- player = dynamic_cast<Player*>(dstBeing);
+ if (dstBeing->getType() == Being::PLAYER)
+ player = static_cast<Player*>(dstBeing);
if (Party *party = player_node->getParty()){
if (party->isMember(id))