]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/util.qc
reduce scope of variable
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / util.qc
index d83871080d1f19167fd803096f8ef03efd2cb11f..e68d19c075b212e42715ec19e3992e7e66e27cd6 100644 (file)
 */
 vector real_origin(entity ent)
 {
-       entity e;
        vector v = ((ent.absmin + ent.absmax) * 0.5);
+       entity e = ent.tag_entity;
 
-       e = ent.tag_entity;
        while(e)
        {
                v = v + ((e.absmin + e.absmax) * 0.5);
@@ -414,11 +413,11 @@ string fixPriorityList(string order, float from, float to, float subtract, float
 string mapPriorityList(string order, string(string) mapfunc)
 {
        string neworder;
-       float i, n;
+       float n;
 
        n = tokenize_console(order);
        neworder = "";
-       for(i = 0; i < n; ++i)
+       for(float i = 0; i < n; ++i)
                neworder = strcat(neworder, mapfunc(argv(i)), " ");
 
        return substring(neworder, 0, strlen(neworder) - 1);
@@ -1078,17 +1077,17 @@ float compressShotOrigin(vector v)
        float rz = rint(v.z * 4) + 128;
        if(rx > 255 || rx < 0)
        {
-               LOG_INFO("shot origin ", vtos(v), " x out of bounds\n");
+               LOG_DEBUG("shot origin ", vtos(v), " x out of bounds\n");
                rx = bound(0, rx, 255);
        }
        if(ry > 255 || ry < 0)
        {
-               LOG_INFO("shot origin ", vtos(v), " y out of bounds\n");
+               LOG_DEBUG("shot origin ", vtos(v), " y out of bounds\n");
                ry = bound(0, ry, 255);
        }
        if(rz > 255 || rz < 0)
        {
-               LOG_INFO("shot origin ", vtos(v), " z out of bounds\n");
+               LOG_DEBUG("shot origin ", vtos(v), " z out of bounds\n");
                rz = bound(0, rz, 255);
        }
        return rx * 0x10000 + ry * 0x100 + rz;