Implement NZP Protocol (115)'s extended model limit

This commit is contained in:
Steam Deck User 2023-03-29 18:48:56 -04:00
parent e2d4a0720e
commit 6cc9131eb9
4 changed files with 6 additions and 6 deletions

View File

@ -420,7 +420,7 @@ if (bits&(1<<i))
if (bits & U_MODEL)
{
modnum = MSG_ReadByte ();
modnum = MSG_ReadShort ();
if (modnum >= MAX_MODELS)
Host_Error ("CL_ParseModel: bad modnum");
}
@ -569,7 +569,7 @@ void CL_ParseBaseline (entity_t *ent)
{
int i;
ent->baseline.modelindex = MSG_ReadByte ();
ent->baseline.modelindex = MSG_ReadShort ();
ent->baseline.frame = MSG_ReadByte ();
ent->baseline.colormap = MSG_ReadByte();
ent->baseline.skin = MSG_ReadByte();

View File

@ -3027,7 +3027,7 @@ void PF_makestatic (void)
MSG_WriteByte (&sv.signon,svc_spawnstatic);
MSG_WriteByte (&sv.signon, SV_ModelIndex(pr_strings + ent->v.model));
MSG_WriteShort (&sv.signon, SV_ModelIndex(pr_strings + ent->v.model));
MSG_WriteByte (&sv.signon, ent->v.frame);
MSG_WriteByte (&sv.signon, ent->v.colormap);

View File

@ -110,7 +110,7 @@ void VID_UnlockBuffer (void);
//
#define MAX_EDICTS 600 // FIXME: ouch! ouch! ouch!
#define MAX_LIGHTSTYLES 64
#define MAX_MODELS 256 // these are sent over the net as bytes
#define MAX_MODELS 300 // motolegacy -- nzp protocol(115), uses memory inefficient shorts for model indexes, yay!
#define MAX_SOUNDS 256 // so they cannot be blindly increased
#define SAVEGAME_COMMENT_LENGTH 39

View File

@ -588,7 +588,7 @@ void SV_WriteEntitiesToClient (edict_t *clent, sizebuf_t *msg)
MSG_WriteByte (msg,e);
if (bits & U_MODEL)
MSG_WriteByte (msg, ent->v.modelindex);
MSG_WriteShort (msg, ent->v.modelindex);
if (bits & U_FRAME)
MSG_WriteByte (msg, ent->v.frame);
if (bits & U_COLORMAP)
@ -1045,7 +1045,7 @@ void SV_CreateBaseline (void)
MSG_WriteByte (&sv.signon,svc_spawnbaseline);
MSG_WriteShort (&sv.signon,entnum);
MSG_WriteByte (&sv.signon, svent->baseline.modelindex);
MSG_WriteShort (&sv.signon, svent->baseline.modelindex);
MSG_WriteByte (&sv.signon, svent->baseline.frame);
MSG_WriteByte (&sv.signon, svent->baseline.colormap);
MSG_WriteByte (&sv.signon, svent->baseline.skin);