]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use macros for labels
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 22 Mar 2016 08:15:50 +0000 (19:15 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 22 Mar 2016 08:15:50 +0000 (19:15 +1100)
17 files changed:
qcsrc/client/hud/hud_config.qc
qcsrc/client/scoreboard.qc
qcsrc/client/view.qc
qcsrc/common/command/rpn.qc
qcsrc/common/mutators/mutator/itemstime.qc
qcsrc/common/physics/player.qc
qcsrc/common/t_items.qc
qcsrc/lib/compiler.qh
qcsrc/lib/warpzone/common.qc
qcsrc/menu/item/nexposee.qc
qcsrc/menu/menu.qc
qcsrc/menu/xonotic/campaign.qc
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/waypoints.qc
qcsrc/server/ipban.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/sv_main.qc

index 8e69a2decde0d39e707e6fd2c093d4969214beb3..07166105e5f6f043d99d65ccb57e95da60275e35 100644 (file)
@@ -774,7 +774,7 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
                vector candidate_pos = '0 0 0';
                const float LEVELS_NUM = 4;
                float level_height = vid_conheight / LEVELS_NUM;
-:find_tab_panel
+LABEL(find_tab_panel)
                level = floor(tab_panel_pos.y / level_height) * level_height; //starting level
                candidate_pos.x = (!tab_backward) ? vid_conwidth : 0;
                start_posX = tab_panel_pos.x;
index c49fa65fc72b894bc44999393adf8c8de40b814d..a41c91f773b74dcbbf5b78126898c9f31e236b79 100644 (file)
@@ -410,7 +410,7 @@ void Cmd_HUD_SetFields(int argc)
                                        if(str == strtolower(scores_label[j]))
                                                goto found; // sorry, but otherwise fteqcc -O3 miscompiles this and warns about "unreachable code"
 
-:notfound
+LABEL(notfound)
                                if(str == "frags")
                                        j = SP_FRAGS;
                                else
@@ -419,7 +419,7 @@ void Cmd_HUD_SetFields(int argc)
                                                LOG_INFOF("^1Error:^7 Unknown score field: '%s'\n", str);
                                        continue;
                                }
-:found
+LABEL(found)
                                hud_field[hud_num_fields] = j;
                                if(j == ps_primary)
                                        have_primary = 1;
index 6e8487b96ae4cef8c41443addbef3864668c7fc8..8d001cb5920979590328368c366d56ab5eb9c434 100644 (file)
@@ -994,7 +994,7 @@ void HUD_Crosshair()
                                wcross_color = rainbow_prev_color;
                                break;
                        }
-                       :normalcolor
+LABEL(normalcolor)
                        default: { wcross_color = stov(autocvar_crosshair_color); break; }
                }
 
index 1ca075bbbdf1f614652985039cf575182f13a149..12bb99d1d3e862b43904298c57627bb1e874b05c 100644 (file)
@@ -437,7 +437,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                                if(argv(i) == argv(j))
                                                                        goto skip_union;
                                                        s = strcat(s, " ", argv(i));
-                                                       :skip_union
+LABEL(skip_union)
                                                }
                                                if(substring(s, 0, 1) == " ")
                                                        s = substring(s, 1, 99999);
@@ -480,7 +480,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                                if(argv(i) == argv(j))
                                                                        goto skip_difference;
                                                        s = strcat(s, " ", argv(i));
-                                                       :skip_difference
+LABEL(skip_difference)
                                                }
                                                if(substring(s, 0, 1) == " ")
                                                        s = substring(s, 1, 99999);
index e6599e6142922936c6e71aa2c57b488b491f3d16..6c7eb4d76f0f42d01a5dd25fd2c1a264e05c2ada 100644 (file)
@@ -367,7 +367,7 @@ void HUD_ItemsTime()
        id = it.m_id;
        icon = it.m_icon;
 
-       :iteration
+LABEL(iteration)
         float item_time = ItemsTime_time[id];
         if (item_time < -1)
         {
index 253010c0c957e981127a359863fa56f07b6ae5b3..545d71a21fff7d711e93da7f2df3c8115f15aed6 100644 (file)
@@ -1532,7 +1532,7 @@ void PM_Main(entity this)
        else
                PM_air(this, buttons_prev, maxspeed_mod);
 
-:end
+LABEL(end)
        if (IS_ONGROUND(this))
                this.lastground = time;
 
index e2bafb82fe5d1921eaa363f4f6f0d8a0d344fcd3..a381324f8990ea7613132f3086f2c9fbaaf9794f 100644 (file)
@@ -644,7 +644,7 @@ float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax
 
        return false;
 
-:YEAH
+LABEL(YEAH)
        switch(mode)
        {
                case ITEM_MODE_FUEL:
@@ -740,7 +740,7 @@ float Item_GiveTo(entity item, entity player)
                player.superweapons_finished = max(player.superweapons_finished, time) + item.superweapons_finished;
        }
 
-:skip
+LABEL(skip)
 
        // always eat teamed entities
        if(item.team)
@@ -811,7 +811,7 @@ void Item_Touch()
                return;
        }
 
-       :pickup
+LABEL(pickup)
 
        other.last_pickup = time;
 
