]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Style: expand LAMBDA()
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 5 Aug 2017 08:37:08 +0000 (18:37 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 5 Aug 2017 08:52:41 +0000 (18:52 +1000)
61 files changed:
qcsrc/common/mutators/base.qh
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/common/mutators/mutator/buffs/cl_buffs.qc
qcsrc/common/mutators/mutator/buffs/sv_buffs.qc
qcsrc/common/mutators/mutator/damagetext/sv_damagetext.qc
qcsrc/common/mutators/mutator/instagib/sv_instagib.qc
qcsrc/common/mutators/mutator/itemstime/itemstime.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/nades/nades.qh
qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc
qcsrc/common/mutators/mutator/nix/sv_nix.qc
qcsrc/common/mutators/mutator/pinata/sv_pinata.qc
qcsrc/common/mutators/mutator/sandbox/sv_sandbox.qc
qcsrc/common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qc
qcsrc/common/mutators/mutator/superspec/sv_superspec.qc
qcsrc/common/mutators/mutator/touchexplode/sv_touchexplode.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc
qcsrc/menu/xonotic/keybinder.qc
qcsrc/server/_all.qh
qcsrc/server/bot/default/bot.qc
qcsrc/server/bot/default/havocbot/havocbot.qc
qcsrc/server/bot/default/havocbot/roles.qc
qcsrc/server/bot/default/scripting.qc
qcsrc/server/bot/default/waypoints.qc
qcsrc/server/campaign.qc
qcsrc/server/cheats.qc
qcsrc/server/client.qc
qcsrc/server/command/common.qc
qcsrc/server/command/common.qh
qcsrc/server/command/reg.qh
qcsrc/server/command/sv_cmd.qc
qcsrc/server/command/vote.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_world.qc
qcsrc/server/mapvoting.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/miscfunctions.qh
qcsrc/server/mutators/loader.qc
qcsrc/server/mutators/mutator/gamemode_assault.qc
qcsrc/server/mutators/mutator/gamemode_ca.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qc
qcsrc/server/mutators/mutator/gamemode_cts.qc
qcsrc/server/mutators/mutator/gamemode_domination.qc
qcsrc/server/mutators/mutator/gamemode_freezetag.qc
qcsrc/server/mutators/mutator/gamemode_invasion.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/mutators/mutator/gamemode_lms.qc
qcsrc/server/mutators/mutator/gamemode_race.qc
qcsrc/server/player.qc
qcsrc/server/portals.qc
qcsrc/server/race.qc
qcsrc/server/scores.qc
qcsrc/server/spawnpoints.qc
qcsrc/server/sv_main.qc
qcsrc/server/teamplay.qc
qcsrc/server/weapons/accuracy.qc
qcsrc/server/weapons/spawning.qc
qcsrc/server/weapons/throwing.qc
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/weaponsystem.qc

index 7ef70f2c46b9db347c92f45b8d04444942531fca..4e7676c15ac33ab335035ce80df3ef2b766d06c7 100644 (file)
@@ -185,9 +185,9 @@ bool Mutator_SendEntity(entity this, entity to, int sf)
 void NET_Mutator_Remove(entity this)
 {
     string s = this.netname;
-    WITH(bool, mutator_log, true, LAMBDA(
+    WITH(bool, mutator_log, true, {
         FOREACH(Mutators, it.registered_id == s, Mutator_Remove(it));
-    ));
+    });
 }
 NET_HANDLE(Mutator, bool isNew)
 {
@@ -199,9 +199,9 @@ NET_HANDLE(Mutator, bool isNew)
         make_pure(this);
         this.entremove = NET_Mutator_Remove;
         int added = 0;
-        WITH(bool, mutator_log, true, LAMBDA(
+        WITH(bool, mutator_log, true, {
             FOREACH(Mutators, it.registered_id == s, { Mutator_Add(it); ++added; });
-        ));
+        });
         if (added > 1) LOG_WARNF("Added more than one mutator for %s", s);
     }
 }
index b80875e36ff8bb74bd0753006966a4095377c4ce..8ef69aad982f45e49e646d960143f2afb5900d09 100644 (file)
@@ -10,7 +10,7 @@ entity buff_FirstFromFlags(int _buffs)
 {
     if (flags)
     {
-        FOREACH(Buffs, it.m_itemid & _buffs, LAMBDA(return it));
+        FOREACH(Buffs, it.m_itemid & _buffs, { return it; });
     }
     return BUFF_Null;
 }
index ca1475372727fc1ccf6e0fbf387b609b8462edf7..a46a92d0aecdbfebfb844c0cc59610952dbbdf2d 100644 (file)
@@ -4,9 +4,9 @@ REGISTER_MUTATOR(cl_buffs, true);
 MUTATOR_HOOKFUNCTION(cl_buffs, HUD_Powerups_add)
 {
     int allBuffs = STAT(BUFFS);
-    FOREACH(Buffs, it.m_itemid & allBuffs, LAMBDA(
+    FOREACH(Buffs, it.m_itemid & allBuffs, {
                addPowerupItem(it.m_prettyName, strcat("buff_", it.m_name), it.m_color, bound(0, STAT(BUFF_TIME) - time, 99), 60);
-       ));
+       });
 }
 MUTATOR_HOOKFUNCTION(cl_buffs, WP_Format)
 {
index fdc555dd2a90ede54ae5bfe332cce78a9108b833..b9b2a8e06480603bccfc1612c843f903c8896de3 100644 (file)
@@ -637,7 +637,7 @@ MUTATOR_HOOKFUNCTION(buffs, ForbidThrowCurrentWeapon)
        {
                float best_distance = autocvar_g_buffs_swapper_range;
                entity closest = NULL;
-               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it), {
                        if(!IS_DEAD(it) && !STAT(FROZEN, it) && !it.vehicle)
                        if(DIFF_TEAM(it, player))
                        {
@@ -648,7 +648,7 @@ MUTATOR_HOOKFUNCTION(buffs, ForbidThrowCurrentWeapon)
                                        closest = it;
                                }
                        }
-               ));
+               });
 
                if(closest)
                {
index 8daf920307d96c3d533e6b0586f699b3d6a46fed..0e170e57ec6249fd4e3ed9e82a284145f691a078 100644 (file)
@@ -16,7 +16,7 @@ MUTATOR_HOOKFUNCTION(damagetext, PlayerDamaged) {
     const float armor = M_ARGV(3, float);
     const int deathtype = M_ARGV(5, int);
     const float potential_damage = M_ARGV(6, float);
-    FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
+    FOREACH_CLIENT(IS_REAL_CLIENT(it), {
         if (
             (SV_DAMAGETEXT_ALL()) ||
             (SV_DAMAGETEXT_PLAYERS() && it == attacker) ||
@@ -53,5 +53,5 @@ MUTATOR_HOOKFUNCTION(damagetext, PlayerDamaged) {
                 else WriteShort(MSG_ONE, potential_damage * DAMAGETEXT_PRECISION_MULTIPLIER);
                        }
         }
-    ));
+    });
 }
index 578294a725491b698591b37699f543b51a961a19..fefad540b24c6b18cb76a1f1d22196023458ce9e 100644 (file)
@@ -130,7 +130,7 @@ void instagib_ammocheck(entity this)
 
 MUTATOR_HOOKFUNCTION(mutator_instagib, MatchEnd)
 {
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(instagib_stop_countdown(it)));
+       FOREACH_CLIENT(IS_PLAYER(it), { instagib_stop_countdown(it); });
 }
 
 MUTATOR_HOOKFUNCTION(mutator_instagib, MonsterDropItem)
index 472fc646dbd9858615d6b25c80156073ad7d09d9..c2402ef4608c95d7b1f5fbb84e8f70768ffed1e9 100644 (file)
@@ -30,9 +30,9 @@ NET_HANDLE(itemstime, bool isNew)
 #ifdef CSQC
 void Item_ItemsTime_Init()
 {
-    FOREACH(Items, true, LAMBDA(
+    FOREACH(Items, true, {
         ItemsTime_time[it.m_id] = -1;
-    ));
+    });
     ItemsTime_time[Items_MAX] = -1;
 }
 
@@ -79,9 +79,9 @@ float it_times[Items_MAX + 1];
 
 void Item_ItemsTime_Init()
 {
-    FOREACH(Items, Item_ItemsTime_Allow(it), LAMBDA(
+    FOREACH(Items, Item_ItemsTime_Allow(it), {
         it_times[it.m_id] = -1;
-    ));
+    });
     it_times[Items_MAX] = -1;
 }
 
@@ -92,25 +92,25 @@ STATIC_INIT(ItemsTime_Init) {
 
 void Item_ItemsTime_ResetTimes()
 {
-    FOREACH(Items, Item_ItemsTime_Allow(it), LAMBDA(
+    FOREACH(Items, Item_ItemsTime_Allow(it), {
         it_times[it.m_id] = (it_times[it.m_id] == -1) ? -1 : 0;
-    ));
+    });
     it_times[Items_MAX] = (it_times[Items_MAX] == -1) ? -1 : 0;
 }
 
 void Item_ItemsTime_ResetTimesForPlayer(entity e)
 {
-    FOREACH(Items, Item_ItemsTime_Allow(it), LAMBDA(
+    FOREACH(Items, Item_ItemsTime_Allow(it), {
         IT_Write(e, it.m_id, (it_times[it.m_id] == -1) ? -1 : 0);
-    ));
+    });
     IT_Write(e, Items_MAX, (it_times[Items_MAX] == -1) ? -1 : 0);
 }
 
 void Item_ItemsTime_SetTimesForPlayer(entity e)
 {
-    FOREACH(Items, Item_ItemsTime_Allow(it), LAMBDA(
+    FOREACH(Items, Item_ItemsTime_Allow(it), {
         IT_Write(e, it.m_id, it_times[it.m_id]);
-    ));
+    });
     IT_Write(e, Items_MAX, it_times[Items_MAX]);
 }
 
@@ -131,7 +131,7 @@ void Item_ItemsTime_SetTime(entity e, float t)
 
 void Item_ItemsTime_SetTimesForAllPlayers()
 {
-    FOREACH_CLIENT(IS_REAL_CLIENT(it) && (warmup_stage || !IS_PLAYER(it) || autocvar_sv_itemstime == 2), LAMBDA(Item_ItemsTime_SetTimesForPlayer(it)));
+    FOREACH_CLIENT(IS_REAL_CLIENT(it) && (warmup_stage || !IS_PLAYER(it) || autocvar_sv_itemstime == 2), { Item_ItemsTime_SetTimesForPlayer(it); });
 }
 
 float Item_ItemsTime_UpdateTime(entity e, float t)
@@ -293,23 +293,23 @@ void HUD_ItemsTime()
     int count = 0;
     if (autocvar_hud_panel_itemstime_hidespawned == 1)
     {
-        FOREACH(Items, Item_ItemsTime_Allow(it), LAMBDA(
+        FOREACH(Items, Item_ItemsTime_Allow(it), {
             count += (Item_ItemsTime_GetTime(it.m_id) > time || -Item_ItemsTime_GetTime(it.m_id) > time);
-        ));
+        });
         count += (Item_ItemsTime_GetTime(Items_MAX) > time || -Item_ItemsTime_GetTime(Items_MAX) > time);
     }
     else if (autocvar_hud_panel_itemstime_hidespawned == 2)
     {
-        FOREACH(Items, Item_ItemsTime_Allow(it), LAMBDA(
+        FOREACH(Items, Item_ItemsTime_Allow(it), {
             count += (Item_ItemsTime_GetTime(it.m_id) > time);
-        ));
+        });
         count += (Item_ItemsTime_GetTime(Items_MAX) > time);
     }
     else
     {
-        FOREACH(Items, Item_ItemsTime_Allow(it), LAMBDA(
+        FOREACH(Items, Item_ItemsTime_Allow(it), {
             count += (Item_ItemsTime_GetTime(it.m_id) != -1);
-        ));
+        });
         count += (Item_ItemsTime_GetTime(Items_MAX) != -1);
     }
     if (count == 0)
@@ -385,7 +385,7 @@ void HUD_ItemsTime()
     bool item_available;
     int id = 0;
     string icon = "";
-    FOREACH(Items, Item_ItemsTime_Allow(it) && Item_ItemsTime_GetTime(it.m_id) != -1, LAMBDA(
+    FOREACH(Items, Item_ItemsTime_Allow(it) && Item_ItemsTime_GetTime(it.m_id) != -1, {
        id = it.m_id;
        icon = it.m_icon;
 
@@ -429,7 +429,7 @@ LABEL(iteration)
         }
         if(id == Items_MAX) // can happen only in the last fake iteration
                break;
-    ));
+    });
     // add another fake iteration for superweapons time
     if(id < Items_MAX && Item_ItemsTime_GetTime(Items_MAX) != -1)
     {
index 9447ba3955e9d14355a539e45dc702b81612243a..77286eac5d4ca9cdde169e743e5f1366dc12c0e4 100644 (file)
@@ -16,7 +16,7 @@ entity Nade_TrailEffect(int proj, int nade_team)
         case PROJECTILE_NADE_BURN:  return EFFECT_NADE_TRAIL_BURN(nade_team);
     }
 
-    FOREACH(Nades, true, LAMBDA(
+    FOREACH(Nades, true, {
         for (int j = 0; j < 2; j++)
         {
             if (it.m_projectile[j] == proj)
@@ -26,7 +26,7 @@ entity Nade_TrailEffect(int proj, int nade_team)
                 break;
             }
         }
-    ));
+    });
 
     return EFFECT_Null;
 }
