Fixes a crash when loading a savegame w/ saved map states in it after restarting EDuke32

git-svn-id: https://svn.eduke32.com/eduke32@1451 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2009-07-05 03:15:35 +00:00
parent 8d930bf35d
commit 9190ee2139

View file

@ -179,13 +179,13 @@ int32_t Gv_ReadSave(int32_t fil)
if (aGameVars[j].dwFlags & GAMEVAR_NORESET) continue;
if (aGameVars[j].dwFlags & GAMEVAR_PERPLAYER)
{
if (!MapInfo[i].savedstate->vars[j])
// if (!MapInfo[i].savedstate->vars[j])
MapInfo[i].savedstate->vars[j] = Bcalloc(MAXPLAYERS,sizeof(intptr_t));
if (kdfread(&MapInfo[i].savedstate->vars[j][0],sizeof(intptr_t) * MAXPLAYERS, 1, fil) != 1) goto corrupt;
}
else if (aGameVars[j].dwFlags & GAMEVAR_PERACTOR)
{
if (!MapInfo[i].savedstate->vars[j])
// if (!MapInfo[i].savedstate->vars[j])
MapInfo[i].savedstate->vars[j] = Bcalloc(MAXSPRITES,sizeof(intptr_t));
if (kdfread(&MapInfo[i].savedstate->vars[j][0],sizeof(intptr_t), MAXSPRITES, fil) != MAXSPRITES) goto corrupt;
}