From af15ed319a9256096c1306ecf88aba3bac7f894b Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 26 Jan 2016 14:45:32 +1000 Subject: [PATCH] Revert to old loop method (seems to fix settemp) --- qcsrc/common/util.qc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 427bdb84b..a087c9faa 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -624,6 +624,8 @@ float cvar_settemp(string tmp_cvar, string tmp_value) int cvar_settemp_restore() { int j = 0; + // FIXME this new-style loop fails! +#if 0 FOREACH_ENTITY_CLASS("saved_cvar_value", true, { if(cvar_type(it.netname)) @@ -638,6 +640,21 @@ int cvar_settemp_restore() LOG_INFOF("Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.\n", it.netname); }); +#else + entity e = world; + while((e = find(e, classname, "saved_cvar_value"))) + { + if(cvar_type(e.netname)) + { + cvar_set(e.netname, e.message); + remove(e); + ++j; + } + else + print(sprintf("Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.\n", e.netname)); + } +#endif + return j; } -- 2.39.2