From abad34c82662f7fe3967ee049b0114fbfc11cffa Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 5 Dec 2004 08:21:31 +0000 Subject: [PATCH] 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 --- engine/server/net_preparse.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/engine/server/net_preparse.c b/engine/server/net_preparse.c index 7069da362..797c2b20b 100644 --- a/engine/server/net_preparse.c +++ b/engine/server/net_preparse.c @@ -556,7 +556,8 @@ NPP_CheckDest(dest); } 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); if (!bufferlen) Con_Printf("Messages should start with WriteByte\n"); @@ -566,15 +567,23 @@ NPP_CheckDest(dest); client_t *cl = Write_GetClient(); if (cl && cl->nqprot) { - ClientReliableCheckBlock(cl, sizeof(short)); + ClientReliableCheckBlock(cl, sizeof(float)); ClientReliableWrite_Coord(cl, in); } } else MSG_WriteCoord (NQWriteDest(dest), in); #endif - data = LittleShort(data); - NPP_AddData(&data, sizeof(short)); + if (sizeofcoord==4) + { + dataf = LittleFloat(dataf); + NPP_AddData(&dataf, sizeof(float)); + } + else + { + datas = LittleShort(datas); + NPP_AddData(&datas, sizeof(short)); + } NPP_CheckFlush(); } 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) { client_t *cl = Write_GetClient(); if (cl && !cl->nqprot) - { + { ClientReliableCheckBlock(cl, sizeof(float)); ClientReliableWrite_Coord(cl, in); }