@@ -1278,7 +1278,7 @@ MUTATOR_HOOKFUNCTION(nades, PlayerPreThink)
        {
                vector revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
                n = 0;
-               FOREACH_CLIENT(IS_PLAYER(it) && it != player, LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it) && it != player, {
                        if(!IS_DEAD(it))
                        if(STAT(FROZEN, it) == 0)
                        if(SAME_TEAM(it, player))
@@ -1290,7 +1290,7 @@ MUTATOR_HOOKFUNCTION(nades, PlayerPreThink)
                                        it.reviving = true;
                                ++n;
                        }
-               ));
+               });
        }
 
        if(n && STAT(FROZEN, player) == 3) // OK, there is at least one teammate reviving us
@@ -1306,10 +1306,10 @@ MUTATOR_HOOKFUNCTION(nades, PlayerPreThink)
                        Send_Notification(NOTIF_ONE, o, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
                }
 
-               FOREACH_CLIENT(IS_PLAYER(it) && it.reviving, LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it) && it.reviving, {
                        it.revive_progress = player.revive_progress;
                        it.reviving = false;
-               ));
+               });
        }
 }
 
index fd8d26902a4f5b6665dd2238c83c4d0f9708a26d..3618fd4181c0a4854704905e0e29a7b54ac971fb 100644 (file)
@@ -42,12 +42,12 @@ REGISTER_NADE(Null);
 
 Nade Nade_FromProjectile(int proj)
 {
-    FOREACH(Nades, true, LAMBDA(
+    FOREACH(Nades, true, {
         for (int j = 0; j < 2; j++)
         {
             if (it.m_projectile[j] == proj) return it;
         }
-    ));
+    });
     return NADE_TYPE_Null;
 }
 
index 7cf5b430dd736b5b7c331766babe7f99b07eadf7..277a4e7dba0155fbaab58120edbd3ca6742a836c 100644 (file)
@@ -78,18 +78,18 @@ REGISTER_MUTATOR(nt, cvar("g_new_toys") && !cvar("g_instagib") && !cvar("g_overk
                        error("This cannot be added at runtime\n");
 
                // mark the guns as ok to use by e.g. impulse 99
-               FOREACH(Weapons, it != WEP_Null, LAMBDA(
+               FOREACH(Weapons, it != WEP_Null, {
                        if(nt_IsNewToy(it.m_id))
                                it.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
-               ));
+               });
        }
 
        MUTATOR_ONROLLBACK_OR_REMOVE
        {
-               FOREACH(Weapons, it != WEP_Null, LAMBDA(
+               FOREACH(Weapons, it != WEP_Null, {
                        if(nt_IsNewToy(it.m_id))
                                it.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
-               ));
+               });
        }
 
        MUTATOR_ONREMOVE
@@ -165,20 +165,20 @@ MUTATOR_HOOKFUNCTION(nt, SetStartItems)
 
        WepSet seti = '0 0 0';
 
-       FOREACH(Weapons, it != WEP_Null, LAMBDA(
+       FOREACH(Weapons, it != WEP_Null, {
                seti = it.m_wepset;
                n = tokenize_console(nt_GetReplacement(it.netname, autocvar_g_new_toys_autoreplace));
 
                for(j = 0; j < n; ++j)
-                       FOREACH(Weapons, it != WEP_Null, LAMBDA(
+                       FOREACH(Weapons, it != WEP_Null, {
                                if(it.netname == argv(j))
                                {
                                        WepSet setk = it.m_wepset;
                                        if(start_weapons & seti) newdefault |= setk;
                                        if(warmup_start_weapons & seti) warmup_newdefault |= setk;
                                }
-                       ));
-       ));
+                       });
+       });
 
        newdefault &= start_weapons_defaultmask;
        start_weapons &= ~start_weapons_defaultmask;
index 135e50793fa1eef7373f315d517e74f5d1d0b231..425b8c22b0e66f12e20115acbdc5a4cd6bdd0330 100644 (file)
@@ -44,7 +44,7 @@ REGISTER_MUTATOR(nix, cvar("g_nix") && !cvar("g_instagib") && !cvar("g_overkill"
                nix_nextchange = 0;
                nix_nextweapon = 0;
 
-               FOREACH(Weapons, it != WEP_Null && NIX_CanChooseWeapon(it.m_id), LAMBDA(it.wr_init(it)));
+               FOREACH(Weapons, it != WEP_Null && NIX_CanChooseWeapon(it.m_id), { it.wr_init(it); });
        }
 
        MUTATOR_ONROLLBACK_OR_REMOVE
@@ -100,10 +100,10 @@ bool NIX_CanChooseWeapon(int wpn)
 void NIX_ChooseNextWeapon()
 {
        RandomSelection_Init();
-       FOREACH(Weapons, it != WEP_Null, LAMBDA(
+       FOREACH(Weapons, it != WEP_Null, {
                if(NIX_CanChooseWeapon(it.m_id))
                        RandomSelection_AddFloat(it.m_id, 1, (it.m_id != nix_weapon));
-       ));
+       });
        nix_nextweapon = RandomSelection_chosen_float;
 }
 
index ff44cc8bd0a89facf0ab00abd49f4c861488f498..53e4f49e60aadf08b13f9eb0880d3fe18711acd1 100644 (file)
@@ -13,12 +13,12 @@ MUTATOR_HOOKFUNCTION(pinata, PlayerDies)
                if(frag_target.(weaponentity).m_weapon == WEP_Null)
                        continue;
 
-               FOREACH(Weapons, it != WEP_Null, LAMBDA(
+               FOREACH(Weapons, it != WEP_Null, {
                        if(frag_target.weapons & WepSet_FromWeapon(it))
                        if(frag_target.(weaponentity).m_weapon != it)
                        if(W_IsWeaponThrowable(frag_target, it.m_id))
                                W_ThrowNewWeapon(frag_target, it.m_id, false, CENTER_OR_VIEWOFS(frag_target), randomvec() * 175 + '0 0 325', weaponentity);
-               ));
+               });
        }
 
        return true;
index a2211fe75a2af294e229af70cafa403837c4a9df..0fd58c6804bbc8e2eac1a1f42b0fcda86d15455d 100644 (file)
@@ -75,14 +75,14 @@ void sandbox_ObjectFunction_Think(entity this)
        // since if the owning player disconnects, the object's owner should also be reset.
 
        // bots can't have objects
-       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {
                if(this.crypto_idfp == it.crypto_idfp)
                {
                        this.realowner = it;
                        break;
                }
                this.realowner = NULL;
-       ));
+       });
 
        this.nextthink = time;
 
@@ -209,7 +209,7 @@ void sandbox_ObjectRemove(entity e)
        sandbox_ObjectAttach_Remove(e); // detach child objects
 
        // if the object being removed has been selected for attachment by a player, unset it
-       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it.object_attach == e, LAMBDA(it.object_attach = NULL));
+       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it.object_attach == e, { it.object_attach = NULL; });
 
        if(e.material)  {       strunzone(e.material);  e.material = string_null;       }
        if(e.crypto_idfp)       {       strunzone(e.crypto_idfp);       e.crypto_idfp = string_null;    }
index ee75728630e2e5623f988e1d7efaf7b31d9f37d7..55bc12392d8e4704a2c52705361d06b102301c06 100644 (file)
@@ -33,7 +33,7 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, Spawn_Score)
                return;
 
        RandomSelection_Init();
-       FOREACH_CLIENT(IS_PLAYER(it) && it != player && SAME_TEAM(it, player) && !IS_DEAD(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && it != player && SAME_TEAM(it, player) && !IS_DEAD(it), {
                if(vdist(spawn_spot.origin - it.origin, >, autocvar_g_spawn_near_teammate_distance))
                        continue;
                if(vdist(spawn_spot.origin - it.origin, <, 48))
@@ -41,7 +41,7 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, Spawn_Score)
                if(!checkpvs(spawn_spot.origin, it))
                        continue;
                RandomSelection_AddEnt(it, 1, 1);
-       ));
+       });
 
        if(RandomSelection_chosen_ent)
        {
@@ -85,7 +85,7 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn)
                vector best_pos = '0 0 0';
                float best_dist2 = FLOAT_MAX;
                int tested = 0;
-               FOREACH_CLIENT_RANDOM(IS_PLAYER(it), LAMBDA(
+               FOREACH_CLIENT_RANDOM(IS_PLAYER(it), {
                        if (autocvar_g_spawn_near_teammate_ignore_spawnpoint_max && tested >= autocvar_g_spawn_near_teammate_ignore_spawnpoint_max) break;
 
                        if (PHYS_INPUT_BUTTON_CHAT(it)) continue;
@@ -196,7 +196,7 @@ LABEL(skip)
                                        break; // don't test the other spots near this teammate, go to the next one
                                }
                        }
-               ));
+               });
 
                if(autocvar_g_spawn_near_teammate_ignore_spawnpoint_closetodeath)
                if(best_mate)
index c423042a3c9b46fe5659cbafad09da16970a730f..4c99095b79df43f68e4daa402d97599cda72ebae 100644 (file)
@@ -103,7 +103,7 @@ MUTATOR_HOOKFUNCTION(superspec, ItemTouch)
        entity item = M_ARGV(0, entity);
        entity toucher = M_ARGV(1, entity);
 
-       FOREACH_CLIENT(true, LAMBDA(
+       FOREACH_CLIENT(true, {
                if(!IS_SPEC(it) && !IS_OBSERVER(it))
                        continue;
                if(it.superspec_flags & SSF_ITEMMSG)
@@ -143,7 +143,7 @@ MUTATOR_HOOKFUNCTION(superspec, ItemTouch)
                                }
                        }
                }
-       ));
+       });
 
        return MUT_ITEMTOUCH_CONTINUE;
 }
@@ -345,7 +345,7 @@ MUTATOR_HOOKFUNCTION(superspec, SV_ParseClientCommand)
 
        if(cmd_name == "followpowerup")
        {
-               FOREACH_CLIENT(IS_PLAYER(it) && (it.strength_finished > time || it.invincible_finished > time), LAMBDA(return superspec_Spectate(player, it)));
+               FOREACH_CLIENT(IS_PLAYER(it) && (it.strength_finished > time || it.invincible_finished > time), { return superspec_Spectate(player, it); });
 
                superspec_msg("", "", player, "No active powerup\n", 1);
                return true;
@@ -353,7 +353,7 @@ MUTATOR_HOOKFUNCTION(superspec, SV_ParseClientCommand)
 
        if(cmd_name == "followstrength")
        {
-               FOREACH_CLIENT(IS_PLAYER(it) && it.strength_finished > time, LAMBDA(return superspec_Spectate(player, it)));
+               FOREACH_CLIENT(IS_PLAYER(it) && it.strength_finished > time, { return superspec_Spectate(player, it); });
 
                superspec_msg("", "", player, "No active Strength\n", 1);
                return true;
@@ -361,7 +361,7 @@ MUTATOR_HOOKFUNCTION(superspec, SV_ParseClientCommand)
 
        if(cmd_name == "followshield")
        {
-               FOREACH_CLIENT(IS_PLAYER(it) && it.invincible_finished > time, LAMBDA(return superspec_Spectate(player, it)));
+               FOREACH_CLIENT(IS_PLAYER(it) && it.invincible_finished > time, { return superspec_Spectate(player, it); });
 
                superspec_msg("", "", player, "No active Shield\n", 1);
                return true;
@@ -440,7 +440,7 @@ MUTATOR_HOOKFUNCTION(superspec, PlayerDies)
        entity frag_attacker = M_ARGV(1, entity);
        entity frag_target = M_ARGV(2, entity);
 
-       FOREACH_CLIENT(IS_SPEC(it), LAMBDA(
+       FOREACH_CLIENT(IS_SPEC(it), {
                if(it.autospec_flags & ASF_FOLLOWKILLER && IS_PLAYER(frag_attacker) && it.enemy == frag_target)
                {
                        if(it.autospec_flags & ASF_SHOWWHAT)
@@ -448,7 +448,7 @@ MUTATOR_HOOKFUNCTION(superspec, PlayerDies)
 
                        superspec_Spectate(it, frag_attacker);
                }
-       ));
+       });
 }
 
 MUTATOR_HOOKFUNCTION(superspec, ClientDisconnect)
index ddcd891609a493fd33e4b413112a3f449ed0a9e3..3e6edb04b356cf4b722504cbe2d5b04af8f494c8 100644 (file)
@@ -33,7 +33,7 @@ MUTATOR_HOOKFUNCTION(touchexplode, PlayerPreThink)
        if(IS_PLAYER(player))
        if(!IS_DEAD(player))
        if(!IS_INDEPENDENT_PLAYER(player))
-               FOREACH_CLIENT(IS_PLAYER(it) && it != player, LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it) && it != player, {
                        if(time > it.touchexplode_time)
                        if(!STAT(FROZEN, it))
                        if(!IS_DEAD(it))
@@ -43,5 +43,5 @@ MUTATOR_HOOKFUNCTION(touchexplode, PlayerPreThink)
                                PlayerTouchExplode(player, it);
                                player.touchexplode_time = it.touchexplode_time = time + 0.2;
                        }
-               ));
+               });
 }
