Work around a gmqcc bug
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 25 Jan 2015 04:26:33 +0000 (15:26 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 25 Jan 2015 04:26:33 +0000 (15:26 +1100)
25 files changed:
qcsrc/client/View.qc
qcsrc/client/bgmscript.qc
qcsrc/client/hud.qc
qcsrc/client/sortlist.qc
qcsrc/common/mapinfo.qc
qcsrc/common/notifications.qc
qcsrc/common/util.qc
qcsrc/menu/item/listbox.qc
qcsrc/menu/xonotic/colorpicker.qc
qcsrc/server/bot/havocbot/role_onslaught.qc
qcsrc/server/bot/navigation.qc
qcsrc/server/bot/scripting.qc
qcsrc/server/bot/waypoints.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/command/vote.qc
qcsrc/server/g_subs.qc
qcsrc/server/g_tetris.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/gamemode_assault.qc
qcsrc/server/mutators/sandbox.qc
qcsrc/server/scores.qc
qcsrc/server/weapons/tracing.qc
qcsrc/warpzonelib/common.qc
qcsrc/warpzonelib/server.qc

index 013fd2e..59382a8 100644 (file)
@@ -31,7 +31,7 @@ void Porto_Draw()
        portal_number = 0;
        nextdir = dir;
 
-       for(;;)
+       for(0;;)
        {
                dir = nextdir;
                traceline(p, p + 65536 * dir, TRUE, porto);
index 9d02494..800e899 100644 (file)
@@ -195,7 +195,7 @@ float BGMScript(entity e)
        }
 
        // find the CURRENT line
-       for(;;)
+       for(0;;)
        {
                tokenize_console(bufstr_get(bgmscriptbuf, e.bgmscriptline));
                if(stof(argv(1)) >= bgmtime || argv(0) != e.bgmscript)
index 33d7f9f..067770c 100644 (file)
@@ -3769,7 +3769,7 @@ void HUD_InfoMessages(void)
                        tm = teams.sort_next;
                        if (tm)
                        {
-                               for(; tm.sort_next; tm = tm.sort_next)
+                               for(0; tm.sort_next; tm = tm.sort_next)
                                {
                                        if(!tm.team_size || tm.team == NUM_SPECTATOR)
                                                continue;
index 225df0c..8537dd3 100644 (file)
@@ -92,7 +92,7 @@ void Sort_Finish(entity sort)
 
 entity Sort_Get(entity sort, float i)
 {
-       for(; sort.sort_next && i > 0; --i)
+       for(0; sort.sort_next && i > 0; --i)
                sort = sort.sort_next;
        return sort;
 }
index 0e84029..2654d87 100644 (file)
@@ -255,7 +255,7 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
        mapMins = '0 0 0';
        mapMaxs = '0 0 0';
 
-       for(;;)
+       for(0;;)
        {
                if (!((s = fgets(fh))))
                        break;
@@ -789,7 +789,7 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s,
                                print("Map ", pFilename, " references not existing config file ", s, "\n");
                        else
                        {
-                               for(;;)
+                               for(0;;)
                                {
                                        if (!((s = fgets(fh))))
                                                break;
@@ -932,7 +932,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                        {
                                n = tokenize_console(cvar_string("g_cdtracks_remaplist"));
                                s = strcat(" ", cvar_string("g_cdtracks_dontusebydefault"), " ");
-                               for(;;)
+                               for(0;;)
                                {
                                        i = floor(random() * n);
                                        if(strstrofs(s, strcat(" ", argv(i), " "), 0) < 0)
@@ -980,7 +980,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
        }
 
        _MapInfo_Map_Reset();
-       for(;;)
+       for(0;;)
        {
                if (!((s = fgets(fh))))
                        break;
index 3e2de3e..5bb9fcd 100644 (file)
@@ -306,7 +306,7 @@ string Process_Notif_Args(
        string selected, remaining = args;
        float sel_num = 0;
 
-       for(;(remaining != "");)
+       for(0;(remaining != "");)
        {
                selected = car(remaining); remaining = cdr(remaining);
 
index e5eadc4..9e022a8 100644 (file)
@@ -2538,7 +2538,7 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t
        queue_end.FindConnectedComponent_processing = 1;
 
        // for each queued item:
-       for(; queue_start; queue_start = queue_start.fld)
+       for(0; queue_start; queue_start = queue_start.fld)
        {
                // find all neighbors of queue_start
                entity t;
index 275b997..b92beb3 100644 (file)
@@ -131,7 +131,7 @@ float ListBox_keyDown(entity me, float key, float ascii, float shift)
        {
                float i = me.selectedItem;
                float a = me.getItemHeight(me, i);
-               for(;;)
+               for(0;;)
                {
                        --i;
                        if (i < 0)
@@ -146,7 +146,7 @@ float ListBox_keyDown(entity me, float key, float ascii, float shift)
        {
                float i = me.selectedItem;
                float a = me.getItemHeight(me, i);
-               for(;;)
+               for(0;;)
                {
                        ++i;
                        if (i >= me.nItems)
@@ -369,7 +369,7 @@ void ListBox_draw(entity me)
        float y;
        i = me.getItemAtPos(me, me.scrollPos);
        y = me.getItemStart(me, i) - me.scrollPos;
-       for(; i < me.nItems && y < 1; ++i)
+       for(0; i < me.nItems && y < 1; ++i)
        {
                draw_shift = boxToGlobal(eY * y, oldshift, oldscale);
                vector relSize = eX * (1 - me.controlWidth) + eY * me.getItemHeight(me, i);
index e072737..6e55a58 100644 (file)
@@ -73,7 +73,7 @@ vector color_hslimage(vector v, vector margin)
 float XonoticColorpicker_mouseDrag(entity me, vector coords)
 {
        float i, carets;
-       for(;;)
+       for(0;;)
        {
                i = me.controlledTextbox.cursorPos;
                if(i >= 2)
index bf5a643..c9bf609 100644 (file)
@@ -118,7 +118,7 @@ void havocbot_goalrating_ons_controlpoints_attack(float ratingscale)
        cp1 = cp2 = findchain(classname, "onslaught_controlpoint");
 
        // Filter control points
-       for (; cp2; cp2 = cp2.chain)
+       for(0; cp2; cp2 = cp2.chain)
        {
                cp2.wpcost = c = 0;
                cp2.wpconsidered = FALSE;
@@ -154,7 +154,7 @@ void havocbot_goalrating_ons_controlpoints_attack(float ratingscale)
        // We'll consider only the best case
        bestvalue = 99999999999;
        cp = world;
-       for (; cp1; cp1 = cp1.chain)
+       for(0; cp1; cp1 = cp1.chain)
        {
                if (!cp1.wpconsidered)
                        continue;
index 0f4c330..d676c8e 100644 (file)
@@ -64,7 +64,7 @@ float tracewalk(entity e, vector start, vector m1, vector m2, vector end, float
        // Movement loop
        yaw = vectoyaw(move);
        move = end - org;
-       for (;;)
+       for(0;;)
        {
                if (boxesoverlap(end, end, org + m1 + '-1 -1 -1', org + m2 + '1 1 1'))
                {
@@ -108,7 +108,7 @@ float tracewalk(entity e, vector start, vector m1, vector m2, vector end, float
                        {
                                swimming = TRUE;
                                org = trace_endpos - normalize(org - trace_endpos) * stepdist;
-                               for(; org_z < end_z + self.maxs_z; org_z += stepdist)
+                               for(0; org_z < end_z + self.maxs_z; org_z += stepdist)
                                {
                                                if(autocvar_bot_debug_tracewalk)
                                                        debugnode(org);
@@ -880,7 +880,7 @@ float navigation_routetogoal(entity e, vector startposition)
        if(e == world)
                return FALSE;
 
-       for (;;)
+       for(0;;)
        {
                // add the spawnfunc_waypoint to the path
                navigation_pushroute(e);
index 1770b4c..99c2ba8 100644 (file)
@@ -39,7 +39,7 @@ void bot_queuecommand(entity bot, string cmdstring)
                        if(cmdstr == "sound")
                        {
                                // find the LAST word
-                               for(;;)
+                               for(0;;)
                                {
                                        sp = strstrofs(parm, " ", 0);
                                        if(sp < 0)
index 870a558..d7159c1 100644 (file)
@@ -985,7 +985,7 @@ float botframe_autowaypoints_fix_from(entity p, float walkfromwp, entity wp, .en
 
        tmin = 0;
        tmax = 1;
-       for(;;)
+       for(0;;)
        {
                if(tmax - tmin < 0.001)
                {
index 27ed6b8..ad4f4da 100644 (file)
@@ -85,7 +85,7 @@ void GameCommand_adminmsg(float request, float argc)
 
                        if((targets) && (admin_message))
                        {
-                               for(;targets;)
+                               for(0;targets;)
                                {
                                        t = car(targets); targets = cdr(targets);
 
@@ -1024,7 +1024,7 @@ void GameCommand_moveplayer(float request, float argc)
                        // lets see if the target(s) even actually exist.
                        if((targets) && (destination))
                        {
-                               for(;targets;)
+                               for(0;targets;)
                                {
                                        t = car(targets); targets = cdr(targets);
 
@@ -1376,7 +1376,7 @@ void GameCommand_shuffleteams(float request)
                                // build a list of the players in a random order
                                FOR_EACH_PLAYER(tmp_player)
                                {
-                                       for(;;)
+                                       for(0;;)
                                        {
                                                i = bound(1, floor(random() * maxclients) + 1, maxclients);
 
@@ -1518,7 +1518,7 @@ void GameCommand_trace(float request, float argc)
                                        float hitcount = 0;
                                        print("TEST CASE. If this returns the runaway loop counter error, possibly everything is oaky.\n");
                                        float worst_endpos_bug = 0;
-                                       for(;;)
+                                       for(0;;)
                                        {
                                                org = world.mins;
                                                delta = world.maxs - world.mins;
@@ -1547,7 +1547,7 @@ void GameCommand_trace(float request, float argc)
                                                                // how much do we need to back off?
                                                                safe = 1;
                                                                unsafe = 0;
-                                                               for(;;)
+                                                               for(0;;)
                                                                {
                                                                        pos = p * (1 - (safe + unsafe) * 0.5) + start * ((safe + unsafe) * 0.5);
                                                                        tracebox(pos, PL_MIN, PL_MAX, pos, MOVE_NOMONSTERS, world);
@@ -1581,7 +1581,7 @@ void GameCommand_trace(float request, float argc)
                                                                q0 = p;
                                                                dq = 0;
                                                                dqf = 1;
-                                                               for(;;)
+                                                               for(0;;)
                                                                {
                                                                        q = p + normalize(end - p) * (dq + dqf);
                                                                        if(q == q0)
index 214083e..fb09b7e 100644 (file)
@@ -615,7 +615,7 @@ float VoteCommand_checkargs(float startpos, float argc)
 
        p = strstrofs(cmdrestriction, ";", 0); // find first semicolon
 
-       for(;;)
+       for(0;;)
        {
                // we know that at any time, startpos <= argc - minargs
                // so this means: argc-minargs >= startpos >= argc, thus
index fd0dc78..7f8fc68 100644 (file)
@@ -554,7 +554,7 @@ float tracebox_inverted (vector v1, vector mi, vector ma, vector v2, float nomon
        float c;
        c = 0;
 
-       for(;;)
+       for(0;;)
        {
                if(pos * dir >= v2 * dir)
                {
index f0ea33b..72e2fbd 100644 (file)
@@ -894,7 +894,7 @@ void CompletedLines()
 
        cleared = 0;
        y = TET_LINES;
-       for(;;)
+       for(0;;)
        {
                ln = GetLine(y);
                if(strstrofs(ln, "0", 0) < 0)
index 2a70675..1962d63 100644 (file)
@@ -439,7 +439,7 @@ void detect_maptype()
        vector o, v;
        float i;
 
-       for(;;)
+       for(0;;)
        {
                o = world.mins;
                o_x += random() * (world.maxs_x - world.mins_x);
index 8035612..43ebb25 100644 (file)
@@ -1045,7 +1045,7 @@ const float SND_LARGESOUND = 16;
 float sound_allowed(float dest, entity e)
 {
     // sounds from world may always pass
-    for (;;)
+    for(0;;)
     {
         if (e.classname == "body")
             e = e.enemy;
@@ -1484,7 +1484,7 @@ void InitializeEntity(entity e, void(void) func, float order)
 
     cur = initialize_entity_first;
     prev = world;
-    for (;;)
+    for(0;;)
     {
         if (!cur || cur.initialize_entity_order > order)
         {
index 8a8c50b..a62460e 100644 (file)
@@ -338,7 +338,7 @@ void havocbot_goalrating_ast_targets(float ratingscale)
 
        ad = findchain(classname, "func_assault_destructible");
 
-       for (; ad; ad = ad.chain)
+       for(0; ad; ad = ad.chain)
        {
                if (ad.target == "")
                        continue;
index e84c6d6..dec1bf3 100644 (file)
@@ -393,7 +393,7 @@ void sandbox_Database_Load()
        }
        else
        {
-               for(;;)
+               for(0;;)
                {
                        file_read = fgets(file_get);
                        if(file_read == "")
index bd83f0b..d1a832e 100644 (file)
@@ -833,7 +833,7 @@ void Score_NicePrint_Player(entity to, entity p, float w)
        sk = p.scorekeeper;
 
        s = strcat(s, p.netname);
-       for(;;)
+       for(0;;)
        {
                i = strlennocol(s) - NAMEWIDTH;
                if(i > 0)
index 55e6d54..dfe318c 100644 (file)
@@ -363,7 +363,7 @@ void fireBullet(vector start, vector dir, float spread, float max_solid_penetrat
 
        WarpZone_trace_forent = self;
 
-       for (;;)
+       for(0;;)
        {
                // TODO also show effect while tracing
                WarpZone_TraceBox_ThroughZone(start, '0 0 0', '0 0 0', end, FALSE, WarpZone_trace_forent, world, fireBullet_trace_callback);
index c1b3614..222d667 100644 (file)
@@ -263,7 +263,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
        sol = -1;
        frac = 0;
        i = 16;
-       for(;;)
+       for(0;;)
        {
                if(--i < 1)
                {
@@ -386,7 +386,7 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo
        }
        WarpZone_MakeAllSolid();
        i = 16;
-       for(;;)
+       for(0;;)
        {
                if(--i < 1)
                {
index 4b18d38..7e83c35 100644 (file)
@@ -834,7 +834,7 @@ void WarpZone_StartFrame()
                if(IS_NOT_A_CLIENT(e))
                {
                        if(warpzone_warpzones_exist)
-                               for(; (e = nextent(e)); )
+                               for(0; (e = nextent(e)); )
                                        WarpZone_StoreProjectileData(e);
                        break;
                }