added support for PROTOCOL_NEHAHRAMOVIE in more places, so now nehahra works again...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 20 Nov 2004 11:20:24 +0000 (11:20 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 20 Nov 2004 11:20:24 +0000 (11:20 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4775 d7cf8633-e32d-0410-b094-e92efae38249

cl_input.c
cl_parse.c
protocol.c

index 0e48860..610bd30 100644 (file)
@@ -385,7 +385,7 @@ void CL_SendMove(usercmd_t *cmd)
 
        MSG_WriteFloat (&buf, cl.mtime[0]);     // so server can get ping times
 
-       if (cl.protocol == PROTOCOL_QUAKE)
+       if (cl.protocol == PROTOCOL_QUAKE || cl.protocol == PROTOCOL_NEHAHRAMOVIE)
        {
                for (i = 0;i < 3;i++)
                        MSG_WriteAngle8i (&buf, cl.viewangles[i]);
@@ -400,6 +400,8 @@ void CL_SendMove(usercmd_t *cmd)
                for (i = 0;i < 3;i++)
                        MSG_WriteAngle16i (&buf, cl.viewangles[i]);
        }
+       else
+               Host_Error("CL_SendMove: unknown cl.protocol %i\n", cl.protocol);
 
        MSG_WriteCoord16i (&buf, forwardmove);
        MSG_WriteCoord16i (&buf, sidemove);
index 65c7cfa..4e782b6 100644 (file)
@@ -552,16 +552,6 @@ void CL_MoveLerpEntityStates(entity_t *ent)
        }
 }
 
-void CL_ReadEntityFrame(void)
-{
-       if (cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3)
-               EntityFrame_CL_ReadFrame();
-       else if (cl.protocol == PROTOCOL_DARKPLACES4)
-               EntityFrame4_CL_ReadFrame();
-       else if (cl.protocol == PROTOCOL_DARKPLACES5)
-               EntityFrame5_CL_ReadFrame();
-}
-
 /*
 ==================
 CL_ParseBaseline
@@ -630,10 +620,10 @@ void CL_ParseClientdata (int bits)
                {
                        if (cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3 || cl.protocol == PROTOCOL_DARKPLACES4 || cl.protocol == PROTOCOL_DARKPLACES5)
                                cl.punchangle[i] = MSG_ReadAngle16i();
-                       else if (cl.protocol == PROTOCOL_QUAKE)
+                       else if (cl.protocol == PROTOCOL_QUAKE || cl.protocol == PROTOCOL_NEHAHRAMOVIE)
                                cl.punchangle[i] = MSG_ReadChar();
                        else
-                               Host_Error("CL_ParseClientData: unknown cl.protocol\n");
+                               Host_Error("CL_ParseClientData: unknown cl.protocol %i\n", cl.protocol);
                }
                else
                        cl.punchangle[i] = 0;
@@ -644,18 +634,18 @@ void CL_ParseClientdata (int bits)
                        else if (cl.protocol == PROTOCOL_DARKPLACES5)
                                cl.punchvector[i] = MSG_ReadCoord32f();
                        else
-                               Host_Error("CL_ParseClientData: unknown cl.protocol\n");
+                               Host_Error("CL_ParseClientData: unknown cl.protocol %i\n", cl.protocol);
                }
                else
                        cl.punchvector[i] = 0;
                if (bits & (SU_VELOCITY1<<i) )
                {
-                       if (cl.protocol == PROTOCOL_QUAKE || cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3 || cl.protocol == PROTOCOL_DARKPLACES4)
+                       if (cl.protocol == PROTOCOL_QUAKE || cl.protocol == PROTOCOL_NEHAHRAMOVIE || cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3 || cl.protocol == PROTOCOL_DARKPLACES4)
                                cl.mvelocity[0][i] = MSG_ReadChar()*16;
                        else if (cl.protocol == PROTOCOL_DARKPLACES5)
                                cl.mvelocity[0][i] = MSG_ReadCoord32f();
                        else
-                               Host_Error("CL_ParseClientData: unknown cl.protocol\n");
+                               Host_Error("CL_ParseClientData: unknown cl.protocol %i\n", cl.protocol);
                }
                else
                        cl.mvelocity[0][i] = 0;
@@ -1687,7 +1677,14 @@ void CL_ParseServerMessage(void)
                                cls.signon = SIGNONS;
                                CL_SignonReply ();
                        }
-                       CL_ReadEntityFrame();
+                       if (cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3)
+                               EntityFrame_CL_ReadFrame();
+                       else if (cl.protocol == PROTOCOL_DARKPLACES4)
+                               EntityFrame4_CL_ReadFrame();
+                       else if (cl.protocol == PROTOCOL_DARKPLACES5)
+                               EntityFrame5_CL_ReadFrame();
+                       else
+                               Host_Error("CL_ParseServerMessage: svc_entities: unknown cl.protocol %i\n", cl.protocol);
                        break;
                }
        }
index f22241e..b537147 100644 (file)
@@ -548,6 +548,8 @@ void EntityState_ReadFields(entity_state_t *e, unsigned int bits)
                                e->origin[2] = MSG_ReadCoord32f();
                }
        }
+       else
+               Host_Error("EntityState_ReadFields: unknown cl.protocol %i\n", cl.protocol);
        if (cl.protocol == PROTOCOL_DARKPLACES5 && !(e->flags & RENDER_LOWPRECISION))
        {
                if (bits & E_ANGLE1)