index 81f54b1c903807612713536ae6081ca311c77554..9e20392236ea32ccb73948c1a5707d93c304f1df 100644 (file)
@@ -259,9 +259,9 @@ string spritelookuptext(entity this, string s)
     }
 
     // need to loop, as our netname could be one of three
-    FOREACH(Waypoints, it.netname == s, LAMBDA(
+    FOREACH(Waypoints, it.netname == s, {
         return it.m_name;
-    ));
+    });
 
     return s;
 }
index 3ce8afcbb55098cfdf9fa086fd30a8ab76a72390..0ea24a8891931157853a55fe461888271abd5947 100644 (file)
@@ -41,10 +41,10 @@ string WeaponArenaString()
        s = "";
        for(i = 0; i < n; ++i)
        {
-               FOREACH(Weapons, it != WEP_Null, LAMBDA(
+               FOREACH(Weapons, it != WEP_Null, {
                        if(argv(i) == it.netname)
                                s = strcat(s, " & ", it.m_name);
-               ));
+               });
        }
        s = sprintf(_("%s Arena"), substring(s, 3, strlen(s) - 3));
 
index 4546a62b109503192359c91904ac49bae9b4053c..1f28a1bdfede23aa181f110ca297596457a85976 100644 (file)
@@ -51,11 +51,11 @@ void Xonotic_KeyBinds_Read()
        int i;
 
        #define ADD_TO_W_LIST(pred) \
-               FOREACH(Weapons, it != WEP_Null, LAMBDA( \
+               FOREACH(Weapons, it != WEP_Null, { \
                        if (it.impulse != imp) continue; \
                        if (!(pred)) continue; \
                        w_list = strcat(w_list, it.m_name, " / "); \
-               ))
+               })
 
        for(int imp = 1; imp <= 9; ++imp)
        {
index 1fabe4d0f965aa9abd6b564b180ad4e83637a96d..1c0382cae3e2dd5295000a39aed880644febd926 100644 (file)
@@ -52,19 +52,19 @@ bool _FCR_entered = false;
                if (_FCR_entered) LOG_FATAL("FOREACH_CLIENT_RANDOM must not be nested"); \
                _FCR_entered = true; \
                int _cnt = 0; \
-               FOREACH_CLIENT(cond, LAMBDA( \
-                       int _j = floor(random() * (_cnt + 1)); \
-                       if (_j == _cnt) \
-                       { \
-                               _FCR_clients[_cnt] = it; \
-                       } \
-                       else \
-                       { \
-                               _FCR_clients[_cnt] = _FCR_clients[_j]; \
-                               _FCR_clients[_j] = it; \
-                       } \
-                       _cnt++; \
-               )); \
+               FOREACH_CLIENT(cond, { \
+            int _j = floor(random() * (_cnt + 1)); \
+            if (_j == _cnt) \
+            { \
+                _FCR_clients[_cnt] = it; \
+            } \
+            else \
+            { \
+                _FCR_clients[_cnt] = _FCR_clients[_j]; \
+                _FCR_clients[_j] = it; \
+            } \
+            _cnt++; \
+        }); \
                for (int _i = 0; _i < _cnt; ++_i) \
                { \
                        const noref int i = _i; \
index a1d7b10a4c156c22d09e1cac733a1ce460f92b32..8cef8618f411facb0665d929925504ed5f3cb1e5 100644 (file)
@@ -175,13 +175,13 @@ void bot_setnameandstuff(entity this)
                                continue;
                        s = argv(0);
                        prio = 1;
-                       FOREACH_CLIENT(IS_BOT_CLIENT(it), LAMBDA(
+                       FOREACH_CLIENT(IS_BOT_CLIENT(it), {
                                if(s == it.cleanname)
                                {
                                        prio = 0;
                                        break;
                                }
-                       ));
+                       });
                        RandomSelection_AddString(readfile, 1, prio);
                }
                readfile = RandomSelection_chosen_string;
@@ -248,10 +248,10 @@ void bot_setnameandstuff(entity this)
 
        // number bots with identical names
        int j = 0;
-       FOREACH_CLIENT(IS_BOT_CLIENT(it), LAMBDA(
+       FOREACH_CLIENT(IS_BOT_CLIENT(it), {
                if(it.cleanname == name)
                        ++j;
-       ));
+       });
        if (j)
                this.netname = this.netname_freeme = strzone(strcat(prefix, name, "(", ftos(j), ")", suffix));
        else
@@ -526,12 +526,12 @@ void autoskill(float factor)
 
        bestbot = -1;
        bestplayer = -1;
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                if(IS_REAL_CLIENT(it))
                        bestplayer = max(bestplayer, it.totalfrags - it.totalfrags_lastcheck);
                else
                        bestbot = max(bestbot, it.totalfrags - it.totalfrags_lastcheck);
-       ));
+       });
 
        LOG_DEBUG("autoskill: best player got ", ftos(bestplayer), ", ");
        LOG_DEBUG("best bot got ", ftos(bestbot), "; ");
@@ -565,7 +565,7 @@ void autoskill(float factor)
                // don't reset counters, wait for them to accumulate
        }
 
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(it.totalfrags_lastcheck = it.totalfrags));
+       FOREACH_CLIENT(IS_PLAYER(it), { it.totalfrags_lastcheck = it.totalfrags; });
 }
 
 void bot_calculate_stepheightvec()
@@ -584,11 +584,11 @@ float bot_fixcount()
                activerealplayers = M_ARGV(0, int);
                realplayers = M_ARGV(1, int);
        } else {
-               FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
+               FOREACH_CLIENT(IS_REAL_CLIENT(it), {
                        if(IS_PLAYER(it))
                                ++activerealplayers;
                        ++realplayers;
-               ));
+               });
        }
 
        int bots;
index 24d960284f1e1a6da3cb52e71c01903472c6e8bd..5d31c7ee9bb0bb2115c6f874c90aa2a4a410d3bc 100644 (file)
@@ -187,13 +187,13 @@ void havocbot_ai(entity this)
                        if(skill >= 5) // bots can only look for unloaded weapons past this skill
                        if(this.(weaponentity).clip_load >= 0) // only if we're not reloading a weapon already
                        {
-                               FOREACH(Weapons, it != WEP_Null, LAMBDA(
+                               FOREACH(Weapons, it != WEP_Null, {
                                        if((this.weapons & (it.m_wepset)) && (it.spawnflags & WEP_FLAG_RELOADABLE) && (this.(weaponentity).weapon_load[it.m_id] < it.reloading_ammo))
                                        {
                                                this.(weaponentity).m_switchweapon = it;
                                                break;
                                        }
-                               ));
+                               });
                        }
                }
        }
@@ -1078,10 +1078,10 @@ float havocbot_chooseweapon_checkreload(entity this, .entity weaponentity, int n
        // if this weapon is scheduled for reloading, don't switch to it during combat
        if (this.(weaponentity).weapon_load[new_weapon] < 0)
        {
-               FOREACH(Weapons, it != WEP_Null, LAMBDA(
+               FOREACH(Weapons, it != WEP_Null, {
                        if(it.wr_checkammo1(it, this, weaponentity) + it.wr_checkammo2(it, this, weaponentity))
                                return true; // other weapon available
-               ));
+               });
        }
 
        return false;
@@ -1103,13 +1103,13 @@ void havocbot_chooseweapon(entity this, .entity weaponentity)
        {
                // If no weapon was chosen get the first available weapon
                if(this.(weaponentity).m_weapon==WEP_Null)
-               FOREACH(Weapons, it != WEP_Null, LAMBDA(
+               FOREACH(Weapons, it != WEP_Null, {
                        if(client_hasweapon(this, it, weaponentity, true, false))
                        {
                                this.(weaponentity).m_switchweapon = it;
                                return;
                        }
-               ));
+               });
                return;
        }
 
index 675dd036b7e7151dfdf100c98de66b8a242ea0f3..22f444fd1987db19155a730614ddfac21673abc3 100644 (file)
@@ -168,7 +168,7 @@ void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org
        ratingscale = ratingscale * 0.00005; // enemies are rated around 20000 already
 
        float t;
-       FOREACH_CLIENT(IS_PLAYER(it) && bot_shouldattack(this, it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && bot_shouldattack(this, it), {
                // TODO: Merge this logic with the bot_shouldattack function
                if(vdist(it.origin - org, <, 100) || vdist(it.origin - org, >, sradius))
                        continue;
@@ -191,7 +191,7 @@ void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org
                ratingscale *= t;
                if (ratingscale > 0)
                        navigation_routerating(this, it, ratingscale * BOT_RATING_ENEMY, 2000);
-       ));
+       });
 }
 
 // legacy bot role for standard gamemodes
index 9dca0af07637ce9f44d1fbd194115a0a88581cf3..ca74965be41d5f3b6ab57889d890e0f1f8bbdc45 100644 (file)
@@ -539,16 +539,16 @@ float bot_cmd_barrier(entity this)
 
        if(this.bot_barrier == 1) // find other bots
        {
-               FOREACH_CLIENT(it.isbot, LAMBDA(
+               FOREACH_CLIENT(it.isbot, {
                        if(it.bot_cmdqueuebuf_allocated)
                        if(it.bot_barrier != 1)
                                return CMD_STATUS_EXECUTING; // not all are at the barrier yet
-               ));
+               });
 
                // all bots hit the barrier!
 
                // acknowledge barrier
-               FOREACH_CLIENT(it.isbot, LAMBDA(it.bot_barrier = 2));
+               FOREACH_CLIENT(it.isbot, { it.bot_barrier = 2; });
 
                bot_barriertime = time;
        }
@@ -1156,7 +1156,7 @@ void bot_setcurrentcommand(entity this)
 
 void bot_resetqueues()
 {
-       FOREACH_CLIENT(it.isbot, LAMBDA(
+       FOREACH_CLIENT(it.isbot, {
                it.bot_cmd_execution_index = 0;
                bot_clearqueue(it);
                // also, cancel all barriers
@@ -1167,7 +1167,7 @@ void bot_resetqueues()
                        it.(bot_placenames[i]) = string_null;
                }
                it.bot_places_count = 0;
-       ));
+       });
 
        bot_barriertime = time;
 }
index e4c227c8fa2f2491e1ce00e706e8a0215c5b31e8..65cc69f664b17ba500671de65fb8833724357dc2 100644 (file)
@@ -1131,12 +1131,12 @@ LABEL(next)
 
 void botframe_autowaypoints()
 {
-       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && !IS_DEAD(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && !IS_DEAD(it), {
                // going back is broken, so only fix waypoints to walk TO the player
                //botframe_autowaypoints_fix(p, false, botframe_autowaypoints_lastwp0);
                botframe_autowaypoints_fix(it, true, botframe_autowaypoints_lastwp1);
                //te_explosion(p.botframe_autowaypoints_lastwp0.origin);
-       ));
+       });
 
        if (autocvar_g_waypointeditor_auto >= 2) {
                botframe_deleteuselesswaypoints();
index 5097bd8a145bf3254beb73c947e9d8ccba9f0f81..b39f82a1003a66c59da68b4ce31bfe32efe52170 100644 (file)
@@ -192,12 +192,12 @@ void CampaignPreIntermission()
        int lost = 0;
        string savevar;
 
-       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {
                if(it.winning)
                        won += 1;
                else
                        lost += 1;
-       ));
+       });
 
        if(autocvar__campaign_testrun)
        {
index 6d78e160cf1624b9a43cd5339f710e69b3c00f2d..78c591264d3c94229fc81ad70dc4be5b44724e12 100644 (file)
@@ -264,7 +264,7 @@ float CheatImpulse(entity this, int imp)
                case CHIMPULSE_R00T.impulse:
                        IS_CHEAT(this, imp, 0, 0);
                        RandomSelection_Init();
-                       FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it) && DIFF_TEAM(it, this), LAMBDA(RandomSelection_AddEnt(it, 1, 1)));
+                       FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it) && DIFF_TEAM(it, this), { RandomSelection_AddEnt(it, 1, 1); });
                        if(RandomSelection_chosen_ent)
                                e = RandomSelection_chosen_ent;
                        else
index 804868fa0031ac041b3e24cf65ae737fb0bed114..14b854bc6eb5f35cc279db18b12bf70634b45d94 100644 (file)
@@ -151,7 +151,7 @@ void ClientData_Touch(entity e)
        CS(e).clientdata.SendFlags = 1;
 
        // make it spectatable
-       FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != e && IS_SPEC(it) && it.enemy == e, LAMBDA(CS(it).clientdata.SendFlags = 1));
+       FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != e && IS_SPEC(it) && it.enemy == e, { CS(it).clientdata.SendFlags = 1; });
 }
 
 void SetSpectatee(entity this, entity spectatee);
@@ -659,7 +659,7 @@ void PutPlayerInServer(entity this)
        target_voicescript_clear(this);
 
        // reset fields the weapons may use
