fix an infinite loop if an engine cvar is being restored, that did not
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 25 Jul 2012 07:45:10 +0000 (07:45 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 25 Jul 2012 07:45:10 +0000 (07:45 +0000)
exist at init (but it still warns about it), thanks to Omega for
debugging this

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11836 d7cf8633-e32d-0410-b094-e92efae38249

cvar.c

diff --git a/cvar.c b/cvar.c
index 521e284..b88aafd 100644 (file)
--- a/cvar.c
+++ b/cvar.c
@@ -747,6 +747,7 @@ void Cvar_RestoreInitState(void)
                        if (!(c->flags & CVAR_ALLOCATED))
                        {
                                Con_DPrintf("Cvar_RestoreInitState: Unable to destroy cvar \"%s\", it was registered after init!\n", c->name);
+                               cp = &c->next;
                                continue;
                        }
                        // remove this cvar, it did not exist at init