In G_NewGame(), call Gv_RefreshPointers after Gv_ResetVars.

Resetting the gamevars might produce inconsistencies between an earlier loaded
game (for example, if it was saved with different/earlier CON code), and worst
of all, the gamevars that reference C variables might be overwritten (i.e. the
addresses to those variable, which is very bad!).

git-svn-id: https://svn.eduke32.com/eduke32@2230 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-01-03 19:55:38 +00:00
parent 13c399f612
commit f87c0db3ce
2 changed files with 5 additions and 0 deletions

View file

@ -360,6 +360,7 @@ void Gv_DumpValues(void)
OSD_Printf("\n// end of game definitions\n");
}
// XXX: This function is very strange.
void Gv_ResetVars(void) /* this is called during a new game and nowhere else */
{
int32_t i;

View file

@ -1536,6 +1536,10 @@ void G_NewGame(int32_t vn,int32_t ln,int32_t sk)
Gv_InitWeaponPointers();
// PK: Gv_ResetVars() might trip up the system (pointer) gamevars,
// e.g. if some earlier-version CON code had been loaded before
Gv_RefreshPointers();
Gv_ResetSystemDefaults();
for (i=0; i<(MAXVOLUMES*MAXLEVELS); i++)