Fix bug with previous commit.
Fix loading legacy saved games. Hide the misaligned lumps warning under the developer cvar. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5289 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
c33c8a97a4
commit
c97fa33879
3 changed files with 11 additions and 5 deletions
|
@ -5224,13 +5224,19 @@ static void CL_ParseSetInfo (void)
|
||||||
if (cls.fteprotocolextensions2 & PEXT2_INFOBLOBS)
|
if (cls.fteprotocolextensions2 & PEXT2_INFOBLOBS)
|
||||||
key = InfoBuf_DecodeString(temp, temp+strlen(temp), &keysize);
|
key = InfoBuf_DecodeString(temp, temp+strlen(temp), &keysize);
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
keysize = strlen(temp);
|
||||||
key = Z_StrDup(temp);
|
key = Z_StrDup(temp);
|
||||||
|
}
|
||||||
|
|
||||||
temp = MSG_ReadString();
|
temp = MSG_ReadString();
|
||||||
if (cls.fteprotocolextensions2 & PEXT2_INFOBLOBS)
|
if (cls.fteprotocolextensions2 & PEXT2_INFOBLOBS)
|
||||||
val = InfoBuf_DecodeString(temp, temp+strlen(temp), &valsize);
|
val = InfoBuf_DecodeString(temp, temp+strlen(temp), &valsize);
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
valsize = strlen(temp);
|
||||||
val = Z_StrDup(temp);
|
val = Z_StrDup(temp);
|
||||||
|
}
|
||||||
|
|
||||||
if (slot == 255)
|
if (slot == 255)
|
||||||
InfoBuf_SyncReceive(&cl.serverinfo, key, keysize, val, valsize, offset, final);
|
InfoBuf_SyncReceive(&cl.serverinfo, key, keysize, val, valsize, offset, final);
|
||||||
|
|
|
@ -5184,7 +5184,7 @@ static qboolean QDECL Mod_LoadBrushModel (model_t *mod, void *buffer, size_t fsi
|
||||||
{ //pre-phong versions of tyrutils wrote misaligned lumps. These crash on arm/etc.
|
{ //pre-phong versions of tyrutils wrote misaligned lumps. These crash on arm/etc.
|
||||||
char *tmp;
|
char *tmp;
|
||||||
int ofs = 0;
|
int ofs = 0;
|
||||||
Con_Printf(CON_WARNING"%s: Misaligned lumps detected\n", mod->name);
|
Con_DPrintf(CON_WARNING"%s: Misaligned lumps detected\n", mod->name);
|
||||||
tmp = BZ_Malloc(fsize);
|
tmp = BZ_Malloc(fsize);
|
||||||
memcpy(tmp, mod_base, fsize);
|
memcpy(tmp, mod_base, fsize);
|
||||||
for (i = 0; i < HEADER_LUMPS; i++)
|
for (i = 0; i < HEADER_LUMPS; i++)
|
||||||
|
|
|
@ -1801,9 +1801,11 @@ char *PDECL PR_SaveEnts(pubprogfuncs_t *ppf, char *buf, size_t *bufofs, size_t b
|
||||||
//write the ents
|
//write the ents
|
||||||
for (a = 0; a < sv_num_edicts; a++)
|
for (a = 0; a < sv_num_edicts; a++)
|
||||||
{
|
{
|
||||||
|
char head[64];
|
||||||
edictrun_t *ed = (edictrun_t *)EDICT_NUM(progfuncs, a);
|
edictrun_t *ed = (edictrun_t *)EDICT_NUM(progfuncs, a);
|
||||||
|
|
||||||
AddS ("{\n");
|
QC_snprintfz(head, sizeof(head), "{//%i\n", a);
|
||||||
|
AddS (head);
|
||||||
|
|
||||||
if (ed->ereftype == ER_ENTITY) //free entities write a {} with no data. the loader detects this specifically.
|
if (ed->ereftype == ER_ENTITY) //free entities write a {} with no data. the loader detects this specifically.
|
||||||
ED_WriteEdict(progfuncs, ed, buf, bufofs, bufmax, true);
|
ED_WriteEdict(progfuncs, ed, buf, bufofs, bufmax, true);
|
||||||
|
@ -2207,9 +2209,7 @@ int PDECL PR_LoadEnts(pubprogfuncs_t *ppf, const char *file, void *ctx, void (PD
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ed = (edictrun_t *)EDICT_NUM(progfuncs, numents);
|
ed = ED_AllocIntoTable(progfuncs, numents, false, prinst.fields_size);
|
||||||
if (!ed)
|
|
||||||
ed = ED_AllocIntoTable(progfuncs, numents, false, prinst.fields_size);
|
|
||||||
|
|
||||||
if (externs->entspawn)
|
if (externs->entspawn)
|
||||||
externs->entspawn((struct edict_s *) ed, true);
|
externs->entspawn((struct edict_s *) ed, true);
|
||||||
|
|
Loading…
Reference in a new issue