]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/util.qc
Add translation helpers to /lib
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / util.qc
index 4a3b2dbf4924feebfb9bbf6e5b6a61c25d2bfa3f..56d64f5614ccf9e503afbd2c012c501f0cf55548 100644 (file)
@@ -5,6 +5,7 @@
     #include "../client/defs.qh"
     #include "constants.qh"
     #include "../warpzonelib/mathlib.qh"
+       #include "../client/mutators/events.qh"
     #include "mapinfo.qh"
     #include "notifications.qh"
     #include "deathtypes.qh"
@@ -16,6 +17,7 @@
     #include "constants.qh"
     #include "../server/autocvars.qh"
     #include "../server/defs.qh"
+       #include "../server/mutators/events.qh"
     #include "notifications.qh"
     #include "deathtypes.qh"
     #include "mapinfo.qh"
@@ -2059,6 +2061,10 @@ float get_model_parameters(string m, float sk)
        }
        get_model_parameters_fixbone = 0;
 
+#ifndef MENUQC
+       MUTATOR_CALLHOOK(ClearModelParams);
+#endif
+
        if (!m)
                return 1;
 
@@ -2120,6 +2126,9 @@ float get_model_parameters(string m, float sk)
                        get_model_parameters_bone_upperbody = s;
                if(c == "bone_weapon")
                        get_model_parameters_bone_weapon = s;
+       #ifndef MENUQC
+               MUTATOR_CALLHOOK(GetModelParams, c, s);
+       #endif
                for(int i = 0; i < MAX_AIM_BONES; ++i)
                        if(c == strcat("bone_aim", ftos(i)))
                        {
@@ -2236,30 +2245,6 @@ float u8_strsize(string s)
        return l;
 }
 
-// translation helpers
-string language_filename(string s)
-{
-       string fn;
-       float fh;
-       fn = prvm_language;
-       if(fn == "" || fn == "dump")
-               return s;
-       fn = strcat(s, ".", fn);
-       if((fh = fopen(fn, FILE_READ)) >= 0)
-       {
-               fclose(fh);
-               return fn;
-       }
-       return s;
-}
-string CTX(string s)
-{
-       float p = strstrofs(s, "^", 0);
-       if(p < 0)
-               return s;
-       return substring(s, p+1, -1);
-}
-
 // x-encoding (encoding as zero length invisible string)
 const string XENCODE_2  = "xX";
 const string XENCODE_22 = "0123456789abcdefABCDEF";
@@ -2570,7 +2555,7 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t
 #ifdef SVQC
 vector combine_to_vector(float x, float y, float z)
 {
-       vector result; result.x = x; result.y = y; result.z = z;
+       vector result; result_x = x; result_y = y; result_z = z;
        return result;
 }