Fix UserMessageToBfWrite and UserMessageToBfRead not working correctly for non-protobuf usermessages.

This commit is contained in:
Ryan Stecker 2014-12-15 23:07:53 -06:00
parent b4199e5aa3
commit 20ed5c338c

View File

@ -80,7 +80,7 @@ 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;
}
@ -88,7 +88,7 @@ stock BfWrite UserMessageToBfWrite(Handle 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;
}