added viewzoom extension to QC and client (smooth sniper zooming, with sensitivity...
[xonotic/darkplaces.git] / net_loop.c
index ac2a5de9b2e050bb13a91af1a337814d8fba36b2..1ad3fee92c3ae70ee7b0e8f632e30fb17d45ed15 100644 (file)
@@ -162,7 +162,7 @@ int Loop_SendMessage (qsocket_t *sock, sizebuf_t *data)
        bufferLength = &((qsocket_t *)sock->driverdata)->receiveMessageLength;
 
        if ((*bufferLength + data->cursize + 4) > NET_MAXMESSAGE)
-               Sys_Error("Loop_SendMessage: overflow\n");
+               Host_Error("Loop_SendMessage: overflow\n");
 
        buffer = ((qsocket_t *)sock->driverdata)->receiveMessage + *bufferLength;
 
@@ -195,7 +195,8 @@ int Loop_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data)
 
        bufferLength = &((qsocket_t *)sock->driverdata)->receiveMessageLength;
 
-       if ((*bufferLength + data->cursize + sizeof(byte) + sizeof(short)) > NET_MAXMESSAGE)
+       // LordHavoc: added an extra sizeof(byte) to account for alignment
+       if ((*bufferLength + data->cursize + sizeof(byte) + sizeof(short) + sizeof(byte)) > NET_MAXMESSAGE)
                return 0;
 
        buffer = ((qsocket_t *)sock->driverdata)->receiveMessage + *bufferLength;