mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 03:00:38 +00:00
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:
parent
13c399f612
commit
f87c0db3ce
2 changed files with 5 additions and 0 deletions
|
@ -360,6 +360,7 @@ void Gv_DumpValues(void)
|
||||||
OSD_Printf("\n// end of game definitions\n");
|
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 */
|
void Gv_ResetVars(void) /* this is called during a new game and nowhere else */
|
||||||
{
|
{
|
||||||
int32_t i;
|
int32_t i;
|
||||||
|
|
|
@ -1536,6 +1536,10 @@ void G_NewGame(int32_t vn,int32_t ln,int32_t sk)
|
||||||
|
|
||||||
Gv_InitWeaponPointers();
|
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();
|
Gv_ResetSystemDefaults();
|
||||||
|
|
||||||
for (i=0; i<(MAXVOLUMES*MAXLEVELS); i++)
|
for (i=0; i<(MAXVOLUMES*MAXLEVELS); i++)
|
||||||
|
|
Loading…
Reference in a new issue