index 14824dc5a78362a5f0de8516601eb2f9f139fc7a..7cd34bc8487bfae058f168ca4471a07e07156077 100644 (file)
@@ -11,3 +11,9 @@
                #define QCC_SUPPORT_NIL
        #endif
 #endif
+
+#ifdef GMQCC
+    #define LABEL(id) :id
+#else
+    #define LABEL(id) id:
+#endif
index e5cd1515afb4e7f5cf2d7926dfc08658d605a1fe..7309ff79b8c16b4e7280f79600a3a0f1e9f77ed6 100644 (file)
@@ -320,7 +320,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
                org = trace_endpos;
        }
        WarpZone_MakeAllOther();
-:fail
+LABEL(fail)
        if(contentshack)
                BITCLR_ASSIGN(WarpZone_trace_forent.dphitcontentsmask, DPCONTENTS_SOLID);
        trace_startsolid = sol;
@@ -438,7 +438,7 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo
                e.velocity = -e.velocity;
        }
        WarpZone_MakeAllOther();
-:fail
+LABEL(fail)
        WarpZone_tracetoss_velocity = e.velocity;
        v_forward = vf;
        v_right = vr;
index 3e3575f4f9888cb2cc4bca541b8a6652fd9a0c1d..c0f18cf859476eff528f0f9a9ebb10a1eee3acdd 100644 (file)
@@ -67,7 +67,7 @@
                        }
 
                        break;
-                       : have_overlap
+LABEL(have_overlap)
                }
 
                scale *= 0.95;
index 70c8aedc48928aa57aaed8e6dd7edc26fd18f7ed..e523a51937943b340b3e94f473c84e32b58753ae 100644 (file)
@@ -399,7 +399,7 @@ void drawBackground(string img, float a, string algn, float force1)
                        draw_Picture_Aligned(v, scalemode, strcat(img, "_l", ftos(l + 1)), a);
                }
                ++l;
-               : nopic
+LABEL(nopic)
        }
 }
 
index b6dfc60b014bc8a74595efb742eecec5ad5ed5af..cb418a4e1834fcce6076672f337e818fef681ca5 100644 (file)
@@ -37,11 +37,11 @@ void rewrapCampaign(float w, float l0, float emptyheight, vector theFontSize)
                        }
                }
                goto nottoolong;
-:toolong
+LABEL(toolong)
                while(substring(r, strlen(r) - 1, 1) == "\n")
                        r = substring(r, 0, strlen(r) - 1);
                r = strcat(r, "...\n");
-:nottoolong
+LABEL(nottoolong)
                campaign_longdesc_wrapped[i] = strzone(substring(r, 0, strlen(r) - 1));
        }
 }
index a2e1372da7fcacec8522ae1c1ce5e02a09d91410..e83007d9bdbfef6e8d2f39c2988ce063937ef27d 100644 (file)
@@ -917,7 +917,7 @@ void havocbot_chooseenemy()
        while(true)
        {
                scan_secondary_targets = false;
-               :scan_targets
+LABEL(scan_targets)
                for( ; head; head = head.chain)
                {
                        if(!scan_secondary_targets)
index a19b2a095d368f92631ee4fcb7a050b717449ba2..0abc94a0d452fa3cf348196529fa4771c60c4f5f 100644 (file)
@@ -1109,7 +1109,7 @@ void botframe_deleteuselesswaypoints()
                                        goto next;
                                }
                        }
-:next
+LABEL(next)
                }
        }
        // d) The waypoint is a dead end. Dead end waypoints must be kept as
index deffa8e0386c470aba82d7c2bac2179b83e06bce..d129d994f4db575187797ec149ab315626cba43b 100644 (file)
@@ -192,7 +192,7 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
                LOG_INFO("Ban list syncing: accepted ban of ", ip, " by ", serverip, " at ", uri, ": ");
                LOG_INFO(reason, "\n");
 
-:skip
+LABEL(skip)
        }
 }
 
@@ -242,7 +242,7 @@ void OnlineBanList_Think()
                goto killme;
        return;
 
-:killme
+LABEL(killme)
        remove(self);
 }
 
@@ -380,7 +380,7 @@ float Ban_GetClientIP(entity client)
        ban_ip4 = strcat1(s); // 32
        return true;
 
-:ipv6
+LABEL(ipv6)
        i1 = strstrofs(s, ":", 0);
        if(i1 < 0)
                return false;
index 34ed909b65a145f08fc0200ab445e56b880328f6..d1316d2883b64fbf5ff6c672e25700c9c00170c0 100644 (file)
@@ -760,7 +760,7 @@ void kh_Key_Think()  // runs all the time
                        if(vlen(key.owner.origin - p) > autocvar_g_balance_keyhunt_maxdist)
                                goto not_winning;
                kh_WinnerTeam(self.team);
-:not_winning
+LABEL(not_winning)
        }
 
        if(kh_interferemsg_time && time > kh_interferemsg_time)
index ad1b4588e90c9aa488e17fd3cc64cc78e6ad375a..4aa404d75979f85c4c7e320f19e4b8a5f6228e98 100644 (file)
@@ -348,7 +348,7 @@ void SV_OnEntityPreSpawnFunction()
                        }
                }
                inv = !inv;
-:cvar_fail
+LABEL(cvar_fail)
                // now inv is 1 if we want to keep the item, and 0 if we want to get rid of it
                if (!inv)
                {