-       FOREACH(Weapons, true, LAMBDA(
+       FOREACH(Weapons, true, {
                it.wr_resetplayer(it, this);
                        // reload all reloadable weapons
                if (it.spawnflags & WEP_FLAG_RELOADABLE) {
@@ -669,7 +669,7 @@ void PutPlayerInServer(entity this)
                                this.(weaponentity).weapon_load[it.m_id] = it.reloading_ammo;
                        }
                }
-       ));
+       });
 
        {
                string s = spot.target;
@@ -2009,13 +2009,13 @@ int nJoinAllowed(entity this, entity ignore)
        // TODO simplify this
        int totalClients = 0;
        int currentlyPlaying = 0;
-       FOREACH_CLIENT(true, LAMBDA(
+       FOREACH_CLIENT(true, {
                if(it != ignore)
                        ++totalClients;
                if(IS_REAL_CLIENT(it))
                if(IS_PLAYER(it) || it.caplayer)
                        ++currentlyPlaying;
-       ));
+       });
 
        float free_slots = 0;
        if (!autocvar_g_maxplayers)
index 84366ea6b27b72b9f65e6fc5c6bab97090465e48..77c3930258420f5f542156e780a1c9aab183c41e 100644 (file)
@@ -115,13 +115,13 @@ entity GetIndexedEntity(float argc, float start_index)
                }
                else  // no, maybe it's a name?
                {
-                       FOREACH_CLIENT(true, LAMBDA(
+                       FOREACH_CLIENT(true, {
                                if(strdecolorize(it.netname) == strdecolorize(argv(start_index)))
                                {
                                        selection = it;
                                        break; // no reason to keep looking
                                }
-                       ));
+                       });
 
                        index = (start_index + 1);
                }
@@ -148,13 +148,13 @@ entity GetFilteredEntity(string input)
        else
        {
                selection = NULL;
-               FOREACH_CLIENT(true, LAMBDA(
+               FOREACH_CLIENT(true, {
                        if(strdecolorize(it.netname) == strdecolorize(input))
                        {
                                selection = it;
                                break; // no reason to keep looking
                        }
-               ));
+               });
        }
 
        return selection;
@@ -217,9 +217,9 @@ void timeout_handler_think(entity this)
                                cvar_set("slowmo", ftos(orig_slowmo));
 
                                // unlock the view for players so they can move around again
-                               FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(
+                               FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {
                                        it.fixangle = false;
-                               ));
+                               });
 
                                timeout_handler_reset(this);
                        }
@@ -244,16 +244,16 @@ void timeout_handler_think(entity this)
                                cvar_set("slowmo", ftos(TIMEOUT_SLOWMO_VALUE));
 
                                // reset all the flood variables
-                               FOREACH_CLIENT(true, LAMBDA(
+                               FOREACH_CLIENT(true, {
                                        it.nickspamcount = it.nickspamtime = it.floodcontrol_chat =
                                                it.floodcontrol_chatteam = it.floodcontrol_chattell =
                                                        it.floodcontrol_voice = it.floodcontrol_voiceteam = 0;
-                               ));
+                               });
 
                                // copy .v_angle to .lastV_angle for every player in order to fix their view during pause (see PlayerPreThink)
-                               FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(
+                               FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {
                                        it.lastV_angle = it.v_angle;
-                               ));
+                               });
 
                                this.nextthink = time;  // think again next frame to handle it under TIMEOUT_ACTIVE code
                        }
@@ -784,7 +784,7 @@ void CommonCommand_who(float request, entity caller, float argc)
                                "ent", "nickname", "ping", "pl", "time", "ip", "crypto_id"));
 
                        total_listed_players = 0;
-                       FOREACH_CLIENT(true, LAMBDA(
+                       FOREACH_CLIENT(true, {
                                is_bot = (IS_BOT_CLIENT(it));
 
                                if (is_bot)
@@ -813,7 +813,7 @@ void CommonCommand_who(float request, entity caller, float argc)
                                        tmp_crypto_idfp));
 
                                ++total_listed_players;
-                       ));
+                       });
 
                        print_to(caller, strcat("Finished listing ", ftos(total_listed_players), " client(s) out of ", ftos(maxclients), " slots."));
 
index 27dd13a2d6f9c376aa950794616a3bdf55a1dbf0..13cbfe49e127ece70856a11fcd58f670c5750fa6 100644 (file)
@@ -15,7 +15,7 @@ REGISTRY_SORT(COMMON_COMMANDS)
        METHOD(commoncommand_##id, m_invokecmd, void(commoncommand_##id this, int request, entity caller, int arguments, string command))
 
 STATIC_INIT(COMMON_COMMANDS_aliases) {
-       FOREACH(COMMON_COMMANDS, true, LAMBDA(localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_svcmd"))));
+       FOREACH(COMMON_COMMANDS, true, { localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_svcmd")); });
 }
 
 #include "vote.qh"
@@ -157,30 +157,30 @@ COMMON_COMMAND(who, "Display detailed client information about all players") { C
 
 void CommonCommand_macro_help(entity caller)
 {
-       FOREACH(COMMON_COMMANDS, true, LAMBDA(print_to(caller, sprintf("  ^2%s^7: %s", it.m_name, it.m_description))));
+       FOREACH(COMMON_COMMANDS, true, { print_to(caller, sprintf("  ^2%s^7: %s", it.m_name, it.m_description)); });
 }
 
 float CommonCommand_macro_command(float argc, entity caller, string command)
 {
        string c = strtolower(argv(0));
-       FOREACH(COMMON_COMMANDS, it.m_name == c, LAMBDA(
+       FOREACH(COMMON_COMMANDS, it.m_name == c, {
                it.m_invokecmd(it, CMD_REQUEST_COMMAND, caller, argc, command);
                return true;
-       ));
+       });
        return false;
 }
 
 float CommonCommand_macro_usage(float argc, entity caller)
 {
        string c = strtolower(argv(1));
-       FOREACH(COMMON_COMMANDS, it.m_name == c, LAMBDA(
+       FOREACH(COMMON_COMMANDS, it.m_name == c, {
                it.m_invokecmd(it, CMD_REQUEST_USAGE, caller, argc, "");
                return true;
-       ));
+       });
        return false;
 }
 
 void CommonCommand_macro_write_aliases(float fh)
 {
-       FOREACH(COMMON_COMMANDS, true, LAMBDA(CMD_Write_Alias("qc_cmd_svcmd", it.m_name, it.m_description)));
+       FOREACH(COMMON_COMMANDS, true, { CMD_Write_Alias("qc_cmd_svcmd", it.m_name, it.m_description); });
 }
index b135c0460113451fe485528457fb8ba512c22e54..8115d712ebe9f46b39f131a9c1dce48f74250377 100644 (file)
@@ -14,5 +14,5 @@ REGISTRY_SORT(SERVER_COMMANDS)
        METHOD(servercommand_##id, m_invokecmd, void(servercommand_##id this, int request, entity caller, int arguments, string command))
 
 STATIC_INIT(SERVER_COMMANDS_aliases) {
-       FOREACH(SERVER_COMMANDS, true, LAMBDA(localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_sv"))));
+       FOREACH(SERVER_COMMANDS, true, { localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_sv")); });
 }
index 4d181c4659d7dca887f99ca1c1c6f888911b7781..0bc47c0acf67fcdb2d81234429b5ef1a585a7836 100644 (file)
@@ -193,11 +193,11 @@ void GameCommand_allspec(float request, float argc)
                {
                        string reason = argv(1);
                        int n = 0;
-                       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(
+                       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {
                                if (it.caplayer) it.caplayer = 0;
                                PutObserverInServer(it);
                                ++n;
-                       ));
+                       });
                        if (n)   bprint(strcat("Successfully forced all (", ftos(n), ") players to spectate", (reason ? strcat(" for reason: '", reason, "'") : ""), ".\n"));
                        else   LOG_INFO("No players found to spectate.\n");
                        return;
@@ -563,11 +563,11 @@ void GameCommand_defer_clear_all(float request)
                        int n = 0;
                        float argc;
 
-                       FOREACH_CLIENT(true, LAMBDA(
+                       FOREACH_CLIENT(true, {
                                argc = tokenize_console(strcat("defer_clear ", ftos(etof(it))));
                                GameCommand_defer_clear(CMD_REQUEST_COMMAND, argc);
                                ++n;
-                       ));
+                       });
                        if (n)   LOG_INFO(strcat("Successfully stuffed defer clear to all clients (", ftos(n), ")\n"));  // should a message be added if no players were found?
                        return;
                }
@@ -1141,13 +1141,13 @@ void GameCommand_nospectators(float request)
                {
                        blockSpectators = 1;
                        // give every spectator <g_maxplayers_spectator_blocktime> seconds time to become a player
-                       FOREACH_CLIENT(IS_REAL_CLIENT(it) && (IS_SPEC(it) || IS_OBSERVER(it)) && !it.caplayer, LAMBDA(
+                       FOREACH_CLIENT(IS_REAL_CLIENT(it) && (IS_SPEC(it) || IS_OBSERVER(it)) && !it.caplayer, {
                                if(!it.caplayer)
                                {
                                        CS(it).spectatortime = time;
                                        Send_Notification(NOTIF_ONE_ONLY, it, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);
                                }
-                       ));
+                       });
                        bprint(strcat("^7All spectators will be automatically kicked when not joining the game after ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds!\n"));
                        return;
                }
@@ -1345,7 +1345,7 @@ void GameCommand_shuffleteams(float request)
                                return;
                        }
 
-                       FOREACH_CLIENT(IS_PLAYER(it) || it.caplayer, LAMBDA(
+                       FOREACH_CLIENT(IS_PLAYER(it) || it.caplayer, {
                                if (it.team_forced) {
                                        // we could theoretically assign forced players to their teams
                                        // and shuffle the rest to fill the empty spots but in practise
@@ -1353,7 +1353,7 @@ void GameCommand_shuffleteams(float request)
                                        LOG_INFO("Can't shuffle teams because at least one player has a forced team.\n");
                                        return;
                                }
-                       ));
+                       });
 
                        int number_of_teams = 0;
                        CheckAllowedTeams(NULL);
@@ -1363,11 +1363,11 @@ void GameCommand_shuffleteams(float request)
                        if (c4 >= 0) number_of_teams = max(4, number_of_teams);
 
                        int team_index = 0;
-                       FOREACH_CLIENT_RANDOM(IS_PLAYER(it) || it.caplayer, LAMBDA(
+                       FOREACH_CLIENT_RANDOM(IS_PLAYER(it) || it.caplayer, {
                                int target_team_number = Team_NumberToTeam(team_index + 1);
                                if (it.team != target_team_number) MoveToTeam(it, target_team_number, 6);
                                team_index = (team_index + 1) % number_of_teams;
-                       ));
+                       });
 
                        bprint("Successfully shuffled the players around randomly.\n");
                        return;
@@ -1731,32 +1731,32 @@ SERVER_COMMAND(warp, "Choose different level in campaign") { GameCommand_warp(re
 
 void GameCommand_macro_help()
 {
-       FOREACH(SERVER_COMMANDS, true, LAMBDA(LOG_INFOF("  ^2%s^7: %s\n", it.m_name, it.m_description)));
+       FOREACH(SERVER_COMMANDS, true, { LOG_INFOF("  ^2%s^7: %s\n", it.m_name, it.m_description); });
 }
 
 float GameCommand_macro_command(float argc, string command)
 {
        string c = strtolower(argv(0));
-       FOREACH(SERVER_COMMANDS, it.m_name == c, LAMBDA(
+       FOREACH(SERVER_COMMANDS, it.m_name == c, {
                it.m_invokecmd(it, CMD_REQUEST_COMMAND, NULL, argc, command);
                return true;
-       ));
+       });
        return false;
 }
 
 float GameCommand_macro_usage(float argc)
 {
        string c = strtolower(argv(1));
-       FOREACH(SERVER_COMMANDS, it.m_name == c, LAMBDA(
+       FOREACH(SERVER_COMMANDS, it.m_name == c, {
                it.m_invokecmd(it, CMD_REQUEST_USAGE, NULL, argc, "");
                return true;
-       ));
+       });
        return false;
 }
 
 void GameCommand_macro_write_aliases(float fh)
 {
-       FOREACH(SERVER_COMMANDS, true, LAMBDA(CMD_Write_Alias("qc_cmd_sv", it.m_name, it.m_description)));
+       FOREACH(SERVER_COMMANDS, true, { CMD_Write_Alias("qc_cmd_sv", it.m_name, it.m_description); });
 }
 
 
index 5f96334ddfd3141ff0208fbd6bb343f5f2e6724d..2db503ca285cf7b0426cd160152d17bc913908c5 100644 (file)
@@ -119,7 +119,7 @@ string OriginalCallerName()
 
 void VoteReset()
 {
-       FOREACH_CLIENT(true, LAMBDA(it.vote_selection = 0));
+       FOREACH_CLIENT(true, { it.vote_selection = 0; });
 
        if (vote_called)
        {
@@ -214,7 +214,7 @@ void VoteCount(float first_count)
        Nagger_VoteCountChanged();
 
        // add up all the votes from each connected client
-       FOREACH_CLIENT(IS_REAL_CLIENT(it) && IS_CLIENT(it), LAMBDA(
+       FOREACH_CLIENT(IS_REAL_CLIENT(it) && IS_CLIENT(it), {
                ++vote_player_count;
                if (IS_PLAYER(it))   ++vote_real_player_count;
                switch (it.vote_selection)
@@ -233,7 +233,7 @@ void VoteCount(float first_count)
                        }
                        default: break;
                }
-       ));
+       });
 
        // Check to see if there are enough players on the server to allow master voting... otherwise, vote master could be used for evil.
        if ((vote_called == VOTE_MASTER) && autocvar_sv_vote_master_playerlimit > vote_player_count)
@@ -362,7 +362,7 @@ void reset_map(bool dorespawn)
                if (it.reset2) it.reset2(it);
        });
 
-       FOREACH_CLIENT(IS_PLAYER(it) && STAT(FROZEN, it), LAMBDA(Unfreeze(it)));
+       FOREACH_CLIENT(IS_PLAYER(it) && STAT(FROZEN, it), { Unfreeze(it); });
 
        // Moving the player reset code here since the player-reset depends
        // on spawnpoint entities which have to be reset first --blub
@@ -422,11 +422,11 @@ void ReadyRestart_force()
        game_starttime = time + RESTART_COUNTDOWN;
 
        // clear player attributes
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                it.alivetime = 0;
                CS(it).killcount = 0;
                PS_GR_P_ADDVAL(it, PLAYERSTATS_ALIVETIME, -PS_GR_P_ADDVAL(it, PLAYERSTATS_ALIVETIME, 0));
-       ));
+       });
 
        restart_mapalreadyrestarted = false; // reset this var, needed when cvar sv_ready_restart_repeatable is in use
 
@@ -434,7 +434,7 @@ void ReadyRestart_force()
        warmup_stage = 0;                // once the game is restarted the game is in match stage
 
        // reset the .ready status of all players (also spectators)
-       FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(it.ready = false));
+       FOREACH_CLIENT(IS_REAL_CLIENT(it), { it.ready = false; });
        readycount = 0;
        Nagger_ReadyCounted();  // NOTE: this causes a resend of that entity, and will also turn off warmup state on the client
 
@@ -456,7 +456,7 @@ void ReadyRestart_force()
        // after a restart every players number of allowed timeouts gets reset, too
        if (autocvar_sv_timeout)
        {
-               FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(CS(it).allowed_timeouts = autocvar_sv_timeout_number));
+               FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), { CS(it).allowed_timeouts = autocvar_sv_timeout_number; });
        }
     // reset map immediately if this cvar is not set
     if (!autocvar_sv_ready_restart_after_countdown) reset_map(true);
