summaryrefslogtreecommitdiff
path: root/src/net/eathena/beinghandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-21 00:47:44 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-21 00:47:44 +0300
commitfffbd86a1014ad169ed2d68ea58cdddf346faa14 (patch)
tree713c96fcf7421ca87f638d312e752179281cb8fe /src/net/eathena/beinghandler.cpp
parent1941b81a5a278f26a5d7e1f91903ab04c92e2cd1 (diff)
downloadmanaplus-fffbd86a1014ad169ed2d68ea58cdddf346faa14.tar.gz
manaplus-fffbd86a1014ad169ed2d68ea58cdddf346faa14.tar.bz2
manaplus-fffbd86a1014ad169ed2d68ea58cdddf346faa14.tar.xz
manaplus-fffbd86a1014ad169ed2d68ea58cdddf346faa14.zip
Add missing checks and non null attributes.
Diffstat (limited to 'src/net/eathena/beinghandler.cpp')
-rw-r--r--src/net/eathena/beinghandler.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index 79fddcf18..d12941fcd 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -663,7 +663,6 @@ void BeingHandler::processBeingVisible(Net::MessageIn &msg)
return;
dstBeing = createBeing2(msg, id, job, type);
-
if (!dstBeing)
return;
}
@@ -831,7 +830,6 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg)
return;
dstBeing = createBeing2(msg, id, job, type);
-
if (!dstBeing)
return;
}
@@ -1001,7 +999,6 @@ void BeingHandler::processBeingSpawn(Net::MessageIn &msg)
return;
dstBeing = createBeing2(msg, id, job, type);
-
if (!dstBeing)
return;
}
@@ -1120,6 +1117,8 @@ void BeingHandler::processMapTypeProperty(Net::MessageIn &msg)
MapTypeProperty2 props;
props.data = static_cast<uint32_t>(flags);
Game *const game = Game::instance();
+ if (!game)
+ return;
Map *const map = game->getCurrentMap();
if (!map)
return;
@@ -1679,6 +1678,8 @@ void BeingHandler::processBeingFakeName(Net::MessageIn &msg)
msg.skip(4, "unsued");
Being *const dstBeing = createBeing2(msg, id, job, type);
+ if (!dstBeing)
+ return;
dstBeing->setSubtype(fromInt(job, BeingTypeId), 0);
dstBeing->setTileCoords(x, y);
dstBeing->setDirection(dir);