remove unnecessary null checks

This commit is contained in:
DarthArgus
2014-10-26 22:53:42 -07:00
parent eb2e7c78d8
commit 594b3a4254
56 changed files with 98 additions and 199 deletions
@@ -52,12 +52,9 @@ MessageQueue::Data * AiCreatureStateMessage::unpack(Archive::ReadIterator & sour
{
AiCreatureStateMessage * msg = new AiCreatureStateMessage();
if (msg != NULL)
if (GameServerMessageInterface::getInstance() != NULL)
{
if (GameServerMessageInterface::getInstance() != NULL)
{
GameServerMessageInterface::getInstance()->unpack(source, *msg);
}
GameServerMessageInterface::getInstance()->unpack(source, *msg);
}
return msg;
@@ -71,11 +71,10 @@ void AiMovementMessage::pack(const MessageQueue::Data* const data, Archive::Byte
MessageQueue::Data* AiMovementMessage::unpack(Archive::ReadIterator & source)
{
AiMovementMessage * msg = new AiMovementMessage();
if (msg)
{
if (GameServerMessageInterface::getInstance() != NULL)
GameServerMessageInterface::getInstance()->unpack(source, *msg);
}
if (GameServerMessageInterface::getInstance() != NULL)
GameServerMessageInterface::getInstance()->unpack(source, *msg);
return msg;
}