Big coords work with NQ mods too now.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@561 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2004-12-05 08:21:31 +00:00
parent d4033f5dca
commit abad34c826

View file

@ -556,7 +556,8 @@ NPP_CheckDest(dest);
} }
void NPP_NQWriteCoord(int dest, float in) //replacement write func (nq to qw) void NPP_NQWriteCoord(int dest, float in) //replacement write func (nq to qw)
{ {
short data = (int)(in*8); short datas = (int)(in*8);
float dataf = in;
NPP_CheckDest(dest); NPP_CheckDest(dest);
if (!bufferlen) if (!bufferlen)
Con_Printf("Messages should start with WriteByte\n"); Con_Printf("Messages should start with WriteByte\n");
@ -566,15 +567,23 @@ NPP_CheckDest(dest);
client_t *cl = Write_GetClient(); client_t *cl = Write_GetClient();
if (cl && cl->nqprot) if (cl && cl->nqprot)
{ {
ClientReliableCheckBlock(cl, sizeof(short)); ClientReliableCheckBlock(cl, sizeof(float));
ClientReliableWrite_Coord(cl, in); ClientReliableWrite_Coord(cl, in);
} }
} else } else
MSG_WriteCoord (NQWriteDest(dest), in); MSG_WriteCoord (NQWriteDest(dest), in);
#endif #endif
data = LittleShort(data); if (sizeofcoord==4)
NPP_AddData(&data, sizeof(short)); {
dataf = LittleFloat(dataf);
NPP_AddData(&dataf, sizeof(float));
}
else
{
datas = LittleShort(datas);
NPP_AddData(&datas, sizeof(short));
}
NPP_CheckFlush(); NPP_CheckFlush();
} }
void NPP_NQWriteString(int dest, char *data) //replacement write func (nq to qw) void NPP_NQWriteString(int dest, char *data) //replacement write func (nq to qw)
@ -1148,7 +1157,7 @@ void NPP_QWWriteCoord(int dest, float in) //replacement write func (nq to qw)
if (dest == MSG_ONE) { if (dest == MSG_ONE) {
client_t *cl = Write_GetClient(); client_t *cl = Write_GetClient();
if (cl && !cl->nqprot) if (cl && !cl->nqprot)
{ {
ClientReliableCheckBlock(cl, sizeof(float)); ClientReliableCheckBlock(cl, sizeof(float));
ClientReliableWrite_Coord(cl, in); ClientReliableWrite_Coord(cl, in);
} }