diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-06-25 23:58:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-06-25 23:58:16 +0300 |
commit | 482782d74c61e226ed1ce81700708244565291f5 (patch) | |
tree | c955925952f091cdc71af8b1e7f8b3cdabecfa6b /src/net/tmwa | |
parent | ee12c6e77bd4d34d5fa682361127add32cc1a184 (diff) | |
download | mv-482782d74c61e226ed1ce81700708244565291f5.tar.gz mv-482782d74c61e226ed1ce81700708244565291f5.tar.bz2 mv-482782d74c61e226ed1ce81700708244565291f5.tar.xz mv-482782d74c61e226ed1ce81700708244565291f5.zip |
Add missing checks into net directory.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/beinghandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwa/beinghandler.h | 2 |
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); |