From: Rudolf Polzer Date: Sun, 10 Jun 2012 16:42:46 +0000 (+0200) Subject: clarify cvar_set() vs autocvars X-Git-Tag: xonotic-v0.7.0~312^2~31 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=d932aa4920430f0f5bc5b1bec31cc86fc4d13eb8;p=xonotic%2Fxonotic-data.pk3dir.git clarify cvar_set() vs autocvars --- diff --git a/qcsrc/dpdefs/dpextensions.qc b/qcsrc/dpdefs/dpextensions.qc index 0acf262b1..114e84803 100644 --- a/qcsrc/dpdefs/dpextensions.qc +++ b/qcsrc/dpdefs/dpextensions.qc @@ -593,9 +593,11 @@ float(float a) tan = #475; // returns tangent value (which is simply sin(a)/cos( // string autocvar__cl_name; //NOTE: copying a string-typed autocvar to another variable/field, and then //changing the cvar or returning from progs is UNDEFINED. Writing to autocvar -//globals is UNDEFINED. Accessing autocvar globals after cvar_set()ing that -//cvar in the same frame is IMPLEMENTATION DEFINED (an implementation may -//either yield the previous, or the current, value). Whether autocvar globals, +//globals is UNDEFINED. Accessing autocvar globals after changing that cvar in +//the same frame by any means other than cvar_set() from the same QC VM is +//IMPLEMENTATION DEFINED (an implementation may either yield the previous, or +//the current, value). Changing them via cvar_set() in the same QC VM +//immediately must reflect on the autocvar globals. Whether autocvar globals, //after restoring a savegame, have the cvar's current value, or the original //value at time of saving, is UNDEFINED. Restoring a savegame however must not //restore the cvar values themselves.