@@ -480,10 +480,10 @@ void ReadyCount()
        float ready_needed_factor, ready_needed_count;
        float t_ready = 0, t_players = 0;
 
-       FOREACH_CLIENT(IS_REAL_CLIENT(it) && (IS_PLAYER(it) || it.caplayer == 1), LAMBDA(
+       FOREACH_CLIENT(IS_REAL_CLIENT(it) && (IS_PLAYER(it) || it.caplayer == 1), {
                ++t_players;
                if (it.ready) ++t_ready;
-       ));
+       });
 
        readycount = t_ready;
 
@@ -808,7 +808,7 @@ void VoteCommand_call(float request, entity caller, float argc, string vote_comm
                                        msg_entity = caller;
                                }
 
-                               FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(++tmp_playercount));
+                               FOREACH_CLIENT(IS_REAL_CLIENT(it), { ++tmp_playercount; });
                                if (tmp_playercount > 1)   Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_VOTE_CALL);  // don't announce a "vote now" sound if player is alone
 
                                bprint("\{1}^2* ^3", OriginalCallerName(), "^2 calls a vote for ", vote_called_display, "\n");
index 83911eeafec9aa0b5d16120444a74b465acefbb8..61d04801bfbf6a956ef0f5844c8572f316122317 100644 (file)
@@ -1266,7 +1266,7 @@ void Fire_ApplyDamage(entity e)
 
        if(!IS_INDEPENDENT_PLAYER(e))
        if(!STAT(FROZEN, e))
-               FOREACH_CLIENT(IS_PLAYER(it) && it != e, LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it) && it != e, {
                        if(!IS_DEAD(it))
                        if(!IS_INDEPENDENT_PLAYER(it))
                        if(boxesoverlap(e.absmin, e.absmax, it.absmin, it.absmax))
@@ -1275,7 +1275,7 @@ void Fire_ApplyDamage(entity e)
                                d = autocvar_g_balance_firetransfer_damage * e.fire_damagepersec * t;
                                Fire_AddDamage(it, o, d, t, DEATH_FIRE.m_id);
                        }
-               ));
+               });
 }
 
 void Fire_ApplyEffect(entity e)
index 4ad405adb1908665ab078cf25682297783c0c1bb..f00db073e47e1b805fd1bf5ac90a85cffb2e5a3a 100644 (file)
@@ -1459,7 +1459,7 @@ void DumpStats(float final)
        if(to_file)
                fputs(file, strcat(s, "\n"));
 
-       FOREACH_CLIENT(IS_REAL_CLIENT(it) || (IS_BOT_CLIENT(it) && autocvar_sv_logscores_bots), LAMBDA(
+       FOREACH_CLIENT(IS_REAL_CLIENT(it) || (IS_BOT_CLIENT(it) && autocvar_sv_logscores_bots), {
                s = strcat(":player:see-labels:", GetPlayerScoreString(it, 0), ":");
                s = strcat(s, ftos(rint(time - CS(it).jointime)), ":");
                if(IS_PLAYER(it) || MUTATOR_CALLHOOK(GetPlayerStatus, it))
@@ -1473,7 +1473,7 @@ void DumpStats(float final)
                        GameLogEcho(strcat(s, ftos(it.playerid), ":", playername(it, false)));
                if(to_file)
                        fputs(file, strcat(s, playername(it, false), "\n"));
-       ));
+       });
 
        if(teamplay)
        {
@@ -1530,9 +1530,9 @@ void FixIntermissionClient(entity e)
                {
                        stuffcmd(e, "\nscr_printspeed 1000000\n");
                        RandomSelection_Init();
-                       FOREACH_WORD(autocvar_sv_intermission_cdtrack, true, LAMBDA(
+                       FOREACH_WORD(autocvar_sv_intermission_cdtrack, true, {
                                RandomSelection_AddString(it, 1, 1);
-                       ));
+                       });
                        if (RandomSelection_chosen_string != "")
                        {
                                stuffcmd(e, sprintf("\ncd loop %s\n", RandomSelection_chosen_string));
@@ -1582,11 +1582,11 @@ void NextLevel()
 
        GameLogClose();
 
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                FixIntermissionClient(it);
                if(it.winning)
                        bprint(playername(it, false), " ^7wins.\n");
-       ));
+       });
 
        target_music_kill();
 
@@ -1660,22 +1660,22 @@ float GetWinningCode(float fraglimitreached, float equality)
 // set the .winning flag for exactly those players with a given field value
 void SetWinners(.float field, float value)
 {
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(it.winning = (it.(field) == value)));
+       FOREACH_CLIENT(IS_PLAYER(it), { it.winning = (it.(field) == value); });
 }
 
 // set the .winning flag for those players with a given field value
 void AddWinners(.float field, float value)
 {
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                if(it.(field) == value)
                        it.winning = 1;
-       ));
+       });
 }
 
 // clear the .winning flags
 void ClearWinners()
 {
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(it.winning = 0));
+       FOREACH_CLIENT(IS_PLAYER(it), { it.winning = 0; });
 }
 
 void ShuffleMaplist()
@@ -1768,7 +1768,7 @@ float WinningCondition_RanOutOfSpawns()
 
        team1_score = team2_score = team3_score = team4_score = 0;
 
-       FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), {
                switch(it.team)
                {
                        case NUM_TEAM_1: team1_score = 1; break;
@@ -1776,7 +1776,7 @@ float WinningCondition_RanOutOfSpawns()
                        case NUM_TEAM_3: team3_score = 1; break;
                        case NUM_TEAM_4: team4_score = 1; break;
                }
-       ));
+       });
 
        IL_EACH(g_spawnpoints, true,
        {
@@ -1902,13 +1902,13 @@ void CheckRules_World()
                                float playerswithlaps;
                                float readyplayers;
                                totalplayers = playerswithlaps = readyplayers = 0;
-                               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+                               FOREACH_CLIENT(IS_PLAYER(it), {
                                        ++totalplayers;
                                        if(PlayerScore_Add(it, SP_RACE_FASTEST, 0))
                                                ++playerswithlaps;
                                        if(it.ready)
                                                ++readyplayers;
-                               ));
+                               });
 
                                // at least 2 of the players have completed a lap: start the RACE
                                // otherwise, the players should end the qualifying on their own
@@ -2128,7 +2128,7 @@ float RedirectionThink()
        redirection_nextthink = time + 1;
 
        clients_found = 0;
-       FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
+       FOREACH_CLIENT(IS_REAL_CLIENT(it), {
                // TODO add timer
                LOG_INFO("Redirecting: sending connect command to ", it.netname, "\n");
                if(redirection_target == "self")
@@ -2136,7 +2136,7 @@ float RedirectionThink()
                else
                        stuffcmd(it, strcat("\ndisconnect; defer ", ftos(autocvar_quit_and_redirect_timer), " \"connect ", redirection_target, "\"\n"));
                ++clients_found;
-       ));
+       });
 
        LOG_INFO("Redirecting: ", ftos(clients_found), " clients left.\n");
 
index d22073ef6c5d02e25e50263a0ac643c085372aee..53cf1cdbacbc97699fa79556bba95aee49ef7497 100644 (file)
@@ -100,7 +100,7 @@ string GameTypeVote_MapInfo_FixName(string m)
 
 void MapVote_ClearAllVotes()
 {
-       FOREACH_CLIENT(true, LAMBDA(it.mapvote = 0));
+       FOREACH_CLIENT(true, { it.mapvote = 0; });
 }
 
 void MapVote_UnzoneStrings()
@@ -454,7 +454,7 @@ bool MapVote_Finished(int mappos)
                        GameLogEcho(strcat(":vote:suggestion_accepted:", mapvote_maps[mappos]));
        }
 
-       FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(FixClientCvars(it)));
+       FOREACH_CLIENT(IS_REAL_CLIENT(it), { FixClientCvars(it); });
 
        if(gametypevote)
        {
@@ -595,7 +595,7 @@ void MapVote_Tick()
                return;
 
        int totalvotes = 0;
-       FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
+       FOREACH_CLIENT(IS_REAL_CLIENT(it), {
                // hide scoreboard again
                if(it.health != 2342)
                {
@@ -621,7 +621,7 @@ void MapVote_Tick()
 
                if(it.mapvote)
                        ++totalvotes;
-       ));
+       });
 
        MapVote_CheckRules_1(); // just count
 }
index 3a5eb76f69bae6868a64622ae0674f820419ae37..652ef656b0fdbc45a7d19913cd7be886a58be126 100644 (file)
@@ -547,10 +547,10 @@ void readplayerstartcvars()
        {
                g_weaponarena = 1;
                g_weaponarena_list = "All Weapons";
-               FOREACH(Weapons, it != WEP_Null, LAMBDA(
+               FOREACH(Weapons, it != WEP_Null, {
                        if(!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED))
                                g_weaponarena_weapons |= (it.m_wepset);
-               ));
+               });
        }
        else if (s == "devall")
        {
@@ -565,11 +565,11 @@ void readplayerstartcvars()
        {
                g_weaponarena = 1;
                g_weaponarena_list = "Most Weapons";
-               FOREACH(Weapons, it != WEP_Null, LAMBDA(
+               FOREACH(Weapons, it != WEP_Null, {
                        if(!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED))
                                if(it.spawnflags & WEP_FLAG_NORMAL)
                                        g_weaponarena_weapons |= (it.m_wepset);
-               ));
+               });
        }
        else if (s == "none")
        {
@@ -584,14 +584,14 @@ void readplayerstartcvars()
                for (i = 0; i < t; ++i)
                {
                        s = argv(i);
-                       FOREACH(Weapons, it != WEP_Null, LAMBDA(
+                       FOREACH(Weapons, it != WEP_Null, {
                                if(it.netname == s)
                                {
                                        g_weaponarena_weapons |= (it.m_wepset);
                                        g_weaponarena_list = strcat(g_weaponarena_list, it.m_name, " & ");
                                        break;
                                }
-                       ));
+                       });
                }
                g_weaponarena_list = strzone(substring(g_weaponarena_list, 0, strlen(g_weaponarena_list) - 3));
        }
@@ -610,7 +610,7 @@ void readplayerstartcvars()
        }
        else
        {
-               FOREACH(Weapons, it != WEP_Null, LAMBDA(
+               FOREACH(Weapons, it != WEP_Null, {
                        int w = want_weapon(it, false);
                        WepSet s = it.m_wepset;
                        if(w & 1)
@@ -619,7 +619,7 @@ void readplayerstartcvars()
                                start_weapons_default |= s;
                        if(w & 4)
                                start_weapons_defaultmask |= s;
-               ));
+               });
        }
 
        if(!cvar("g_use_ammunition"))
@@ -671,7 +671,7 @@ void readplayerstartcvars()
                        warmup_start_weapons = '0 0 0';
                        warmup_start_weapons_default = '0 0 0';
                        warmup_start_weapons_defaultmask = '0 0 0';
-                       FOREACH(Weapons, it != WEP_Null, LAMBDA(
+                       FOREACH(Weapons, it != WEP_Null, {
                                int w = want_weapon(it, g_warmup_allguns);
                                WepSet s = (it.m_wepset);
                                if(w & 1)
@@ -680,7 +680,7 @@ void readplayerstartcvars()
                                        warmup_start_weapons_default |= s;
                                if(w & 4)
                                        warmup_start_weapons_defaultmask |= s;
-                       ));
+                       });
                }
        }
 
