Browse Source

Fix too strict assert in kNet.

Henrik Heino 8 years ago
parent
commit
a149a71c78
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Source/ThirdParty/kNet/src/MessageConnection.cpp

+ 4 - 1
Source/ThirdParty/kNet/src/MessageConnection.cpp

@@ -12,6 +12,8 @@
    See the License for the specific language governing permissions and
    See the License for the specific language governing permissions and
    limitations under the License. */
    limitations under the License. */
 
 
+// Modified by Henrik Heino for Urho3D
+
 /** @file MessageConnection.cpp
 /** @file MessageConnection.cpp
 	@brief */
 	@brief */
 
 
@@ -738,7 +740,8 @@ void MessageConnection::SendMessage(unsigned long id, bool reliable, bool inOrde
 	msg->inOrder = inOrder;
 	msg->inOrder = inOrder;
 	msg->priority = priority;
 	msg->priority = priority;
 	msg->contentID = contentID;
 	msg->contentID = contentID;
-	assert(msg->data);
+	// Urho3D: Allow NULL data if there is zero bytes.
+	assert(msg->data || !numBytes);
 	assert(msg->Size() == numBytes);
 	assert(msg->Size() == numBytes);
 	memcpy(msg->data, data, numBytes);
 	memcpy(msg->data, data, numBytes);
 	EndAndQueueMessage(msg);
 	EndAndQueueMessage(msg);