Skip to content

Commit

Permalink
Merge pull request #224 from VoiDeD/umsg-fix
Browse files Browse the repository at this point in the history
Fix UserMessageToBfWrite and UserMessageToBfRead
  • Loading branch information
dvander committed Dec 16, 2014
2 parents b4199e5 + 20ed5c3 commit e250eb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/include/usermessages.inc
Expand Up @@ -80,15 +80,15 @@ stock Protobuf UserMessageToProtobuf(Handle msg)
// Make sure to only call this on writable buffers (eg from StartMessage).
stock BfWrite UserMessageToBfWrite(Handle msg)
{
if (GetUserMessageType() != UM_Protobuf)
if (GetUserMessageType() == UM_Protobuf)
return null;
return BfWrite:msg;
}

// Make sure to only call this on readable buffers (eg from a message hook).
stock BfWrite UserMessageToBfRead(Handle msg)
{
if (GetUserMessageType() != UM_Protobuf)
if (GetUserMessageType() == UM_Protobuf)
return null;
return BfRead:msg;
}
Expand Down

0 comments on commit e250eb6

Please sign in to comment.