@@ -699,10 +699,10 @@ void readplayerstartcvars()
        WepSet precache_weapons = start_weapons;
        if (g_warmup_allguns != 1)
                precache_weapons |= warmup_start_weapons;
-       FOREACH(Weapons, it != WEP_Null, LAMBDA(
+       FOREACH(Weapons, it != WEP_Null, {
                if(precache_weapons & (it.m_wepset))
                        it.wr_init(it);
-       ));
+       });
 
        start_ammo_shells = max(0, start_ammo_shells);
        start_ammo_nails = max(0, start_ammo_nails);
@@ -763,7 +763,7 @@ void precache_all_playermodels(string pattern)
 
 void precache_playermodels(string s)
 {
-       FOREACH_WORD(s, true, LAMBDA(precache_playermodel(it)));
+       FOREACH_WORD(s, true, { precache_playermodel(it); });
 }
 
 void precache()
index c5f846b162590f19ba39031bc4a27363cf753ad9..789ba938140755b202f3e568c63e42ba904847d8 100644 (file)
@@ -306,7 +306,7 @@ void readlevelcvars()
        if (!warmup_stage)
                game_starttime = time + cvar("g_start_delay");
 
-       FOREACH(Weapons, it != WEP_Null, LAMBDA(it.wr_init(it)));
+       FOREACH(Weapons, it != WEP_Null, { it.wr_init(it); });
 
        readplayerstartcvars();
 }
index 1784e72ecdeecc42e1e1f2052524fb68907ecc92..43c668edd7e81289be23818b5535be7d3e05cbdb 100644 (file)
@@ -5,7 +5,7 @@ STATIC_INIT_LATE(Gametype) {
     if (g) {
         for (string _s = g.m_mutators; _s != ""; _s = cdr(_s)) {
             string s = car(_s);
-            FOREACH(Mutators, it.m_name == s, LAMBDA(Mutator_Add(it); break));
+            FOREACH(Mutators, it.m_name == s, { Mutator_Add(it); break; });
         }
     }
 }
index 350dc5d68f6b13f3ddc1fbc72d6ffe7ae3ea297d..85801af52a8fc900db8fcff339c2b6b153c5226d 100644 (file)
@@ -65,7 +65,7 @@ void assault_objective_decrease_use(entity this, entity actor, entity trigger)
                        this.enemy.health = -1;
 
                        if(this.enemy.message)
-                               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(centerprint(it, this.enemy.message)));
+                               FOREACH_CLIENT(IS_PLAYER(it), { centerprint(it, this.enemy.message); });
 
                        SUB_UseTargets(this.enemy, this, trigger);
                }
index e46b22de22c8f2c8536bfcf423d9b75a9c625794..ca402f7f16fd0da9cfad47e0bb3de599998a84a4 100644 (file)
@@ -6,7 +6,7 @@ bool autocvar_g_ca_spectate_enemies;
 void CA_count_alive_players()
 {
        total_players = redalive = bluealive = yellowalive = pinkalive = 0;
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                switch(it.team)
                {
                        case NUM_TEAM_1: ++total_players; if(!IS_DEAD(it)) ++redalive; break;
@@ -14,13 +14,13 @@ void CA_count_alive_players()
                        case NUM_TEAM_3: ++total_players; if(!IS_DEAD(it)) ++yellowalive; break;
                        case NUM_TEAM_4: ++total_players; if(!IS_DEAD(it)) ++pinkalive; break;
                }
-       ));
-       FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
+       });
+       FOREACH_CLIENT(IS_REAL_CLIENT(it), {
                it.redalive_stat = redalive;
                it.bluealive_stat = bluealive;
                it.yellowalive_stat = yellowalive;
                it.pinkalive_stat = pinkalive;
-       ));
+       });
 }
 
 float CA_GetWinnerTeam()
@@ -58,7 +58,7 @@ float CA_CheckWinner()
        {
                Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER);
                Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER);
-               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(nades_Clear(it)));
+               FOREACH_CLIENT(IS_PLAYER(it), { nades_Clear(it); });
 
                allowed_to_spawn = false;
                game_stopped = true;
@@ -87,7 +87,7 @@ float CA_CheckWinner()
        game_stopped = true;
        round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit);
 
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(nades_Clear(it)));
+       FOREACH_CLIENT(IS_PLAYER(it), { nades_Clear(it); });
 
        return 1;
 }
index 35689d4b60893182d492b090d132efd5a3beef3a..23bbeaae2b5ce03e5090d95198c85bcf5283c54f 100644 (file)
@@ -288,7 +288,7 @@ bool ctf_CaptureShield_CheckStatus(entity p)
                return false;
 
        players_total = players_worseeq = 0;
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                if(DIFF_TEAM(it, p))
                        continue;
                se  = PlayerScore_Add(it, SP_CTF_CAPS,    0);
@@ -301,7 +301,7 @@ bool ctf_CaptureShield_CheckStatus(entity p)
                if(ser <= sr)
                        ++players_worseeq;
                ++players_total;
-       ));
+       });
 
        // player is in the worse half, if >= half the players are better than him, or consequently, if < half of the players are worse
        // use this rule here
@@ -441,14 +441,14 @@ void ctf_Handle_Retrieve(entity flag, entity player)
        _sound(player, CH_TRIGGER, flag.snd_flag_pass, VOL_BASE, ATTEN_NORM);
        ctf_EventLog("receive", flag.team, player);
 
-       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {
                if(it == sender)
                        Send_Notification(NOTIF_ONE, it, MSG_CENTER, APP_NUM(flag.team, CENTER_CTF_PASS_SENT), player.netname);
                else if(it == player)
                        Send_Notification(NOTIF_ONE, it, MSG_CENTER, APP_NUM(flag.team, CENTER_CTF_PASS_RECEIVED), sender.netname);
                else if(SAME_TEAM(it, sender))
                        Send_Notification(NOTIF_ONE, it, MSG_CENTER, APP_NUM(flag.team, CENTER_CTF_PASS_OTHER), sender.netname, player.netname);
-       ));
+       });
 
        // create new waypoint
        ctf_FlagcarrierWaypoints(player);
@@ -720,16 +720,16 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype)
        Send_Notification(NOTIF_TEAM_EXCEPT, player, MSG_CHOICE, APP_NUM(flag.team, CHOICE_CTF_PICKUP_TEAM), Team_ColorCode(player.team), player.netname);
 
        if(!flag.team)
-               FOREACH_CLIENT(IS_PLAYER(it) && it != player && DIFF_TEAM(it, player), LAMBDA(Send_Notification(NOTIF_ONE, it, MSG_CHOICE, CHOICE_CTF_PICKUP_ENEMY_NEUTRAL, Team_ColorCode(player.team), player.netname)));
+               FOREACH_CLIENT(IS_PLAYER(it) && it != player && DIFF_TEAM(it, player), { Send_Notification(NOTIF_ONE, it, MSG_CHOICE, CHOICE_CTF_PICKUP_ENEMY_NEUTRAL, Team_ColorCode(player.team), player.netname); });
 
        if(flag.team)
-               FOREACH_CLIENT(IS_PLAYER(it) && it != player, LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it) && it != player, {
                        if(CTF_SAMETEAM(flag, it))
                        if(SAME_TEAM(player, it))
                                Send_Notification(NOTIF_ONE, it, MSG_CHOICE, APP_TEAM_NUM(flag.team, CHOICE_CTF_PICKUP_TEAM), Team_ColorCode(player.team), player.netname);
                        else
                                Send_Notification(NOTIF_ONE, it, MSG_CHOICE, ((SAME_TEAM(flag, player)) ? CHOICE_CTF_PICKUP_ENEMY_TEAM : CHOICE_CTF_PICKUP_ENEMY), Team_ColorCode(player.team), player.netname);
-               ));
+               });
 
        _sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTEN_NONE);
 
@@ -881,7 +881,7 @@ void ctf_CheckStalemate()
 
                if (!wpforenemy_announced)
                {
-                       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(Send_Notification(NOTIF_ONE, it, MSG_CENTER, ((it.flagcarried) ? CENTER_CTF_STALEMATE_CARRIER : CENTER_CTF_STALEMATE_OTHER))));
+                       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), { Send_Notification(NOTIF_ONE, it, MSG_CENTER, ((it.flagcarried) ? CENTER_CTF_STALEMATE_CARRIER : CENTER_CTF_STALEMATE_OTHER)); });
 
                        wpforenemy_announced = true;
                }
@@ -919,7 +919,7 @@ void ctf_FlagThink(entity this)
 
        // captureshield
        if(this == ctf_worldflaglist) // only for the first flag
-               FOREACH_CLIENT(true, LAMBDA(ctf_CaptureShield_Update(it, 1))); // release shield only
+               FOREACH_CLIENT(true, { ctf_CaptureShield_Update(it, 1); }); // release shield only
 
        // sanity checks
        if(this.mins != this.m_mins || this.maxs != this.m_maxs) { // reset the flag boundaries in case it got squished
@@ -1458,13 +1458,13 @@ int havocbot_ctf_teamcount(entity bot, vector org, float tc_radius)
 
        int c = 0;
 
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                if(DIFF_TEAM(it, bot) || IS_DEAD(it) || it == bot)
                        continue;
 
                if(vdist(it.origin - org, <, tc_radius))
                        ++c;
-       ));
+       });
 
        return c;
 }
@@ -1643,7 +1643,7 @@ void havocbot_ctf_reset_role(entity this)
 
        // if there is only me on the team switch to offense
        c = 0;
-       FOREACH_CLIENT(IS_PLAYER(it) && SAME_TEAM(it, this), LAMBDA(++c));
+       FOREACH_CLIENT(IS_PLAYER(it) && SAME_TEAM(it, this), { ++c; });
 
        if(c==1)
        {
@@ -1998,14 +1998,14 @@ void havocbot_role_ctf_defense(entity this)
                // if enemies are closer to our base, go there
                entity closestplayer = NULL;
                float distance, bestdistance = 10000;
-               FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), {
                        distance = vlen(org - it.origin);
                        if(distance<bestdistance)
                        {
                                closestplayer = it;
                                bestdistance = distance;
                        }
-               ));
+               });
 
                if(closestplayer)
                if(DIFF_TEAM(closestplayer, this))
@@ -2525,7 +2525,7 @@ MUTATOR_HOOKFUNCTION(ctf, SV_ParseClientCommand)
                        }
                }
 
-               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it), {
                        if(it.flagcarried && (it.team == _team || _team == 0))
                        {
                                found = true;
@@ -2533,7 +2533,7 @@ MUTATOR_HOOKFUNCTION(ctf, SV_ParseClientCommand)
                                        continue; // already spectating this fc, try another
                                return superspec_Spectate(player, it);
                        }
-               ));
+               });
 
                if(!found)
                        superspec_msg("", "", player, "No active flag carrier\n", 1);
index 8e7512eb6965d42a7e7e4b88bea02bfcd690189d..96c1462cb72fb2951698067b7695791f2c3d80ac 100644 (file)
@@ -146,7 +146,7 @@ MUTATOR_HOOKFUNCTION(cts, reset_map_global)
        race_ClearRecords();
        PlayerScore_Sort(race_place, 0, 1, 0);
 
-       FOREACH_CLIENT(true, LAMBDA(
+       FOREACH_CLIENT(true, {
                if(it.race_place)
                {
                        s = PlayerScore_Add(it, SP_RACE_FASTEST, 0);
@@ -154,7 +154,7 @@ MUTATOR_HOOKFUNCTION(cts, reset_map_global)
                                it.race_place = 0;
                }
                cts_EventLog(ftos(it.race_place), it);
-       ));
+       });
 
        if(g_race_qualifying == 2)
        {
index cffb60cb122f51a7eb0ddb22a36c3c3e1bea742c..7c645e4d39e1596d2c21ef22368cfe93e3a5515f 100644 (file)
@@ -124,7 +124,7 @@ void dompoint_captured(entity this)
 
        this.captime = time;
 
-       FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(set_dom_state(it)));
+       FOREACH_CLIENT(IS_REAL_CLIENT(it), { set_dom_state(it); });
 }
 
 void AnimateDomPoint(entity this)
@@ -380,7 +380,7 @@ float Domination_CheckPlayers()
 
 void Domination_RoundStart()
 {
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(it.player_blocked = false));
+       FOREACH_CLIENT(IS_PLAYER(it), { it.player_blocked = false; });
 }
 
 //go to best items, or control points you don't own
@@ -445,13 +445,13 @@ MUTATOR_HOOKFUNCTION(dom, CheckAllowedTeams)
 MUTATOR_HOOKFUNCTION(dom, reset_map_players)
 {
        total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0;
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                PutClientInServer(it);
                if(domination_roundbased)
                        it.player_blocked = 1;
                if(IS_REAL_CLIENT(it))
                        set_dom_state(it);
-       ));
+       });
        return true;
 }
 
