summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-25 23:58:16 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-25 23:58:16 +0300
commit482782d74c61e226ed1ce81700708244565291f5 (patch)
treec955925952f091cdc71af8b1e7f8b3cdabecfa6b /src/net/tmwa
parentee12c6e77bd4d34d5fa682361127add32cc1a184 (diff)
downloadplus-482782d74c61e226ed1ce81700708244565291f5.tar.gz
plus-482782d74c61e226ed1ce81700708244565291f5.tar.bz2
plus-482782d74c61e226ed1ce81700708244565291f5.tar.xz
plus-482782d74c61e226ed1ce81700708244565291f5.zip
Add missing checks into net directory.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/beinghandler.cpp6
-rw-r--r--src/net/tmwa/beinghandler.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index 28c91fd28..8092a519f 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -238,6 +238,8 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
void BeingHandler::undress(Being *const being) const
{
+ if (!being)
+ return;
being->setSprite(SPRITE_WEAPON, 0);
being->setSprite(SPRITE_HEAD_BOTTOM, 0);
being->setSprite(SPRITE_CLOTHES_COLOR, 0);
@@ -1355,6 +1357,8 @@ void BeingHandler::processBeingChangeDirection(Net::MessageIn &msg)
void BeingHandler::setServerGender(Being *const being, const uint8_t gender)
{
+ if (!being)
+ return;
switch (gender)
{
case 2:
@@ -1376,6 +1380,8 @@ void BeingHandler::applyPlayerAction(Net::MessageIn &msg,
Being *const being,
const uint8_t type)
{
+ if (!being)
+ return;
switch (type)
{
case 0:
diff --git a/src/net/tmwa/beinghandler.h b/src/net/tmwa/beinghandler.h
index 7d78b5d33..1b722415d 100644
--- a/src/net/tmwa/beinghandler.h
+++ b/src/net/tmwa/beinghandler.h
@@ -78,7 +78,7 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler
Being *const dstBeing,
const uint8_t type,
const int id,
- const int id2);
+ const int id2) A_NONNULL(2);
static void processPlaterStatusChange(Net::MessageIn &msg);