From: Mario Date: Tue, 26 Jan 2016 04:45:32 +0000 (+1000) Subject: Revert to old loop method (seems to fix settemp) X-Git-Tag: xonotic-v0.8.2~1218 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=af15ed319a9256096c1306ecf88aba3bac7f894b;p=xonotic%2Fxonotic-data.pk3dir.git Revert to old loop method (seems to fix settemp) --- 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; }