index 811614c21b9d5771f89b91db197f0742a8de7c27..9e9878c3620b6230d9b72f31dfccd4232e1a7268 100644 (file)
@@ -17,7 +17,7 @@ void freezetag_ScoreRules(int teams)
 void freezetag_count_alive_players()
 {
        total_players = redalive = bluealive = yellowalive = pinkalive = 0;
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                switch(it.team)
                {
                        case NUM_TEAM_1: ++total_players; if(it.health >= 1 && STAT(FROZEN, it) != 1) ++redalive; break;
@@ -25,13 +25,13 @@ void freezetag_count_alive_players()
                        case NUM_TEAM_3: ++total_players; if(it.health >= 1 && STAT(FROZEN, it) != 1) ++yellowalive; break;
                        case NUM_TEAM_4: ++total_players; if(it.health >= 1 && STAT(FROZEN, it) != 1) ++pinkalive; break;
                }
-       ));
-       FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
+       });
+       FOREACH_CLIENT(IS_REAL_CLIENT(it), {
                it.redalive_stat = redalive;
                it.bluealive_stat = bluealive;
                it.yellowalive_stat = yellowalive;
                it.pinkalive_stat = pinkalive;
-       ));
+       });
 
        eliminatedPlayers.SendFlags |= 1;
 }
@@ -106,10 +106,10 @@ float freezetag_CheckWinner()
        {
                Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER);
                Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER);
-               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it), {
                        it.freezetag_frozen_timeout = 0;
                        nades_Clear(it);
-               ));
+               });
                game_stopped = true;
                round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
                return 1;
@@ -131,10 +131,10 @@ float freezetag_CheckWinner()
                Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED);
        }
 
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                it.freezetag_frozen_timeout = 0;
                nades_Clear(it);
-       ));
+       });
 
        game_stopped = true;
        round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
@@ -144,7 +144,7 @@ float freezetag_CheckWinner()
 entity freezetag_LastPlayerForTeam(entity this)
 {
        entity last_pl = NULL;
-       FOREACH_CLIENT(IS_PLAYER(it) && it != this, LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && it != this, {
                if(it.health >= 1)
                if(!STAT(FROZEN, it))
                if(SAME_TEAM(it, this))
@@ -152,7 +152,7 @@ entity freezetag_LastPlayerForTeam(entity this)
                        last_pl = it;
                else
                        return NULL;
-       ));
+       });
        return last_pl;
 }
 
@@ -226,7 +226,7 @@ void(entity this) havocbot_role_ft_offense;
 void havocbot_goalrating_freeplayers(entity this, float ratingscale, vector org, float sradius)
 {
        float t;
-       FOREACH_CLIENT(IS_PLAYER(it) && it != this && SAME_TEAM(it, this), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && it != this && SAME_TEAM(it, this), {
                if (STAT(FROZEN, it) == 1)
                {
                        if(vdist(it.origin - org, >, sradius))
@@ -240,7 +240,7 @@ void havocbot_goalrating_freeplayers(entity this, float ratingscale, vector org,
                        t = 0.2 * 150 / (this.health + this.armorvalue);
                        navigation_routerating(this, it, t * ratingscale, 2000);
                }
-       ));
+       });
 }
 
 void havocbot_role_ft_offense(entity this)
@@ -253,7 +253,7 @@ void havocbot_role_ft_offense(entity this)
 
        // Count how many players on team are unfrozen.
        int unfrozen = 0;
-       FOREACH_CLIENT(IS_PLAYER(it) && SAME_TEAM(it, this) && !(STAT(FROZEN, it) != 1), LAMBDA(unfrozen++));
+       FOREACH_CLIENT(IS_PLAYER(it) && SAME_TEAM(it, this) && !(STAT(FROZEN, it) != 1), { unfrozen++; });
 
        // If only one left on team or if role has timed out then start trying to free players.
        if (((unfrozen == 0) && (!STAT(FROZEN, this))) || (time > this.havocbot_role_timeout))
@@ -416,12 +416,12 @@ MUTATOR_HOOKFUNCTION(ft, PlayerSpawn)
 
 MUTATOR_HOOKFUNCTION(ft, reset_map_players)
 {
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                CS(it).killcount = 0;
                it.freezetag_frozen_timeout = -1;
                PutClientInServer(it);
                it.freezetag_frozen_timeout = 0;
-       ));
+       });
        freezetag_count_alive_players();
        return true;
 }
@@ -454,7 +454,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
        {
                vector revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
                n = 0;
-               FOREACH_CLIENT(IS_PLAYER(it) && it != player, LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it) && it != player, {
                        if(STAT(FROZEN, it) == 0)
                        if(!IS_DEAD(it))
                        if(SAME_TEAM(it, player))
@@ -466,7 +466,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
                                        it.reviving = true;
                                ++n;
                        }
-               ));
+               });
 
        }
 
@@ -488,21 +488,21 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
                        }
 
                        // EVERY team mate nearby gets a point (even if multiple!)
-                       FOREACH_CLIENT(IS_PLAYER(it) && it.reviving, LAMBDA(
+                       FOREACH_CLIENT(IS_PLAYER(it) && it.reviving, {
                                PlayerScore_Add(it, SP_FREEZETAG_REVIVALS, +1);
                                PlayerScore_Add(it, SP_SCORE, +1);
                                nades_GiveBonus(it,autocvar_g_nades_bonus_score_low);
-                       ));
+                       });
 
                        Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, o.netname);
                        Send_Notification(NOTIF_ONE, o, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
                        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, o.netname);
                }
 
-               FOREACH_CLIENT(IS_PLAYER(it) && it.reviving, LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it) && it.reviving, {
                        it.revive_progress = player.revive_progress;
                        it.reviving = false;
-               ));
+               });
        }
        else if(!n && STAT(FROZEN, player) == 1) // only if no teammate is nearby will we reset
        {
index 05a89c75df6e23a2ce7d3e059a1bb637bfc4efcc..fabcc26f62cb26bef62edda59104324330421a82 100644 (file)
@@ -252,14 +252,14 @@ bool Invasion_CheckWinner()
        }
        else
        {
-               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it), {
                        float cs = PlayerScore_Add(it, SP_KILLS, 0);
                        if(cs > winning_score)
                        {
                                winning_score = cs;
                                winner = it;
                        }
-               ));
+               });
        }
 
        IL_EACH(g_monsters, true,
@@ -295,10 +295,10 @@ bool Invasion_CheckPlayers()
 void Invasion_RoundStart()
 {
        int numplayers = 0;
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                it.player_blocked = false;
                ++numplayers;
-       ));
+       });
 
        if(inv_roundcnt < inv_maxrounds)
                inv_roundcnt += 1; // a limiter to stop crazy counts
index 52daeb796393f6a8ff96ee493c36be5449b62828..d32df0f59058cde75fa8e55f132914ecb210b539 100644 (file)
@@ -133,7 +133,7 @@ void kh_update_state()
                s |= (32 ** key.count) * f;
        }
 
-       FOREACH_CLIENT(true, LAMBDA(it.kh_state = s));
+       FOREACH_CLIENT(true, { it.kh_state = s; });
 
        FOR_EACH_KH_KEY(key)
        {
@@ -394,9 +394,9 @@ void kh_Key_AssignTo(entity key, entity player)  // runs every time a key is pic
                        {
                                if (!k.owner) continue;
                                entity first = WP_Null;
-                               FOREACH(Waypoints, it.netname == k.owner.waypointsprite_attachedforcarrier.model1, LAMBDA(first = it; break));
+                               FOREACH(Waypoints, it.netname == k.owner.waypointsprite_attachedforcarrier.model1, { first = it; break; });
                                entity third = WP_Null;
-                               FOREACH(Waypoints, it.netname == k.owner.waypointsprite_attachedforcarrier.model3, LAMBDA(third = it; break));
+                               FOREACH(Waypoints, it.netname == k.owner.waypointsprite_attachedforcarrier.model3, { third = it; break; });
                                WaypointSprite_UpdateSprites(k.owner.waypointsprite_attachedforcarrier, first, WP_KeyCarrierFinish, third);
                        }
                }
@@ -409,9 +409,9 @@ void kh_Key_AssignTo(entity key, entity player)  // runs every time a key is pic
                        {
                                if (!k.owner) continue;
                                entity first = WP_Null;
-                               FOREACH(Waypoints, it.netname == k.owner.waypointsprite_attachedforcarrier.model1, LAMBDA(first = it; break));
+                               FOREACH(Waypoints, it.netname == k.owner.waypointsprite_attachedforcarrier.model1, { first = it; break; });
                                entity third = WP_Null;
-                               FOREACH(Waypoints, it.netname == k.owner.waypointsprite_attachedforcarrier.model3, LAMBDA(third = it; break));
+                               FOREACH(Waypoints, it.netname == k.owner.waypointsprite_attachedforcarrier.model3, { third = it; break; });
                                WaypointSprite_UpdateSprites(k.owner.waypointsprite_attachedforcarrier, first, WP_KeyCarrierFriend, third);
                        }
                }
@@ -601,7 +601,7 @@ void kh_LoserTeam(int loser_team, entity lostkey)  // runs when a player pushes
                int players = 0;
                float of = autocvar_g_balance_keyhunt_score_destroyed_ownfactor;
 
-               FOREACH_CLIENT(IS_PLAYER(it) && it.team != loser_team, LAMBDA(++players));
+               FOREACH_CLIENT(IS_PLAYER(it) && it.team != loser_team, { ++players; });
 
                entity key;
                int keys = 0;
@@ -636,16 +636,16 @@ void kh_LoserTeam(int loser_team, entity lostkey)  // runs when a player pushes
                                continue;
 
                        players = 0;
-                       FOREACH_CLIENT(IS_PLAYER(it) && it.team == thisteam, LAMBDA(++players));
+                       FOREACH_CLIENT(IS_PLAYER(it) && it.team == thisteam, { ++players; });
 
                        DistributeEvenly_Init(fragsleft, j);
                        fragsleft = DistributeEvenly_Get(j - 1);
                        DistributeEvenly_Init(DistributeEvenly_Get(1), players);
 
-                       FOREACH_CLIENT(IS_PLAYER(it) && it.team == thisteam, LAMBDA(
+                       FOREACH_CLIENT(IS_PLAYER(it) && it.team == thisteam, {
                                f = DistributeEvenly_Get(1);
                                kh_Scores_Event(it, NULL, "destroyed", f, 0);
-                       ));
+                       });
 
                        --j;
                }
@@ -703,7 +703,7 @@ LABEL(not_winning)
        if(kh_interferemsg_time && time > kh_interferemsg_time)
        {
                kh_interferemsg_time = 0;
-               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it), {
                        if(it.team == kh_interferemsg_team)
                                if(it.kh_next)
                                        Send_Notification(NOTIF_ONE, it, MSG_CENTER, CENTER_KEYHUNT_MEET);
@@ -711,7 +711,7 @@ LABEL(not_winning)
                                        Send_Notification(NOTIF_ONE, it, MSG_CENTER, CENTER_KEYHUNT_HELP);
                        else
                                Send_Notification(NOTIF_ONE, it, MSG_CENTER, APP_TEAM_NUM(kh_interferemsg_team, CENTER_KEYHUNT_INTERFERE));
-               ));
+               });
        }
 
        this.nextthink = time + 0.05;
@@ -858,10 +858,10 @@ int kh_GetMissingTeams()
        {
                int teem = kh_Team_ByID(i);
                int players = 0;
-               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it), {
                        if(!IS_DEAD(it) && !PHYS_INPUT_BUTTON_CHAT(it) && it.team == teem)
                                ++players;
-               ));
+               });
                if (!players)
                        missing_teams |= (2 ** i);
        }
@@ -939,14 +939,14 @@ void kh_StartRound()  // runs at the start of each round
                int teem = kh_Team_ByID(i);
                int players = 0;
                entity my_player = NULL;
-               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it), {
                        if(!IS_DEAD(it) && !PHYS_INPUT_BUTTON_CHAT(it) && it.team == teem)
                        {
                                ++players;
                                if(random() * players <= 1)
                                        my_player = it;
                        }
-               ));
+               });
                kh_Key_Spawn(my_player, 360 * i / NumTeams(kh_teams), i);
        }
 
index fbe6b0c1da9c5d60e3703522c3c73157aa84d834..158492cd3bc58c22e9cca7138aa13e3ea81c37b9 100644 (file)
@@ -367,10 +367,10 @@ MUTATOR_HOOKFUNCTION(lms, ItemTouch)
 
 MUTATOR_HOOKFUNCTION(lms, Bot_FixCount, CBC_ORDER_EXCLUSIVE)
 {
-       FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
+       FOREACH_CLIENT(IS_REAL_CLIENT(it), {
                ++M_ARGV(0, int); // activerealplayers
                ++M_ARGV(1, int); // realplayers
-       ));
+       });
 
        return true;
 }
index b1759fb6a62c2b2daafa47aed9532838ddd5d4bd..c51afbf169dba4bdae0cf3878dfc317067914642 100644 (file)
@@ -71,11 +71,11 @@ float WinningCondition_Race(float fraglimit)
 
        n = 0;
        c = 0;
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                ++n;
                if(CS(it).race_completed)
                        ++c;
-       ));
+       });
        if(n && (n == c))
                return WINNING_YES;
        wc = WinningCondition_Scores(fraglimit, 0);
@@ -198,7 +198,7 @@ MUTATOR_HOOKFUNCTION(rc, reset_map_global)
        race_ClearRecords();
        PlayerScore_Sort(race_place, 0, 1, 0);
 
