]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - common.c
qw support is 99% working
[xonotic/darkplaces.git] / common.c
index 570b6f43c4cda58ee5a6b8f94dd0335a80feff38..efea48511f9f20c4e4951563c91cabd8fe37159e 100644 (file)
--- a/common.c
+++ b/common.c
@@ -338,7 +338,7 @@ void MSG_WriteCoord32f (sizebuf_t *sb, float f)
 
 void MSG_WriteCoord (sizebuf_t *sb, float f, protocolversion_t protocol)
 {
 
 void MSG_WriteCoord (sizebuf_t *sb, float f, protocolversion_t protocol)
 {
-       if (protocol == PROTOCOL_QUAKE || protocol == PROTOCOL_QUAKEDP || protocol == PROTOCOL_NEHAHRAMOVIE)
+       if (protocol == PROTOCOL_QUAKE || protocol == PROTOCOL_QUAKEDP || protocol == PROTOCOL_NEHAHRAMOVIE || protocol == PROTOCOL_QUAKEWORLD)
                MSG_WriteCoord13i (sb, f);
        else if (protocol == PROTOCOL_DARKPLACES1)
                MSG_WriteCoord32f (sb, f);
                MSG_WriteCoord13i (sb, f);
        else if (protocol == PROTOCOL_DARKPLACES1)
                MSG_WriteCoord32f (sb, f);
@@ -379,7 +379,7 @@ void MSG_WriteAngle32f (sizebuf_t *sb, float f)
 
 void MSG_WriteAngle (sizebuf_t *sb, float f, protocolversion_t protocol)
 {
 
 void MSG_WriteAngle (sizebuf_t *sb, float f, protocolversion_t protocol)
 {
-       if (protocol == PROTOCOL_QUAKE || protocol == PROTOCOL_QUAKEDP || protocol == PROTOCOL_NEHAHRAMOVIE || protocol == PROTOCOL_DARKPLACES1 || protocol == PROTOCOL_DARKPLACES2 || protocol == PROTOCOL_DARKPLACES3 || protocol == PROTOCOL_DARKPLACES4)
+       if (protocol == PROTOCOL_QUAKE || protocol == PROTOCOL_QUAKEDP || protocol == PROTOCOL_NEHAHRAMOVIE || protocol == PROTOCOL_DARKPLACES1 || protocol == PROTOCOL_DARKPLACES2 || protocol == PROTOCOL_DARKPLACES3 || protocol == PROTOCOL_DARKPLACES4 || protocol == PROTOCOL_QUAKEWORLD)
                MSG_WriteAngle8i (sb, f);
        else
                MSG_WriteAngle16i (sb, f);
                MSG_WriteAngle8i (sb, f);
        else
                MSG_WriteAngle16i (sb, f);
@@ -479,7 +479,7 @@ char *MSG_ReadString (void)
 {
        static char string[MAX_INPUTLINE];
        int l,c;
 {
        static char string[MAX_INPUTLINE];
        int l,c;
-       for (l = 0;l < (int) sizeof(string) - 1 && (c = MSG_ReadChar()) != -1 && c != 0;l++)
+       for (l = 0;l < (int) sizeof(string) - 1 && (c = MSG_ReadByte()) != -1 && c != 0;l++)
                string[l] = c;
        string[l] = 0;
        return string;
                string[l] = c;
        string[l] = 0;
        return string;
@@ -488,7 +488,7 @@ char *MSG_ReadString (void)
 int MSG_ReadBytes (int numbytes, unsigned char *out)
 {
        int l, c;
 int MSG_ReadBytes (int numbytes, unsigned char *out)
 {
        int l, c;
-       for (l = 0;l < numbytes && (c = MSG_ReadChar()) != -1;l++)
+       for (l = 0;l < numbytes && (c = MSG_ReadByte()) != -1;l++)
                out[l] = c;
        return l;
 }
                out[l] = c;
        return l;
 }
@@ -510,7 +510,7 @@ float MSG_ReadCoord32f (void)
 
 float MSG_ReadCoord (protocolversion_t protocol)
 {
 
 float MSG_ReadCoord (protocolversion_t protocol)
 {
-       if (protocol == PROTOCOL_QUAKE || protocol == PROTOCOL_QUAKEDP || protocol == PROTOCOL_NEHAHRAMOVIE)
+       if (protocol == PROTOCOL_QUAKE || protocol == PROTOCOL_QUAKEDP || protocol == PROTOCOL_NEHAHRAMOVIE || protocol == PROTOCOL_QUAKEWORLD)
                return MSG_ReadCoord13i();
        else if (protocol == PROTOCOL_DARKPLACES1)
                return MSG_ReadCoord32f();
                return MSG_ReadCoord13i();
        else if (protocol == PROTOCOL_DARKPLACES1)
                return MSG_ReadCoord32f();
@@ -545,7 +545,7 @@ float MSG_ReadAngle32f (void)
 
 float MSG_ReadAngle (protocolversion_t protocol)
 {
 
 float MSG_ReadAngle (protocolversion_t protocol)
 {
-       if (protocol == PROTOCOL_QUAKE || protocol == PROTOCOL_QUAKEDP || protocol == PROTOCOL_NEHAHRAMOVIE || protocol == PROTOCOL_DARKPLACES1 || protocol == PROTOCOL_DARKPLACES2 || protocol == PROTOCOL_DARKPLACES3 || protocol == PROTOCOL_DARKPLACES4)
+       if (protocol == PROTOCOL_QUAKE || protocol == PROTOCOL_QUAKEDP || protocol == PROTOCOL_NEHAHRAMOVIE || protocol == PROTOCOL_DARKPLACES1 || protocol == PROTOCOL_DARKPLACES2 || protocol == PROTOCOL_DARKPLACES3 || protocol == PROTOCOL_DARKPLACES4 || protocol == PROTOCOL_QUAKEWORLD)
                return MSG_ReadAngle8i ();
        else
                return MSG_ReadAngle16i ();
                return MSG_ReadAngle8i ();
        else
                return MSG_ReadAngle16i ();