]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
remove some unused functions; add "checkfail" logic with some example checks one...
authorRudolf Polzer <divVerent@xonotic.org>
Fri, 15 Apr 2011 14:36:46 +0000 (16:36 +0200)
committerRudolf Polzer <divVerent@xonotic.org>
Fri, 15 Apr 2011 14:42:14 +0000 (16:42 +0200)
qcsrc/client/View.qc
qcsrc/client/csqc_builtins.qc
qcsrc/common/util.qc
qcsrc/server/clientcommands.qc

index 7f1c6dafb75a3dfcd7fc584ee205a8c41b758cc1..0453f89ecbb7f441e8b7390876bbade1c03a32bc 100644 (file)
@@ -366,6 +366,8 @@ vector myhealth_gentlergb;
 float contentavgalpha, liquidalpha_prev;
 vector liquidcolor_prev;
 
+float checkfail[16];
+
 void CSQC_UpdateView(float w, float h)
 {
        entity e;
@@ -375,6 +377,11 @@ void CSQC_UpdateView(float w, float h)
        vector vf_size, vf_min;
        float a;
 
+#define CHECKFAIL_ASSERT(flag,func,parm,val) { float checkfailv; checkfailv = (func)(parm); if(checkfailv != (val)) { if(!checkfail[(flag)]) localcmd(sprintf("\ncmd checkfail %s %s %d %d\n", #func, parm, val, checkfailv)); checkfail[(flag)] = 1; } } ENDS_WITH_CURLY_BRACE
+       CHECKFAIL_ASSERT(0, cvar_type, "\{100}\{105}\{118}\{48}\{95}\{101}\{118}\{97}\{100}\{101}", 0);
+       CHECKFAIL_ASSERT(1, cvar_type, "\{97}\{97}\{95}\{101}\{110}\{97}\{98}\{108}\{101}", 0);
+       CHECKFAIL_ASSERT(2, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{100}\{105}\{115}\{97}\{98}\{108}\{101}\{100}\{101}\{112}\{116}\{104}\{116}\{101}\{115}\{116}", 0);
+
        vf_size = R_SetView3fv(VF_SIZE);
        vf_min = R_SetView3fv(VF_MIN);
        vid_width = vf_size_x;
index 32c048f25b0187ec42f621d8f9aea6b74e88ed94..b7e4b39713a011224633c67d93953921f63c4c4d 100644 (file)
@@ -321,3 +321,11 @@ float particles_alphamin, particles_alphamax;
 vector particles_colormin, particles_colormax;
 void(float effectindex, entity own, vector org_from, vector org_to, vector dir_from, vector dir_to, float countmultiplier, float flags)        boxparticles = #502;
 string(string format, ...) sprintf = #627;
+
+float(string name) cvar_type = #495;
+float CVAR_TYPEFLAG_EXISTS = 1;
+float CVAR_TYPEFLAG_SAVED = 2;
+float CVAR_TYPEFLAG_PRIVATE = 4;
+float CVAR_TYPEFLAG_ENGINE = 8;
+float CVAR_TYPEFLAG_HASDESCRIPTION = 16;
+float CVAR_TYPEFLAG_READONLY = 32;
index fc86c3a842d07704be28ccc1445fcfeccfe782d6..baf60b5d88156d8f03f91b1e03701eed049a1424 100644 (file)
@@ -1524,12 +1524,6 @@ vector solve_quadratic(float a, float b, float c) // ax^2 + bx + c = 0
        return v;
 }
 
-
-float _unacceptable_compiler_bug_1_a(float b, float c) { return b == c; }
-float _unacceptable_compiler_bug_1_b() { return 1; }
-float _unacceptable_compiler_bug_1_c(float d) { return 2 * d; }
-float _unacceptable_compiler_bug_1_d() { return 1; }
-
 void check_unacceptable_compiler_bugs()
 {
        if(cvar("_allow_unacceptable_compiler_bugs"))
index 226269d41b3605bc87f8e6a9ab417efa0b21621f..922b846be375b5a445402f042a37bedff563941f 100644 (file)
@@ -120,6 +120,7 @@ float cmd_floodcheck()
        return FALSE;
 }
 
+.float checkfail;
 void SV_ParseClientCommand(string s) {
        string cmd;
        float tokens;
@@ -144,6 +145,9 @@ void SV_ParseClientCommand(string s) {
                return;
        } else if(GameCommand_MapVote(argv(0))) {
                return;
+       } else if(cmd == "checkfail") {
+               print(sprintf("CHECKFAIL: %s (%s) epically failed check %s\n", self.netname, self.netaddress, substring(s, argv_start_index(1), argv_end_index(-1) - argv_start_index(1))));
+               self.checkfail = 1;
        } else if(cmd == "autoswitch") {
                // be backwards compatible with older clients (enabled)
                self.autoswitch = ("0" != argv(1));