-       FOREACH_CLIENT(true, LAMBDA(
+       FOREACH_CLIENT(true, {
                if(it.race_place)
                {
                        s = PlayerScore_Add(it, SP_RACE_FASTEST, 0);
@@ -206,7 +206,7 @@ MUTATOR_HOOKFUNCTION(rc, reset_map_global)
                                it.race_place = 0;
                }
                race_EventLog(ftos(it.race_place), it);
-       ));
+       });
 
        if(g_race_qualifying == 2)
        {
index 4e8663d24af0a5aaf8b6b3f574fdd9acd9dab8d8..d70210feab5b3726645b74706ca34afebcaa4131 100644 (file)
@@ -235,10 +235,10 @@ void calculate_player_respawn_time(entity this)
        float pcount = 1;  // Include myself whether or not team is already set right and I'm a "player".
        if (teamplay)
        {
-               FOREACH_CLIENT(IS_PLAYER(it) && it != this, LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it) && it != this, {
                        if(it.team == this.team)
                                ++pcount;
-               ));
+               });
                if (sdelay_small_count == 0)
                        sdelay_small_count = 1;
                if (sdelay_large_count == 0)
@@ -246,9 +246,9 @@ void calculate_player_respawn_time(entity this)
        }
        else
        {
-               FOREACH_CLIENT(IS_PLAYER(it) && it != this, LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it) && it != this, {
                        ++pcount;
-               ));
+               });
                if (sdelay_small_count == 0)
                {
                        if (IS_INDEPENDENT_PLAYER(this))
index 99125a1a30c502d58e736cefbdfb59033d02a05a..260e035b5bef4251057af0cec6d12663b211677f 100644 (file)
@@ -473,7 +473,7 @@ void Portal_Think(entity this)
 
        fixedmakevectors(this.mangle);
 
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                if(it != o)
                        if(IS_INDEPENDENT_PLAYER(it) || IS_INDEPENDENT_PLAYER(o))
                                continue; // cannot go through someone else's portal
@@ -487,7 +487,7 @@ void Portal_Think(entity this)
                if(it.(weaponentity).hook)
                        Portal_Think_TryTeleportPlayer(this, it.(weaponentity).hook, g);
            }
-       ));
+       });
        this.solid = SOLID_TRIGGER;
        this.aiment = o;
 #endif
index a9625329705399e44a0772d5c315cb24ab959153..0a3e2e8fa0a52c5578102eb9107fca8a46d15008 100644 (file)
@@ -443,7 +443,7 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
                                                strunzone(race_checkpoint_recordholders[cp]);
                                        race_checkpoint_recordholders[cp] = strzone(e.netname);
                                        if(g_race_qualifying)
-                                               FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it.race_checkpoint == cp, LAMBDA(race_SendNextCheckpoint(it, 0)));
+                                               FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it.race_checkpoint == cp, { race_SendNextCheckpoint(it, 0); });
                                }
 
                        }
@@ -1048,7 +1048,7 @@ void race_AbandonRaceCheck(entity p)
 void race_StartCompleting()
 {
        race_completing = 1;
-       FOREACH_CLIENT(IS_PLAYER(it) && IS_DEAD(it), LAMBDA(race_AbandonRaceCheck(it)));
+       FOREACH_CLIENT(IS_PLAYER(it) && IS_DEAD(it), { race_AbandonRaceCheck(it); });
 }
 
 void race_PreparePlayer(entity this)
@@ -1091,11 +1091,11 @@ void race_ClearRecords()
                race_checkpoint_recordholders[j] = string_null;
        }
 
-       FOREACH_CLIENT(true, LAMBDA(
+       FOREACH_CLIENT(true, {
                float p = it.race_place;
                race_PreparePlayer(it);
                it.race_place = p;
-       ));
+       });
 }
 
 void race_ImposePenaltyTime(entity pl, float penalty, string reason)
index 042d450ec98e9a74c41e92d1c54a42230fc71770..266f7734b660bae45bad90f29514a869ef182b46 100644 (file)
@@ -454,7 +454,7 @@ void WinningConditionHelper(entity this)
                WinningConditionHelper_second = NULL;
                winnerscorekeeper = NULL;
                secondscorekeeper = NULL;
-               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it), {
                        sk = CS(it).scorekeeper;
                        c = PlayerScore_Compare(winnerscorekeeper, sk, 1);
                        if(c < 0)
@@ -473,7 +473,7 @@ void WinningConditionHelper(entity this)
                                        secondscorekeeper = sk;
                                }
                        }
-               ));
+               });
 
                WinningConditionHelper_equality = (PlayerScore_Compare(winnerscorekeeper, secondscorekeeper, 0) == 0);
                if(WinningConditionHelper_equality)
@@ -515,7 +515,7 @@ void WinningConditionHelper(entity this)
                strunzone(worldstatus);
        worldstatus = strzone(s);
 
-       FOREACH_CLIENT(true, LAMBDA(
+       FOREACH_CLIENT(true, {
                string s = "";
                if(fullstatus)
                {
@@ -535,7 +535,7 @@ void WinningConditionHelper(entity this)
                if(it.clientstatus)
                        strunzone(it.clientstatus);
                it.clientstatus = strzone(s);
-       ));
+       });
 }
 
 string GetScoreLogLabel(string label, float fl)
@@ -694,7 +694,7 @@ entity PlayerScore_Sort(.float field, float teams, float strict, float nospectat
 
        plist = NULL;
 
-       FOREACH_CLIENT(true, LAMBDA(it.(field) = 0));
+       FOREACH_CLIENT(true, { it.(field) = 0; });
 
        FOREACH_CLIENT(CS(it).scorekeeper,
        {
@@ -894,12 +894,12 @@ void Score_NicePrint(entity to)
        }
 
        t = 0;
-       FOREACH_CLIENT(!IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(!IS_PLAYER(it), {
                if (!t)
                        Score_NicePrint_Spectators(to);
                Score_NicePrint_Spectator(to, it);
                t = 1;
-       ));
+       });
 }
 
 void PlayerScore_PlayerStats(entity p)
index bdb9cdab787a8c4f19f26ff222930b5368bbbdc8..254e799eebfb082deb3e4a1ec2eaae3fb8a8b3f4 100644 (file)
@@ -241,11 +241,11 @@ vector Spawn_Score(entity this, entity spot, float mindist, float teamcheck)
        }
 
        shortest = vlen(world.maxs - world.mins);
-       FOREACH_CLIENT(IS_PLAYER(it) && it != this, LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && it != this, {
                thisdist = vlen(it.origin - spot.origin);
                if (thisdist < shortest)
                        shortest = thisdist;
-       ));
+       });
        if(shortest > mindist)
                prio += SPAWN_PRIO_GOOD_DISTANCE;
 
index 0ae9b356cd3cdecbdcaf7e8c6c8c445d13fc847b..74dce96a2bc9a23a03a06e9a68f6d3ba34bdc6eb 100644 (file)
@@ -139,10 +139,10 @@ void CreatureFrame_All()
 void Pause_TryPause(bool ispaused)
 {
        int n = 0;
-       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {
                if (PHYS_INPUT_BUTTON_CHAT(it) != ispaused) return;
                ++n;
-       ));
+       });
        if (!n) return;
        setpause(ispaused);
 }
@@ -187,12 +187,12 @@ void StartFrame()
                LOG_INFO("CEFC time: ", ftos(t * 1000), "ms; ");
                int c_seeing = 0;
                int c_seen = 0;
-               FOREACH_CLIENT(true, LAMBDA(
+               FOREACH_CLIENT(true, {
                        if(IS_REAL_CLIENT(it))
                                ++c_seeing;
                        if(IS_PLAYER(it))
                                ++c_seen;
-               ));
+               });
                LOG_INFO("CEFC calls per second: ", ftos(c_seeing * (c_seen - 1) / t), "; ");
                LOG_INFO("CEFC 100% load at: ", ftos(solve_quadratic(t, -t, -1) * '0 1 0'), "\n");
 
index 2d6ceb8e0257f3546820544f276cb873d946e863..793a227b897bb1d6b92a5c438184568f44e0b564 100644 (file)
@@ -328,7 +328,7 @@ void GetTeamCounts(entity ignore)
        // FIXME: also find and memorize the lowest-scoring bot on each team (in case players must be shuffled around)
        // also remember the lowest-scoring player
 
-       FOREACH_CLIENT(true, LAMBDA(
+       FOREACH_CLIENT(true, {
                float t;
                if(IS_PLAYER(it) || it.caplayer)
                        t = it.team;
@@ -376,7 +376,7 @@ void GetTeamCounts(entity ignore)
                                }
                        }
                }
-       ));
+       });
 
        // if the player who has a forced team has not joined yet, reserve the spot
        if(autocvar_g_campaign)
@@ -737,7 +737,7 @@ void ShufflePlayerOutOfTeam (float source_team)
        lowest_player_score = 999999999;
 
        // find the lowest-scoring player & bot of that team
-       FOREACH_CLIENT(IS_PLAYER(it) && it.team == steam, LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && it.team == steam, {
                if(it.isbot)
                {
                        if(it.totalfrags < lowest_bot_score)
@@ -754,7 +754,7 @@ void ShufflePlayerOutOfTeam (float source_team)
                                lowest_player_score = it.totalfrags;
                        }
                }
-       ));
+       });
 
        // prefers to move a bot...
        if(lowest_bot != NULL)
index bee961bc080d0aecd64ccc284e02a0d49be4517b..4b01a3138936d00e0e2401b7f7fe3ebe5ec6171e 100644 (file)
@@ -85,7 +85,7 @@ void accuracy_add(entity this, int w, int fired, int hit)
        if (b == accuracy_byte(a.accuracy_hit[w], a.accuracy_fired[w])) return; // no change
        int sf = 1 << (w % 24);
        a.SendFlags |= sf;
-       FOREACH_CLIENT(IS_SPEC(it) && it.enemy == this, LAMBDA(CS(it).accuracy.SendFlags |= sf));
+       FOREACH_CLIENT(IS_SPEC(it) && it.enemy == this, { CS(it).accuracy.SendFlags |= sf; });
 }
 
 bool accuracy_isgooddamage(entity attacker, entity targ)
index b493409b0296ebc8f122b473cecf8044b56b9d0a..62b11ea45d62e47e3bc9c3d7244b05837e39c737 100644 (file)
@@ -50,7 +50,7 @@ void weapon_defaultspawnfunc(entity this, Weapon e)
                        for (int i = 1; i < t; ++i)
                        {
                                s = argv(i);
-                               FOREACH(Weapons, it != WEP_Null, LAMBDA(
+                               FOREACH(Weapons, it != WEP_Null, {
                                        if(it.netname == s)
                                        {
                                                entity replacement = spawn();
@@ -59,20 +59,20 @@ void weapon_defaultspawnfunc(entity this, Weapon e)
                                                weapon_defaultspawnfunc(replacement, it);
                                                break;
                                        }
-                               ));
+                               });
                        }
                }
                if (t >= 1) // always the case!
                {
                        s = argv(0);
                        wpn = WEP_Null;
-                       FOREACH(Weapons, it != WEP_Null, LAMBDA(
+                       FOREACH(Weapons, it != WEP_Null, {
                                if(it.netname == s)
                                {
                                        wpn = it;
                                        break;
                                }
-                       ));
+                       });
                }
                if (wpn == WEP_Null)
                {
index dd0f3a6c0a1fac62e391e1b97eb1f0ef10be1145..4b7d45b964157127f682e1de6048aa1bc3c358cd 100644 (file)
@@ -60,10 +60,10 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
                else
                {
                        int superweapons = 1;
-                       FOREACH(Weapons, it != WEP_Null, LAMBDA(
+                       FOREACH(Weapons, it != WEP_Null, {
                                WepSet set = it.m_wepset;
                                if((set & WEPSET_SUPERWEAPONS) && (own.weapons & set)) ++superweapons;
-                       ));
+                       });
                        if(superweapons <= 1)
                        {
                                wep.superweapons_finished = own.superweapons_finished;
index 475eb3d265c086e769242548ab018ed6a00e1bb3..d6c9fdfffbb436980b31e78983f063c20416b133 100644 (file)
@@ -262,7 +262,7 @@ void FireRailgunBullet (entity this, .entity weaponentity, vector start, vector
        // Find all non-hit players the beam passed close by
        if(deathtype == WEP_VAPORIZER.m_id || deathtype == WEP_VORTEX.m_id)
        {
-               FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != this, LAMBDA(
+               FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != this, {
                        if(!it.railgunhit)
                        if(!(IS_SPEC(it) && it.enemy == this))
                        {
@@ -278,7 +278,7 @@ void FireRailgunBullet (entity this, .entity weaponentity, vector start, vector
                                        pseudoprojectile = spawn(); // we need this so the sound uses the "entchannel4" volume
                                soundtoat(MSG_ONE, pseudoprojectile, beampos, CH_SHOTS, SND(NEXWHOOSH_RANDOM()), VOL_BASE * f, ATTEN_NONE);
                        }
-               ));
+               });
 
                if(pseudoprojectile)
                        delete(pseudoprojectile);
index cbde7d360c61544c8ea3b4d48596c11ac2330435..f8949b15601919e1b863084a1e5653ab3f94d9c2 100644 (file)
@@ -393,10 +393,10 @@ void weapon_thinkf(entity actor, .entity weaponentity, WFRAME fr, float t, void(
 
        if (this)
        {
-               FOREACH_CLIENT(true, LAMBDA(
+               FOREACH_CLIENT(true, {
                        if(it == actor || (IS_SPEC(it) && it.enemy == actor))
                                wframe_send(it, this, a, restartanim);
-               ));
+               });
        }
 
        if ((fr == WFRAME_FIRE1 || fr == WFRAME_FIRE2) && t)