]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Teams: mark all uses
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 17 Mar 2016 07:47:19 +0000 (18:47 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 17 Mar 2016 08:32:14 +0000 (19:32 +1100)
83 files changed:
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/hud/panel/infomessages.qc
qcsrc/client/hud/panel/radar.qc
qcsrc/client/hud/panel/score.qc
qcsrc/client/main.qc
qcsrc/client/miscfunctions.qc
qcsrc/client/quickmenu.qc
qcsrc/client/scoreboard.qc
qcsrc/client/teamradar.qc
qcsrc/client/weapons/projectile.qc
qcsrc/common/effects/qc/damageeffects.qc
qcsrc/common/effects/qc/gibs.qc
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc
qcsrc/common/gamemodes/gamemode/onslaught/cl_generator.qc
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_generator.qc
qcsrc/common/mapinfo.qc
qcsrc/common/mapinfo.qh
qcsrc/common/minigames/cl_minigames.qc
qcsrc/common/minigames/minigame/all.qh
qcsrc/common/minigames/minigame/bd.qc
qcsrc/common/minigames/minigame/c4.qc
qcsrc/common/minigames/minigame/nmm.qc
qcsrc/common/minigames/minigame/pong.qc
qcsrc/common/minigames/minigame/pp.qc
qcsrc/common/minigames/minigame/ps.qc
qcsrc/common/minigames/minigame/snake.qc
qcsrc/common/minigames/minigame/ttt.qc
qcsrc/common/minigames/sv_minigames.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/mutators/mutator/buffs/all.qh
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/notifications/all.qh
qcsrc/common/physics/player.qc
qcsrc/common/playerstats.qc
qcsrc/common/sounds/all.qc
qcsrc/common/t_items.qc
qcsrc/common/teams.qh
qcsrc/common/triggers/func/breakable.qc
qcsrc/common/triggers/trigger/jumppads.qc
qcsrc/common/triggers/trigger/multi.qc
qcsrc/common/triggers/trigger/relay_teamcheck.qc
qcsrc/common/triggers/trigger/teleport.qc
qcsrc/common/turrets/cl_turrets.qc
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/turret/plasma.qc
qcsrc/common/turrets/turret/plasma_dual.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc
qcsrc/common/weapons/weapon/tuba.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/lib/_all.inc
qcsrc/server/bot/aim.qc
qcsrc/server/bot/bot.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/command/vote.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_models.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/miscfunctions.qh
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_domination.qc
qcsrc/server/mutators/mutator/gamemode_freezetag.qc
qcsrc/server/mutators/mutator/gamemode_invasion.qc
qcsrc/server/mutators/mutator/gamemode_keepaway.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/mutators/mutator/gamemode_tdm.qc
qcsrc/server/scores.qc
qcsrc/server/spawnpoints.qc
qcsrc/server/teamplay.qc
qcsrc/server/weapons/csqcprojectile.qc
qcsrc/server/weapons/spawning.qc

index d0910e37456e0bc29e568e820535bfab4e661699..3f236fc732caf4887504807df8d311bf733423d4 100644 (file)
@@ -254,7 +254,7 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
                                // if we rejected because we matched our OWN team color,
                                // this is not bad; we then simply keep our color as is
                                // anyway.
-                               if(forcecolor_friend == 1024 + 17 * tm.team)
+                               if(forcecolor_friend == 1024 + 17 * TMID(tm.team))
                                        forcecolor_friend = 0;
                }
 
index 8199bd8dd6d82f10dfb9a031f3feea8266e63a02..2213e5d194e26de493de98821d215b6a16e5e339 100644 (file)
@@ -153,7 +153,7 @@ void HUD_InfoMessages()
                        {
                                for (; tm.sort_next; tm = tm.sort_next)
                                {
-                                       if(!tm.team_size || tm.team == NUM_SPECTATOR)
+                                       if(!tm.team_size || TMID(tm.team) == NUM_SPECTATOR)
                                                continue;
                                        if(!ts_min) ts_min = tm.team_size;
                                        else ts_min = min(ts_min, tm.team_size);
@@ -165,7 +165,7 @@ void HUD_InfoMessages()
                                        s = strcat(blinkcolor, _("Teamnumbers are unbalanced!"));
                                        tm = GetTeam(myteam, false);
                                        if (tm)
-                                       if (tm.team != NUM_SPECTATOR)
+                                       if (TMID(tm.team) != NUM_SPECTATOR)
                                        if (tm.team_size == ts_max)
                                                s = strcat(s, sprintf(_(" Press ^3%s%s to adjust"), getcommandkey("team menu", "menu_showteamselect"), blinkcolor));
                                        drawInfoMessage(s);
index a70e0416af155d768d9510b15aaf2427bbef8c9a..cb08790e407739a37a54a8034f3665e1d51a842c 100644 (file)
@@ -340,12 +340,12 @@ void HUD_Radar()
 
        draw_teamradar_background(hud_panel_radar_foreground_alpha);
 
-       FOREACH_ENTITY_CLASS("radarlink", true, draw_teamradar_link(it.origin, it.velocity, it.team));
+       FOREACH_ENTITY_CLASS("radarlink", true, draw_teamradar_link(it.origin, it.velocity, TMID(it.team)));
 
        FOREACH_ENTITY_FLAGS(teamradar_icon, 0xFFFFFF, {
                if ( hud_panel_radar_mouse )
                if ( it.health > 0 )
-               if ( it.team == myteam+1 || gametype == MAPINFO_TYPE_RACE )
+               if ( TMID(it.team) == myteam+1 || gametype == MAPINFO_TYPE_RACE )
                {
                        vector coord = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(it.origin));
                        if(vdist((mousepos - coord), <, 8))
index 12114b4e356a712d8306439c8df0708da753eb3a..61782b9c11258cfa2b4f95bd2183065d127a276c 100644 (file)
@@ -78,13 +78,13 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me)
                // show team scores in the first line
                float score_size = mySize.x / team_count;
                for(tm = teams.sort_next; tm; tm = tm.sort_next) {
-                       if(tm.team == NUM_SPECTATOR)
+                       if(TMID(tm.team) == NUM_SPECTATOR)
                                continue;
                        if(!tm.team && teamplay)
                                continue;
-                       if (tm.team == myteam)
+                       if (TMID(tm.team) == myteam)
                                drawfill(pos + eX * score_size * i, eX * score_size + eY * fontsize.y, '1 1 1', highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                       drawstring_aspect(pos + eX * score_size * i, ftos(tm.(teamscores[ts_primary])), eX * score_size + eY * fontsize.y, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                       drawstring_aspect(pos + eX * score_size * i, ftos(tm.(teamscores[ts_primary])), eX * score_size + eY * fontsize.y, Team_ColorRGB(TMID(tm.team)) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
                        ++i;
                }
                first_pl = 1;
@@ -96,14 +96,14 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me)
        do
        for (pl = players.sort_next; pl && i<entries; pl = pl.sort_next)
        {
-               if ((team_count && pl.team != tm.team) || pl.team == NUM_SPECTATOR)
+               if ((team_count && pl.team != tm.team) || TMID(pl.team) == NUM_SPECTATOR)
                        continue;
 
                if (i == entries-1 && !me_printed && pl != me)
                if (autocvar_hud_panel_score_rankings == 1 && spectatee_status != -1)
                {
                        for (pl = me.sort_next; pl; pl = pl.sort_next)
-                               if (pl.team != NUM_SPECTATOR)
+                               if (TMID(pl.team) != NUM_SPECTATOR)
                                        break;
 
                        if (pl)
@@ -121,14 +121,14 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me)
                        drawfill(pos, eX * mySize.x + eY * fontsize.y, rgb, highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                }
                if (team_count)
-                       score_color = Team_ColorRGB(pl.team) * 0.8;
+                       score_color = Team_ColorRGB(TMID(pl.team)) * 0.8;
                s = textShortenToWidth(entcs_GetName(pl.sv_entnum), name_size, fontsize, stringwidth_colors);
                drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, true, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
                drawstring(pos + eX * (name_size + spacing_size), ftos(pl.(scores[ps_primary])), fontsize, score_color, panel_fg_alpha, DRAWFLAG_NORMAL);
                pos.y += fontsize.y;
                ++i;
        }
-       while (i<entries && team_count && (tm = tm.sort_next) && (tm.team != NUM_SPECTATOR || (tm = tm.sort_next)));
+       while (i<entries && team_count && (tm = tm.sort_next) && (TMID(tm.team) != NUM_SPECTATOR || (tm = tm.sort_next)));
 }
 
 void HUD_Score()
@@ -275,7 +275,7 @@ void HUD_Score()
                draw_beginBoldFont();
                row = column = 0;
                for(tm = teams.sort_next; tm; tm = tm.sort_next) {
-                       if(tm.team == NUM_SPECTATOR)
+                       if(TMID(tm.team) == NUM_SPECTATOR)
                                continue;
                        if(!tm.team && teamplay)
                                continue;
@@ -291,7 +291,7 @@ void HUD_Score()
                                score_pos = pos + eX * column * (score_size.x + offset.x) + eY * row * (score_size.y + offset.y);
                                if (max_fragcount == score)
                                        HUD_Panel_DrawHighlight(score_pos, score_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                               drawstring_aspect(score_pos, ftos(score), score_size, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawstring_aspect(score_pos, ftos(score), score_size, Team_ColorRGB(TMID(tm.team)) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
                                ++row;
                                if(row >= rows)
                                {
@@ -299,14 +299,14 @@ void HUD_Score()
                                        ++column;
                                }
                        }
-                       else if(tm.team == myteam) {
+                       else if(TMID(tm.team) == myteam) {
                                if (max_fragcount == score)
                                        HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                               drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize.x + eY * mySize.y, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize.x + eY * mySize.y, Team_ColorRGB(TMID(tm.team)) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
                        } else {
                                if (max_fragcount == score)
                                        HUD_Panel_DrawHighlight(pos + eX * 0.75 * mySize.x + eY * (1/3) * rows * mySize.y, score_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                               drawstring_aspect(pos + eX * 0.75 * mySize.x + eY * (1/3) * rows * mySize.y, ftos(score), score_size, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawstring_aspect(pos + eX * 0.75 * mySize.x + eY * (1/3) * rows * mySize.y, ftos(score), score_size, Team_ColorRGB(TMID(tm.team)) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
                                ++rows;
                        }
                }
index ebfc3b161f552c8f6541ed36f4af90533c3d2dcb..b56504006cfcd4bca350a6eeb12cd056d13515c6 100644 (file)
@@ -260,7 +260,7 @@ float SetTeam(entity o, int _team)
        {
                if(o.has_team)
                {
-                       tm = GetTeam(o.team, false);
+                       tm = GetTeam(TMID(o.team), false);
                        tm.team_size -= 1;
                        o.has_team = 0;
                        return true;
@@ -270,17 +270,17 @@ float SetTeam(entity o, int _team)
        {
                if (!o.has_team)
                {
-                       o.team = _team;
+                       o.__team = _team;
                        tm = GetTeam(_team, true);
                        tm.team_size += 1;
                        o.has_team = 1;
                        return true;
                }
-               else if(_team != o.team)
+               else if(_team != TMID(o.team))
                {
-                       tm = GetTeam(o.team, false);
+                       tm = GetTeam(TMID(o.team), false);
                        tm.team_size -= 1;
-                       o.team = _team;
+                       o.__team = _team;
                        tm = GetTeam(_team, true);
                        tm.team_size += 1;
                        return true;
@@ -472,8 +472,8 @@ NET_HANDLE(ENT_CLIENT_TEAMSCORES, bool isnew)
        int i;
        entity o;
 
-       this.team = ReadByte();
-       o = this.owner = GetTeam(this.team, true); // these team numbers can always be trusted
+       this.__team = ReadByte();
+       o = this.owner = GetTeam(TMID(this.team), true); // these team numbers can always be trusted
 
     int sf, lf;
 #if MAX_TEAMSCORE <= 8
index e876e3ea8acab50c56662e15e5b8cf045197880f..fcafca3fb38fb17f7be6cf26642bb9b12137b0ae 100644 (file)
@@ -90,7 +90,7 @@ float RegisterTeam(entity _team)
        if(teams.sort_next)
                teams.sort_next.sort_prev = _team;
        teams.sort_next = _team;
-       if(_team.team && _team.team != NUM_SPECTATOR)
+       if(TMID(_team.team) && TMID(_team.team) != NUM_SPECTATOR)
                ++team_count;
        AuditLists();
        return true;
@@ -112,7 +112,7 @@ void RemoveTeam(entity _team)
        parent.sort_next = _team.sort_next;
        if(_team.sort_next)
                _team.sort_next.sort_prev = parent;
-       if(_team.team && _team.team != NUM_SPECTATOR)
+       if(TMID(_team.team) && TMID(_team.team) != NUM_SPECTATOR)
                --team_count;
        AuditLists();
 }
@@ -125,7 +125,7 @@ entity GetTeam(int _team, bool add)
        if (!add)
                return world;
        entity tm = new_pure(team);
-       tm.team = _team;
+       tm.__team = _team;
        teamslots[num] = tm;
        RegisterTeam(tm);
        return tm;
index 0208fc1828c305fd8d1db0af696689e11fff0230..00dd6b9a7f5204180fd8e5224f00b55bb9455f75 100644 (file)
@@ -752,9 +752,9 @@ void HUD_Quickmenu_PlayerListEntries(string cmd, float teamplayers, float withou
 
        for(pl = players.sort_next; pl; pl = pl.sort_next)
        {
-               if(teamplayers == 1 && (pl.team != myteam || pl.team == NUM_SPECTATOR)) // only own team players
+               if(teamplayers == 1 && (TMID(pl.team) != myteam || TMID(pl.team) == NUM_SPECTATOR)) // only own team players
                        continue;
-               if(teamplayers == 2 && (pl.team == myteam || pl.team == NUM_SPECTATOR)) // only enemy team players
+               if(teamplayers == 2 && (TMID(pl.team) == myteam || TMID(pl.team) == NUM_SPECTATOR)) // only enemy team players
                        continue;
                if(without_me && pl.sv_entnum == player_localnum)
                        continue;
index 53539e625927585f03b8ffd8bd2705592cd3ce60..51c8196c3e00e603d00ad459242f331c8e516529 100644 (file)
@@ -207,9 +207,9 @@ float HUD_CompareTeamScores(entity left, entity right)
 {
        int i, r;
 
-       if(left.team == NUM_SPECTATOR)
+       if(TMID(left.team) == NUM_SPECTATOR)
                return 1;
-       if(right.team == NUM_SPECTATOR)
+       if(TMID(right.team) == NUM_SPECTATOR)
                return 0;
 
        r = HUD_CompareScore(left.teamscores[ts_primary], right.teamscores[ts_primary], teamscores_flags[ts_primary]);
@@ -227,7 +227,7 @@ float HUD_CompareTeamScores(entity left, entity right)
                        return r;
        }
 
-       if (left.team < right.team)
+       if (TMID(left.team) < TMID(right.team))
                return true;
 
        return false;
@@ -707,7 +707,7 @@ string HUD_FixScoreboardColumnWidth(int i, string str)
 void HUD_PrintScoreboardItem(vector pos, vector item_size, entity pl, float is_self, int pl_number)
 {
        vector tmp, rgb;
-       rgb = Team_ColorRGB(pl.team);
+       rgb = Team_ColorRGB(TMID(pl.team));
        string str;
        int field;
        float is_spec;
@@ -960,7 +960,7 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz
        else
                for(pl = players.sort_next; pl; pl = pl.sort_next)
                {
-                       if(pl.team == NUM_SPECTATOR)
+                       if(TMID(pl.team) == NUM_SPECTATOR)
                                continue;
                        HUD_PrintScoreboardItem(pos, tmp, pl, (pl.sv_entnum == player_localnum), i);
                        pos.y += 1.25 * hud_fontsize.y;
@@ -1312,13 +1312,13 @@ void HUD_DrawScoreboard()
                team_score_baseoffset = eY * (2 * autocvar_scoreboard_border_thickness + hud_fontsize.y) - eX * (autocvar_scoreboard_border_thickness + hud_fontsize.x * 0.25);
                for(tm = teams.sort_next; tm; tm = tm.sort_next)
                {
-                       if(tm.team == NUM_SPECTATOR)
+                       if(TMID(tm.team) == NUM_SPECTATOR)
                                continue;
                        if(!tm.team && teamplay)
                                continue;
 
                        draw_beginBoldFont();
-                       rgb = Team_ColorRGB(tm.team);
+                       rgb = Team_ColorRGB(TMID(tm.team));
                        str = ftos(tm.(teamscores[ts_primary]));
                        drawstring(pos + team_score_baseoffset - eX * stringwidth(str, false, hud_fontsize * 1.5), str, hud_fontsize * 1.5, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
 
@@ -1343,7 +1343,7 @@ void HUD_DrawScoreboard()
 
                for(tm = teams.sort_next; tm; tm = tm.sort_next)
                {
-                       if(tm.team == NUM_SPECTATOR)
+                       if(TMID(tm.team) == NUM_SPECTATOR)
                                continue;
                        if(!tm.team && teamplay)
                                continue;
@@ -1386,7 +1386,7 @@ void HUD_DrawScoreboard()
        item_size.z = 0;
        for(pl = players.sort_next; pl; pl = pl.sort_next)
        {
-               if(pl.team != NUM_SPECTATOR)
+               if(TMID(pl.team) != NUM_SPECTATOR)
                        continue;
                pos.y += 1.25 * hud_fontsize.y;
                HUD_PrintScoreboardItem(pos, item_size, pl, (pl.sv_entnum == player_localnum), specs);
index 96fd5ee977695877739119e0ba69427588649859..c832a5866a5e36c06c48b86d7fdef776b9af36ca 100644 (file)
@@ -220,7 +220,7 @@ NET_HANDLE(ENT_CLIENT_RADARLINK, bool isnew)
 
        if(sendflags & 4)
        {
-               this.team = ReadByte();
+               this.__team = ReadByte();
        }
 
        return = true;
index c8e246a06e3dd6a0ab79170802846d19538c37e0..ae69b8f5a8b232151957ebf19d15b2179229d87b 100644 (file)
@@ -270,7 +270,7 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
                        this.fade_rate = 0;
                }
 
-               this.team = ReadByte() - 1;
+               this.__team = ReadByte() - 1;
        }
 
        if (f & 2)
@@ -323,7 +323,7 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
 
                        HANDLE(RPC)                this.traileffect = EFFECT_TR_ROCKET.m_id; break;
 
-                       HANDLE(ROCKETMINSTA_LASER) this.traileffect = EFFECT_ROCKETMINSTA_LASER(this.team).m_id; break;
+                       HANDLE(ROCKETMINSTA_LASER) this.traileffect = EFFECT_ROCKETMINSTA_LASER(TMID(this.team)).m_id; break;
 #undef HANDLE
                        default:
                                if (MUTATOR_CALLHOOK(Ent_Projectile, this))
index ba60e51bd10cf3c483a24a3c818f52d2ab3ed476..4da72a00e315f0163890a01733275a77152e4bfa 100644 (file)
@@ -99,7 +99,7 @@ void DamageEffect_Think()
        // now generate the particles
        vector org;
        org = gettaginfo(self, 0); // origin at attached location
-       __pointparticles(self.team, org, '0 0 0', 1);
+       __pointparticles(TMID(self.team), org, '0 0 0', 1);
 }
 
 string species_prefix(int specnum)
@@ -182,7 +182,7 @@ void DamageEffect(vector hitorg, float thedamage, int type, int specnum)
        setattachment(e, self, gettaginfo_name); // attach to the given bone
        e.owner = self;
        e.cnt = time + life;
-       e.team = _particleeffectnum(effectname);
+       e.__team = _particleeffectnum(effectname);
        e.think = DamageEffect_Think;
        e.nextthink = time;
        self.total_damages += 1;
index 45a28a9b485dbd6299febc78825cee0c529f2428..43afbf7e21a0c8c16811f8b97aa14bf893385f0a 100644 (file)
@@ -36,9 +36,9 @@ void Violence_GibSplash_At(vector org, vector dir, float type, float amount, ent
        // if this is a copied dead body, send the num of its player instead
        // TODO: remove this field, read from model txt files
        if(gibowner.classname == "body")
-               e.team = etof(gibowner.enemy);
+               e.__team = etof(gibowner.enemy);
        else
-               e.team = etof(gibowner);
+               e.__team = etof(gibowner);
 
        setorigin(e, org);
        e.velocity = dir;
index df062641a6126088cd15e84d732a9748d5448f6c..ca299b9a8ef76668ec3cf022b6eaea5c0abc0353 100644 (file)
@@ -50,9 +50,9 @@ float OtherTeam(float t)  //works only if there are two teams on the map!
 {
        entity e;
        e = find(world, classname, "nexball_team");
-       if(e.team == t)
+       if(TMID(e.team) == t)
                e = find(e, classname, "nexball_team");
-       return e.team;
+       return TMID(e.team);
 }
 
 const float ST_NEXBALL_GOALS = 1;
@@ -92,7 +92,7 @@ void nexball_setstatus()
        {
                if(self.ballcarried.teamtime && (self.ballcarried.teamtime < time))
                {
-                       bprint("The ", Team_ColoredFullName(self.team), " held the ball for too long.\n");
+                       bprint("The ", Team_ColoredFullName(TMID(self.team)), " held the ball for too long.\n");
                        setself(self.ballcarried);
                        DropBall(self, self.owner.origin, '0 0 0');
                        ResetBall();
@@ -215,7 +215,7 @@ void DropBall(entity ball, vector org, vector vel)
        }
 
        WaypointSprite_Kill(ball.owner.waypointsprite_attachedforcarrier);
-       WaypointSprite_Spawn(WP_NbBall, 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER); // no health bar please
+       WaypointSprite_Spawn(WP_NbBall, 0, 0, ball, '0 0 64', world, TMID(ball.team), ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER); // no health bar please
        WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
 
        ball.owner.ballcarried = world;
@@ -236,7 +236,7 @@ void InitBall()
        self.nextthink = time + autocvar_g_nexball_delay_idle + 3;
        self.teamtime = 0;
        self.pusher = world;
-       self.team = false;
+       self.__team = 0;
        _sound(self, CH_TRIGGER, self.noise1, VOL_BASE, ATTEN_NORM);
        WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);
        LogNB("init", world);
@@ -247,7 +247,7 @@ void ResetBall()
        if(self.cnt < 2)        // step 1
        {
                if(time == self.teamtime)
-                       bprint("The ", Team_ColoredFullName(self.team), " held the ball for too long.\n");
+                       bprint("The ", Team_ColoredFullName(TMID(self.team)), " held the ball for too long.\n");
 
                self.touch = func_null;
                self.movetype = MOVETYPE_NOCLIP;
@@ -360,13 +360,13 @@ void GoalTouch()
        if(ball.classname != "nexball_basketball")
                if(ball.classname != "nexball_football")
                        return;
-       if((!ball.pusher && self.team != GOAL_OUT) || ball.cnt)
+       if((!ball.pusher && TMID(self.team) != GOAL_OUT) || ball.cnt)
                return;
        EXACTTRIGGER_TOUCH;
 
 
        if(nb_teams == 2)
-               otherteam = OtherTeam(ball.team);
+               otherteam = OtherTeam(TMID(ball.team));
        else
                otherteam = 0;
 
@@ -381,16 +381,16 @@ void GoalTouch()
                bprint("Boo! ", pname, "^7 scored a goal against their own team!\n");
                pscore = -1;
        }
-       else if(self.team == GOAL_FAULT)
+       else if(TMID(self.team) == GOAL_FAULT)
        {
                LogNB("fault", ball.pusher);
                if(nb_teams == 2)
                        bprint(Team_ColoredFullName(otherteam), " gets a point due to ", pname, "^7's silliness.\n");
                else
-                       bprint(Team_ColoredFullName(ball.team), " loses a point due to ", pname, "^7's silliness.\n");
+                       bprint(Team_ColoredFullName(TMID(ball.team)), " loses a point due to ", pname, "^7's silliness.\n");
                pscore = -1;
        }
-       else if(self.team == GOAL_OUT)
+       else if(TMID(self.team) == GOAL_OUT)
        {
                LogNB("out", ball.pusher);
                if((self.spawnflags & GOAL_TOUCHPLAYER) && ball.owner)
@@ -401,8 +401,8 @@ void GoalTouch()
        }
        else                                                       //score
        {
-               LogNB(strcat("goal:", ftos(self.team)), ball.pusher);
-               bprint("Goaaaaal! ", pname, "^7 scored a point for the ", Team_ColoredFullName(ball.team), ".\n");
+               LogNB(strcat("goal:", ftos(TMID(self.team))), ball.pusher);
+               bprint("Goaaaaal! ", pname, "^7 scored a point for the ", Team_ColoredFullName(TMID(ball.team)), ".\n");
                pscore = 1;
        }
 
@@ -413,7 +413,7 @@ void GoalTouch()
                if(nb_teams == 2 && pscore < 0)
                        TeamScore_AddToTeam(otherteam, ST_NEXBALL_GOALS, -pscore);
                else
-                       TeamScore_AddToTeam(ball.team, ST_NEXBALL_GOALS, pscore);
+                       TeamScore_AddToTeam(TMID(ball.team), ST_NEXBALL_GOALS, pscore);
        }
        if(isclient)
        {
@@ -432,7 +432,7 @@ void GoalTouch()
        ball.think = ResetBall;
        if(ball.classname == "nexball_basketball")
                ball.touch = football_touch; // better than func_null: football control until the ball gets reset
-       ball.nextthink = time + autocvar_g_nexball_delay_goal * (self.team != GOAL_OUT);
+       ball.nextthink = time + autocvar_g_nexball_delay_goal * (TMID(self.team) != GOAL_OUT);
 }
 
 //=======================//
@@ -445,7 +445,7 @@ spawnfunc(nexball_team)
                remove(self);
                return;
        }
-       self.team = self.cnt + 1;
+       self.__team = self.cnt + 1;
 }
 
 void nb_spawnteam(string teamname, float teamcolor)
@@ -454,7 +454,7 @@ void nb_spawnteam(string teamname, float teamcolor)
        entity e = new(nexball_team);
        e.netname = teamname;
        e.cnt = teamcolor;
-       e.team = e.cnt + 1;
+       e.__team = e.cnt + 1;
        nb_teams += 1;
 }
 
@@ -464,33 +464,33 @@ void nb_spawnteams()
        entity e;
        for(e = world; (e = find(e, classname, "nexball_goal"));)
        {
-               switch(e.team)
+               switch(TMID(e.team))
                {
                case NUM_TEAM_1:
                        if(!t_red)
                        {
-                               nb_spawnteam("Red", e.team-1)   ;
+                               nb_spawnteam("Red", TMID(e.team)-1)   ;
                                t_red = true;
                        }
                        break;
                case NUM_TEAM_2:
                        if(!t_blue)
                        {
-                               nb_spawnteam("Blue", e.team-1)  ;
+                               nb_spawnteam("Blue", TMID(e.team)-1)  ;
                                t_blue = true;
                        }
                        break;
                case NUM_TEAM_3:
                        if(!t_yellow)
                        {
-                               nb_spawnteam("Yellow", e.team-1);
+                               nb_spawnteam("Yellow", TMID(e.team)-1);
                                t_yellow = true;
                        }
                        break;
                case NUM_TEAM_4:
                        if(!t_pink)
                        {
-                               nb_spawnteam("Pink", e.team-1)  ;
+                               nb_spawnteam("Pink", TMID(e.team)-1)  ;
                                t_pink = true;
                        }
                        break;
@@ -612,10 +612,10 @@ void SpawnGoal()
 
        EXACTTRIGGER_INIT;
 
-       if(self.team != GOAL_OUT && Team_TeamToNumber(self.team) != -1)
+       if(TMID(self.team) != GOAL_OUT && Team_TeamToNumber(TMID(self.team)) != -1)
        {
                entity wp = WaypointSprite_SpawnFixed(WP_NbGoal, (self.absmin + self.absmax) * 0.5, self, sprite, RADARICON_NONE);
-               wp.colormod = ((self.team) ? Team_ColorRGB(self.team) : '1 0.5 0');
+               wp.colormod = ((self.team) ? Team_ColorRGB(TMID(self.team)) : '1 0.5 0');
                self.sprite.customizeentityforclient = nb_Goal_Customize;
        }
 
@@ -628,28 +628,28 @@ void SpawnGoal()
 
 spawnfunc(nexball_redgoal)
 {
-       self.team = NUM_TEAM_1;
+       self.__team = NUM_TEAM_1;
        SpawnGoal();
 }
 spawnfunc(nexball_bluegoal)
 {
-       self.team = NUM_TEAM_2;
+       self.__team = NUM_TEAM_2;
        SpawnGoal();
 }
 spawnfunc(nexball_yellowgoal)
 {
-       self.team = NUM_TEAM_3;
+       self.__team = NUM_TEAM_3;
        SpawnGoal();
 }
 spawnfunc(nexball_pinkgoal)
 {
-       self.team = NUM_TEAM_4;
+       self.__team = NUM_TEAM_4;
        SpawnGoal();
 }
 
 spawnfunc(nexball_fault)
 {
-       self.team = GOAL_FAULT;
+       self.__team = GOAL_FAULT;
        if(self.noise == "")
                self.noise = strzone(SND(TYPEHIT));
        SpawnGoal();
@@ -657,7 +657,7 @@ spawnfunc(nexball_fault)
 
 spawnfunc(nexball_out)
 {
-       self.team = GOAL_OUT;
+       self.__team = GOAL_OUT;
        if(self.noise == "")
                self.noise = strzone(SND(TYPEHIT));
        SpawnGoal();
index 28ac85d79c460054f8df240d8de9bb7a3ff70c3f..8e973198a0304a96fc755c7e1d56525a894fb040 100644 (file)
@@ -142,9 +142,9 @@ void cpicon_changeteam(entity this)
 {
        if(this.team)
        {
-               this.glowmod = Team_ColorRGB(this.team - 1);
-               this.teamradar_color = Team_ColorRGB(this.team - 1);
-               this.colormap = 1024 + (this.team - 1) * 17;
+               this.glowmod = Team_ColorRGB(TMID(this.team) - 1);
+               this.teamradar_color = Team_ColorRGB(TMID(this.team) - 1);
+               this.colormap = 1024 + (TMID(this.team) - 1) * 17;
        }
        else
        {
@@ -169,7 +169,7 @@ NET_HANDLE(ENT_CLIENT_CONTROLPOINT_ICON, bool isnew)
                this.health = ReadByte();
                this.max_health = ReadByte();
                this.count = ReadByte();
-               this.team = ReadByte();
+               this.__team = ReadByte();
                this.iscaptured = ReadByte();
 
                if(!this.count)
@@ -182,9 +182,9 @@ NET_HANDLE(ENT_CLIENT_CONTROLPOINT_ICON, bool isnew)
        if(sf & CPSF_STATUS)
        {
                int _tmp = ReadByte();
-               if(_tmp != this.team)
+               if(_tmp != TMID(this.team))
                {
-                       this.team = _tmp;
+                       this.__team = _tmp;
                        cpicon_changeteam(this);
                }
 
index 03e81f4bdea092deee9f965d104cf4f3d4c8f2af..a4fdcff89970134b57b94b277f27e6eb601073d9 100644 (file)
@@ -167,9 +167,9 @@ void generator_changeteam(entity this)
 {
        if(this.team)
        {
-               this.glowmod = Team_ColorRGB(this.team - 1);
-               this.teamradar_color = Team_ColorRGB(this.team - 1);
-               this.colormap = 1024 + (this.team - 1) * 17;
+               this.glowmod = Team_ColorRGB(TMID(this.team) - 1);
+               this.teamradar_color = Team_ColorRGB(TMID(this.team) - 1);
+               this.colormap = 1024 + (TMID(this.team) - 1) * 17;
        }
        else
        {
@@ -194,7 +194,7 @@ NET_HANDLE(ENT_CLIENT_GENERATOR, bool isnew)
                this.health = ReadByte();
                this.max_health = ReadByte();
                this.count = ReadByte();
-               this.team = ReadByte();
+               this.__team = ReadByte();
 
                if(!this.count)
                        this.count = 40;
@@ -207,9 +207,9 @@ NET_HANDLE(ENT_CLIENT_GENERATOR, bool isnew)
        {
                int _tmp;
                _tmp = ReadByte();
-               if(_tmp != this.team)
+               if(_tmp != TMID(this.team))
                {
-                       this.team = _tmp;
+                       this.__team = _tmp;
                        generator_changeteam(this);
                }
 
index 0b030b251c8ba648fcb53d7e0fbbe4639b7dcd06..c585773520d389255b9c580b5e0644610c562c7e 100644 (file)
@@ -166,7 +166,7 @@ bool ons_CaptureShield_Customize()
 {SELFPARAM();
        entity e = WaypointSprite_getviewentity(other);
 
-       if(!self.enemy.isshielded && (ons_ControlPoint_Attackable(self.enemy, e.team) > 0 || self.enemy.classname != "onslaught_controlpoint")) { return false; }
+       if(!self.enemy.isshielded && (ons_ControlPoint_Attackable(self.enemy, TMID(e.team)) > 0 || self.enemy.classname != "onslaught_controlpoint")) { return false; }
        if(SAME_TEAM(self, e)) { return false; }
 
        return true;
@@ -174,7 +174,7 @@ bool ons_CaptureShield_Customize()
 
 void ons_CaptureShield_Touch()
 {SELFPARAM();
-       if(!self.enemy.isshielded && (ons_ControlPoint_Attackable(self.enemy, other.team) > 0 || self.enemy.classname != "onslaught_controlpoint")) { return; }
+       if(!self.enemy.isshielded && (ons_ControlPoint_Attackable(self.enemy, TMID(other.team)) > 0 || self.enemy.classname != "onslaught_controlpoint")) { return; }
        if(!IS_PLAYER(other)) { return; }
        if(SAME_TEAM(other, self)) { return; }
 
@@ -243,7 +243,7 @@ void onslaught_updatelinks()
        for(l = ons_worldgeneratorlist; l; l = l.ons_worldgeneratornext)
        {
                if (l.iscaptured)
-                       LOG_DEBUG(strcat(etos(l), " (generator) belongs to team ", ftos(l.team), "\n"));
+                       LOG_DEBUG(strcat(etos(l), " (generator) belongs to team ", ftos(TMID(l.team)), "\n"));
                else
                        LOG_DEBUG(strcat(etos(l), " (generator) is destroyed\n"));
                l.islinked = l.iscaptured;
@@ -257,7 +257,7 @@ void onslaught_updatelinks()
                l.isshielded = true;
                int i;
                for(i = 0; i < 17; ++i) { l.isgenneighbor[i] = false; l.iscpneighbor[i] = false; }
-               LOG_DEBUG(strcat(etos(l), " (point) belongs to team ", ftos(l.team), "\n"));
+               LOG_DEBUG(strcat(etos(l), " (point) belongs to team ", ftos(TMID(l.team)), "\n"));
                l.sprite.SendFlags |= 16;
        }
        // flow power outward from the generators through the network
@@ -300,9 +300,9 @@ void onslaught_updatelinks()
                                l.enemy.isshielded = false;
                        }
                        if(l.goalentity.classname == "onslaught_generator")
-                               l.enemy.isgenneighbor[l.goalentity.team] = true;
+                               l.enemy.isgenneighbor[TMID(l.goalentity.team)] = true;
                        else
-                               l.enemy.iscpneighbor[l.goalentity.team] = true;
+                               l.enemy.iscpneighbor[TMID(l.goalentity.team)] = true;
                }
                if (l.enemy.islinked)
                {
@@ -312,9 +312,9 @@ void onslaught_updatelinks()
                                l.goalentity.isshielded = false;
                        }
                        if(l.enemy.classname == "onslaught_generator")
-                               l.goalentity.isgenneighbor[l.enemy.team] = true;
+                               l.goalentity.isgenneighbor[TMID(l.enemy.team)] = true;
                        else
-                               l.goalentity.iscpneighbor[l.enemy.team] = true;
+                               l.goalentity.iscpneighbor[TMID(l.enemy.team)] = true;
                }
        }
        // now update the generators
@@ -400,8 +400,8 @@ void ons_Link_CheckUpdate()
        // TODO check if the two sides have moved (currently they won't move anyway)
        float cc = 0, cc1 = 0, cc2 = 0;
 
-       if(self.goalentity.islinked || self.goalentity.iscaptured) { cc1 = (self.goalentity.team - 1) * 0x01; }
-       if(self.enemy.islinked || self.enemy.iscaptured) { cc2 = (self.enemy.team - 1) * 0x10; }
+       if(self.goalentity.islinked || self.goalentity.iscaptured) { cc1 = (TMID(self.goalentity.team) - 1) * 0x01; }
+       if(self.enemy.islinked || self.enemy.iscaptured) { cc2 = (TMID(self.enemy.team) - 1) * 0x10; }
 
        cc = cc1 + cc2;
 
@@ -458,7 +458,7 @@ int ons_ControlPoint_Attackable(entity cp, int teamnumber)
        else if(cp.goalentity)
        {
                // if there's already an icon built, nothing happens
-               if(cp.team == teamnumber)
+               if(TMID(cp.team) == teamnumber)
                {
                        a = ons_ControlPoint_CanBeLinked(cp, teamnumber);
                        if(a) // attackable by enemy?
@@ -506,10 +506,10 @@ void ons_ControlPoint_Icon_Damage(entity this, entity inflictor, entity attacker
        }
 
        if(IS_PLAYER(attacker))
-       if(time - ons_notification_time[this.team] > 10)
+       if(time - ons_notification_time[TMID(this.team)] > 10)
        {
                play2team(this.team, SND(ONS_CONTROLPOINT_UNDERATTACK));
-               ons_notification_time[this.team] = time;
+               ons_notification_time[TMID(this.team)] = time;
        }
 
        this.health = this.health - damage;
@@ -530,7 +530,7 @@ void ons_ControlPoint_Icon_Damage(entity this, entity inflictor, entity attacker
        {
                sound(this, CH_TRIGGER, SND_GRENADE_IMPACT, VOL_BASE, ATTEN_NORM);
                pointparticles(EFFECT_ROCKET_EXPLODE, this.origin, '0 0 0', 1);
-               Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_CPDESTROYED), this.owner.message, attacker.netname);
+               Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(TMID(this.team), INFO_ONSLAUGHT_CPDESTROYED), this.owner.message, attacker.netname);
 
                PlayerScore_Add(attacker, SP_ONS_TAKES, 1);
                PlayerScore_Add(attacker, SP_SCORE, 10);
@@ -538,7 +538,7 @@ void ons_ControlPoint_Icon_Damage(entity this, entity inflictor, entity attacker
                this.owner.goalentity = world;
                this.owner.islinked = false;
                this.owner.iscaptured = false;
-               this.owner.team = 0;
+               this.owner.__team = 0;
                this.owner.colormap = 1024;
 
                WaypointSprite_UpdateMaxHealth(this.owner.sprite, 0);
@@ -607,16 +607,16 @@ void ons_ControlPoint_Icon_Think()
        if(self.owner.islinked != self.owner.waslinked)
        {
                // unteam the spawnpoint if needed
-               int t = self.owner.team;
+               int t = TMID(self.owner.team);
                if(!self.owner.islinked)
-                       self.owner.team = 0;
+                       self.owner.__team = 0;
 
                setself(self.owner);
                activator = self;
                SUB_UseTargets ();
                setself(this);
 
-               self.owner.team = t;
+               self.owner.__team = t;
 
                self.owner.waslinked = self.owner.islinked;
        }
@@ -640,7 +640,7 @@ void ons_ControlPoint_Icon_BuildThink()
        self.nextthink = time + ONS_CP_THINKRATE;
 
        // only do this if there is power
-       a = ons_ControlPoint_CanBeLinked(self.owner, self.owner.team);
+       a = ons_ControlPoint_CanBeLinked(self.owner, TMID(self.owner.team));
        if(!a)
                return;
 
@@ -657,7 +657,7 @@ void ons_ControlPoint_Icon_BuildThink()
                self.owner.iscaptured = true;
                self.solid = SOLID_BBOX;
 
-               Send_Effect(EFFECT_CAP(self.owner.team), self.owner.origin, '0 0 0', 1);
+               Send_Effect(EFFECT_CAP(TMID(self.owner.team)), self.owner.origin, '0 0 0', 1);
 
                WaypointSprite_UpdateMaxHealth(self.owner.sprite, self.max_health);
                WaypointSprite_UpdateHealth(self.owner.sprite, self.health);
@@ -665,7 +665,7 @@ void ons_ControlPoint_Icon_BuildThink()
                if(IS_PLAYER(self.owner.ons_toucher))
                {
                        Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ONSLAUGHT_CAPTURE, self.owner.ons_toucher.netname, self.owner.message);
-                       Send_Notification(NOTIF_ALL_EXCEPT, self.owner.ons_toucher, MSG_CENTER, APP_TEAM_NUM(self.owner.ons_toucher.team, CENTER_ONS_CAPTURE), self.owner.message);
+                       Send_Notification(NOTIF_ALL_EXCEPT, self.owner.ons_toucher, MSG_CENTER, APP_TEAM_NUM(TMID(self.owner.ons_toucher.team), CENTER_ONS_CAPTURE), self.owner.message);
                        Send_Notification(NOTIF_ONE, self.owner.ons_toucher, MSG_CENTER, CENTER_ONS_CAPTURE, self.owner.message);
                        PlayerScore_Add(self.owner.ons_toucher, SP_ONS_CAPS, 1);
                        PlayerTeamScore_AddScore(self.owner.ons_toucher, 10);
@@ -707,7 +707,7 @@ void ons_ControlPoint_Icon_Spawn(entity cp, entity player)
        e.bot_attack = true;
        e.event_damage = ons_ControlPoint_Icon_Damage;
        e.team = player.team;
-       e.colormap = 1024 + (e.team - 1) * 17;
+       e.colormap = 1024 + (TMID(e.team) - 1) * 17;
        e.count = (e.max_health - e.health) * ONS_CP_THINKRATE / autocvar_g_onslaught_cp_buildtime; // how long it takes to build
 
        sound(e, CH_TRIGGER, SND_ONS_CONTROLPOINT_BUILD, VOL_BASE, ATTEN_NORM);
@@ -716,10 +716,10 @@ void ons_ControlPoint_Icon_Spawn(entity cp, entity player)
        cp.team = e.team;
        cp.colormap = e.colormap;
 
-       Send_Effect(EFFECT_FLAG_TOUCH(player.team), e.origin, '0 0 0', 1);
+       Send_Effect(EFFECT_FLAG_TOUCH(TMID(player.team)), e.origin, '0 0 0', 1);
 
        WaypointSprite_UpdateBuildFinished(cp.sprite, time + (e.max_health - e.health) / (e.count / ONS_CP_THINKRATE));
-       WaypointSprite_UpdateRule(cp.sprite,cp.team,SPRITERULE_TEAMPLAY);
+       WaypointSprite_UpdateRule(cp.sprite, TMID(cp.team), SPRITERULE_TEAMPLAY);
        cp.sprite.SendFlags |= 16;
 
        onslaught_controlpoint_icon_link(e, ons_ControlPoint_Icon_BuildThink);
@@ -729,7 +729,7 @@ entity ons_ControlPoint_Waypoint(entity e)
 {
        if(e.team)
        {
-               int a = ons_ControlPoint_Attackable(e, e.team);
+               int a = ons_ControlPoint_Attackable(e, TMID(e.team));
 
                if(a == -2) { return WP_OnsCPDefend; } // defend now
                if(a == -1 || a == 1 || a == 2) { return WP_OnsCP; } // touch
@@ -749,7 +749,7 @@ void ons_ControlPoint_UpdateSprite(entity e)
        bool sh;
        sh = !(ons_ControlPoint_CanBeLinked(e, NUM_TEAM_1) || ons_ControlPoint_CanBeLinked(e, NUM_TEAM_2) || ons_ControlPoint_CanBeLinked(e, NUM_TEAM_3) || ons_ControlPoint_CanBeLinked(e, NUM_TEAM_4));
 
-       if(e.lastteam != e.team + 2 || e.lastshielded != sh || e.iscaptured != e.lastcaptured)
+       if(e.lastteam != TMID(e.team) + 2 || e.lastshielded != sh || e.iscaptured != e.lastcaptured)
        {
                if(e.iscaptured) // don't mess up build bars!
                {
@@ -766,20 +766,20 @@ void ons_ControlPoint_UpdateSprite(entity e)
                if(e.lastshielded)
                {
                        if(e.team)
-                               WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, 0.5 * colormapPaletteColor(e.team - 1, false));
+                               WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, 0.5 * colormapPaletteColor(TMID(e.team) - 1, false));
                        else
                                WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, '0.5 0.5 0.5');
                }
                else
                {
                        if(e.team)
-                               WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, colormapPaletteColor(e.team - 1, false));
+                               WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, colormapPaletteColor(TMID(e.team) - 1, false));
                        else
                                WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, '0.75 0.75 0.75');
                }
                WaypointSprite_Ping(e.sprite);
 
-               e.lastteam = e.team + 2;
+               e.lastteam = TMID(e.team) + 2;
                e.lastshielded = sh;
                e.lastcaptured = e.iscaptured;
        }
@@ -809,7 +809,7 @@ void ons_ControlPoint_Touch()
                        Send_Notification(NOTIF_ONE, toucher, MSG_CENTER, CENTER_ONS_TELEPORT);
        }
 
-       attackable = ons_ControlPoint_Attackable(self, toucher.team);
+       attackable = ons_ControlPoint_Attackable(self, TMID(toucher.team));
        if(attackable != 2 && attackable != 4)
                return;
        // we've verified that this player has a legitimate claim to this point,
@@ -834,7 +834,7 @@ void ons_ControlPoint_Reset(entity this)
                remove(this.goalentity);
 
        this.goalentity = world;
-       this.team = 0;
+       this.__team = 0;
        this.colormap = 1024;
        this.iscaptured = false;
        this.islinked = false;
@@ -845,7 +845,7 @@ void ons_ControlPoint_Reset(entity this)
        setmodel_fixsize(this, MDL_ONS_CP_PAD1);
 
        WaypointSprite_UpdateMaxHealth(this.sprite, 0);
-       WaypointSprite_UpdateRule(this.sprite,this.team,SPRITERULE_TEAMPLAY);
+       WaypointSprite_UpdateRule(this.sprite, TMID(this.team), SPRITERULE_TEAMPLAY);
 
        onslaught_updatelinks();
 
@@ -875,7 +875,7 @@ void ons_ControlPoint_Setup(entity cp)
        ons_worldcplist = cp;
 
        cp.netname = "Control point";
-       cp.team = 0;
+       cp.__team = 0;
        cp.solid = SOLID_BBOX;
        cp.movetype = MOVETYPE_NONE;
        cp.touch = ons_ControlPoint_Touch;
@@ -909,7 +909,7 @@ void ons_ControlPoint_Setup(entity cp)
 
        // waypointsprites
        WaypointSprite_SpawnFixed(WP_Null, self.origin + CPGEN_WAYPOINT_OFFSET, self, sprite, RADARICON_NONE);
-       WaypointSprite_UpdateRule(self.sprite, self.team, SPRITERULE_TEAMPLAY);
+       WaypointSprite_UpdateRule(self.sprite, TMID(self.team), SPRITERULE_TEAMPLAY);
 
        InitializeEntity(cp, ons_DelayedControlPoint_Setup, INITPRIO_SETLOCATION);
 }
@@ -931,21 +931,21 @@ void ons_Generator_UpdateSprite(entity e)
        entity s1 = ons_Generator_Waypoint(e);
        WaypointSprite_UpdateSprites(e.sprite, s1, s1, s1);
 
-       if(e.lastteam != e.team + 2 || e.lastshielded != e.isshielded)
+       if(e.lastteam != TMID(e.team) + 2 || e.lastshielded != e.isshielded)
        {
-               e.lastteam = e.team + 2;
+               e.lastteam = TMID(e.team) + 2;
                e.lastshielded = e.isshielded;
                if(e.lastshielded)
                {
                        if(e.team)
-                               WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, 0.5 * colormapPaletteColor(e.team - 1, false));
+                               WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, 0.5 * colormapPaletteColor(TMID(e.team) - 1, false));
                        else
                                WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, '0.5 0.5 0.5');
                }
                else
                {
                        if(e.team)
-                               WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, colormapPaletteColor(e.team - 1, false));
+                               WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, colormapPaletteColor(TMID(e.team) - 1, false));
                        else
                                WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, '0.75 0.75 0.75');
                }
@@ -992,10 +992,10 @@ void ons_GeneratorDamage(entity this, entity inflictor, entity attacker, float d
        else
        {
                if (attacker == this)
-                       Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_GENDESTROYED_OVERTIME));
+                       Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(TMID(this.team), INFO_ONSLAUGHT_GENDESTROYED_OVERTIME));
                else
                {
-                       Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_GENDESTROYED));
+                       Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(TMID(this.team), INFO_ONSLAUGHT_GENDESTROYED));
                        PlayerScore_Add(attacker, SP_SCORE, 100);
                }
                this.iscaptured = false;
@@ -1050,7 +1050,7 @@ void ons_GeneratorThink()
                                        soundto(MSG_ONE, it, CHAN_AUTO, SND(KH_ALARM), VOL_BASE, ATTEN_NONE);    // FIXME: unique sound?
                                }
                                else
-                                       Send_Notification(NOTIF_ONE, it, MSG_CENTER, APP_TEAM_NUM(self.team, CENTER_ONS_NOTSHIELDED));
+                                       Send_Notification(NOTIF_ONE, it, MSG_CENTER, APP_TEAM_NUM(TMID(self.team), CENTER_ONS_NOTSHIELDED));
                        });
                }
        }
@@ -1058,7 +1058,7 @@ void ons_GeneratorThink()
 
 void ons_GeneratorReset(entity this)
 {
-       this.team = this.team_saved;
+       this.__team = this.team_saved;
        this.lasthealth = this.max_health = this.health = autocvar_g_onslaught_gen_health;
        this.takedamage = DAMAGE_AIM;
        this.bot_attack = true;
@@ -1076,7 +1076,7 @@ void ons_GeneratorReset(entity this)
 
        WaypointSprite_UpdateMaxHealth(this.sprite, this.max_health);
        WaypointSprite_UpdateHealth(this.sprite, this.health);
-       WaypointSprite_UpdateRule(this.sprite,this.team,SPRITERULE_TEAMPLAY);
+       WaypointSprite_UpdateRule(this.sprite, TMID(this.team), SPRITERULE_TEAMPLAY);
 
        onslaught_updatelinks();
 }
@@ -1110,7 +1110,7 @@ void onslaught_generator_touch()
 void ons_GeneratorSetup(entity gen) // called when spawning a generator entity on the map as a spawnfunc
 {SELFPARAM();
        // declarations
-       int teamnumber = gen.team;
+       int teamnumber = TMID(gen.team);
        setself(gen); // for later usage with droptofloor()
 
        // main setup
@@ -1146,7 +1146,7 @@ void ons_GeneratorSetup(entity gen) // called when spawning a generator entity o
 
        // waypointsprites
        WaypointSprite_SpawnFixed(WP_Null, self.origin + CPGEN_WAYPOINT_OFFSET, self, sprite, RADARICON_NONE);
-       WaypointSprite_UpdateRule(self.sprite, self.team, SPRITERULE_TEAMPLAY);
+       WaypointSprite_UpdateRule(self.sprite, TMID(self.team), SPRITERULE_TEAMPLAY);
        WaypointSprite_UpdateMaxHealth(self.sprite, self.max_health);
        WaypointSprite_UpdateHealth(self.sprite, self.health);
 
@@ -1166,10 +1166,10 @@ void Onslaught_count_generators()
        for(e = ons_worldgeneratorlist; e; e = e.ons_worldgeneratornext)
        {
                ++total_generators;
-               redowned += (e.team == NUM_TEAM_1 && e.health > 0);
-               blueowned += (e.team == NUM_TEAM_2 && e.health > 0);
-               yellowowned += (e.team == NUM_TEAM_3 && e.health > 0);
-               pinkowned += (e.team == NUM_TEAM_4 && e.health > 0);
+               redowned    += (TMID(e.team) == NUM_TEAM_1 && e.health > 0);
+               blueowned   += (TMID(e.team) == NUM_TEAM_2 && e.health > 0);
+               yellowowned += (TMID(e.team) == NUM_TEAM_3 && e.health > 0);
+               pinkowned   += (TMID(e.team) == NUM_TEAM_4 && e.health > 0);
        }
 }
 
@@ -1392,7 +1392,7 @@ void havocbot_goalrating_ons_controlpoints_attack(float ratingscale)
                        continue;
 
                // Ignore owned controlpoints
-               if(!(cp2.isgenneighbor[self.team] || cp2.iscpneighbor[self.team]))
+               if(!(cp2.isgenneighbor[TMID(self.team)] || cp2.iscpneighbor[TMID(self.team)]))
                        continue;
 
                // Count team mates interested in this control point
@@ -2023,7 +2023,7 @@ MUTATOR_HOOKFUNCTION(ons, GetTeamCount)
        // onslaught is special
        for(entity tmp_entity = ons_worldgeneratorlist; tmp_entity; tmp_entity = tmp_entity.ons_worldgeneratornext)
        {
-               switch(tmp_entity.team)
+               switch(TMID(tmp_entity.team))
                {
                        case NUM_TEAM_1: c1 = 0; break;
                        case NUM_TEAM_2: c2 = 0; break;
@@ -2137,7 +2137,7 @@ MUTATOR_HOOKFUNCTION(ons, SendWaypoint)
                        entity wp_owner = self.owner;
                        entity e = WaypointSprite_getviewentity(wp_sendto);
                        if(SAME_TEAM(e, wp_owner) && wp_owner.goalentity.health >= wp_owner.goalentity.max_health) { wp_flag |= 2; }
-                       if(!ons_ControlPoint_Attackable(wp_owner, e.team)) { wp_flag |= 2; }
+                       if(!ons_ControlPoint_Attackable(wp_owner, TMID(e.team))) { wp_flag |= 2; }
                }
                if(self.owner.classname == "onslaught_generator")
                {
index 4924287189f1809001f2d445f9c30acaab5505da..71831525074690520bae2c1e6f9033154ff67ec6 100644 (file)
@@ -15,13 +15,13 @@ bool cpicon_send(entity this, entity to, int sf)
                WriteByte(MSG_ENTITY, self.health);
                WriteByte(MSG_ENTITY, self.max_health);
                WriteByte(MSG_ENTITY, self.count);
-               WriteByte(MSG_ENTITY, self.team);
+               WriteByte(MSG_ENTITY, TMID(self.team));
                WriteByte(MSG_ENTITY, self.owner.iscaptured);
        }
 
        if(sf & CPSF_STATUS)
        {
-               WriteByte(MSG_ENTITY, self.team);
+               WriteByte(MSG_ENTITY, TMID(self.team));
 
                if(self.health <= 0)
                        WriteByte(MSG_ENTITY, 0);
index cf8d234a3a295c4c2dfb0ec4e91eccdfc6a21f23..79a36725f34248403fc8d6f0b8b082c9d6ff2cd3 100644 (file)
@@ -13,12 +13,12 @@ bool generator_send(entity this, entity to, int sf)
                WriteByte(MSG_ENTITY, self.health);
                WriteByte(MSG_ENTITY, self.max_health);
                WriteByte(MSG_ENTITY, self.count);
-               WriteByte(MSG_ENTITY, self.team);
+               WriteByte(MSG_ENTITY, TMID(self.team));
        }
 
        if(sf & GSF_STATUS)
        {
-               WriteByte(MSG_ENTITY, self.team);
+               WriteByte(MSG_ENTITY, TMID(self.team));
 
                if(self.health <= 0)
                        WriteByte(MSG_ENTITY, 0);
index 447e7730e205c9d2ecbff65f102886c41bca8118..1d3d21444bfe50fd77eda1706d0d1a5875b2e431 100644 (file)
@@ -603,7 +603,7 @@ string _MapInfo_GetDefaultEx(float t)
 
 float _MapInfo_GetTeamPlayBool(float t)
 {
-       FOREACH(Gametypes, it.items == t, return it.team);
+       FOREACH(Gametypes, it.items == t, return it.__team);
        return false;
 }
 
index ab7233ef269cd60db277aa23c81588a9260b83df..7ed9e534c8c0df33aea1877bd9c0925ca90dd5e1 100644 (file)
@@ -19,7 +19,7 @@ CLASS(Gametype, Object)
     /** human readable name */
     ATTRIB(Gametype, message, string, string_null)
     /** does this gametype support teamplay? */
-    ATTRIB(Gametype, team, bool, false)
+    ATTRIB(Gametype, __team, bool, false)
     /** game type defaults */
     ATTRIB(Gametype, model2, string, string_null)
     /** game type description */
@@ -40,7 +40,7 @@ CLASS(Gametype, Object)
         this.netname = g_name;
         this.mdl = sname;
         this.message = hname;
-        this.team = gteamplay;
+        this.__team = gteamplay;
         this.m_mutators = mutators;
         this.model2 = defaults;
         this.gametype_description = gdescription;
index 6f7e7c3ae9466cd83d0c4f45dc765efc8e2a9e0a..d408b5f0f983a967f84840a3c367341c63f5d8ee 100644 (file)
@@ -220,7 +220,7 @@ NET_HANDLE(ENT_CLIENT_MINIGAME, bool isnew)
                minigame_ent = self.owner;
 
                if ( sf & MINIG_SF_UPDATE )
-                       self.team = ReadByte();
+                       self.__team = ReadByte();
 
                if ( activate )
                {
index 74df391de2cc7091c518ebe7c39a9551c1f711af..dfed3dce8e93773838e0720b29b8b2009a2eb411 100644 (file)
@@ -99,8 +99,8 @@ that .owner is set to the minigame session entity and .minigame_autoclean is tru
  *     MSLE stands for Minigame Simple Linked Entity
  */
 #define MINIGAME_SIMPLELINKED_ENTITIES \
-       MSLE(minigame_board_piece,FIELD(MINIG_SF_CREATE,Byte,team) FIELD(MINIG_SF_UPDATE, Short, minigame_flags) FIELD(MINIG_SF_UPDATE, Vector2D,origin)) \
-       MSLE(pong_paddle,FIELD(MINIG_SF_CREATE,Byte,team) FIELD(MINIG_SF_CREATE,Float,pong_length) FIELD(MINIG_SF_UPDATE,Vector2D,origin)) \
-       MSLE(pong_ball,FIELD(MINIG_SF_CREATE,Float,pong_length) FIELD(PONG_SF_BALLTEAM,Byte,team) FIELD(MINIG_SF_UPDATE, Vector2D, velocity) FIELD(MINIG_SF_UPDATE, Vector2D, origin)) \
-       MSLE(pong_ai, FIELD(MINIG_SF_CREATE,Byte,team) FIELD(PONG_SF_PLAYERSCORE, Long, pong_score)) \
+       MSLE(minigame_board_piece,FIELD(MINIG_SF_CREATE,Byte,__team) FIELD(MINIG_SF_UPDATE, Short, minigame_flags) FIELD(MINIG_SF_UPDATE, Vector2D,origin)) \
+       MSLE(pong_paddle,FIELD(MINIG_SF_CREATE,Byte,__team) FIELD(MINIG_SF_CREATE,Float,pong_length) FIELD(MINIG_SF_UPDATE,Vector2D,origin)) \
+       MSLE(pong_ball,FIELD(MINIG_SF_CREATE,Float,pong_length) FIELD(PONG_SF_BALLTEAM,Byte,__team) FIELD(MINIG_SF_UPDATE, Vector2D, velocity) FIELD(MINIG_SF_UPDATE, Vector2D, origin)) \
+       MSLE(pong_ai, FIELD(MINIG_SF_CREATE,Byte,__team) FIELD(PONG_SF_PLAYERSCORE, Long, pong_score)) \
        /*empty line*/
index 84120e1b04ad100bd6d148ed9ee2a810205929b7..0f243b37574240e01e62061209d38bc6c81f2160 100644 (file)
@@ -255,7 +255,7 @@ void bd_editor_place(entity minigame, entity player, string pos, int thetile, st
                        }
 
                        entity piece = msle_spawn(minigame,"minigame_board_piece");
-                       piece.team = 1;
+                       piece.__team = 1;
                        piece.netname = strzone(pos);
                        piece.bd_tiletype = thetile;
                        piece.bd_dir = '0 -1 0';
@@ -467,7 +467,7 @@ entity bd_load_piece(entity minigame, string s)
        tokenize_console(bd_string);
 
        entity e = msle_spawn(minigame,"minigame_board_piece");
-       e.team = 1;
+       e.__team = 1;
        e.bd_dir = '0 -1 0';
 
        int argv_num = 0;
index 9b9d570855b490d8ac01d737cfb2114329656fe7..a99f9f98d1725b142d570e1533bb00a269a9b130 100644 (file)
@@ -157,7 +157,7 @@ void c4_move(entity minigame, entity player, string pos )
        pos = c4_get_lowest_tile(minigame, pos);
 
        if ( minigame.minigame_flags & C4_TURN_PLACE )
-       if ( pos && player.team == (minigame.minigame_flags & C4_TURN_TEAM) )
+       if ( pos && TMID(player.team) == (minigame.minigame_flags & C4_TURN_TEAM) )
        {
                if ( c4_valid_tile(pos) )
                if ( !c4_find_piece(minigame,pos) )
@@ -168,10 +168,10 @@ void c4_move(entity minigame, entity player, string pos )
                        minigame_server_sendflags(piece,MINIG_SF_ALL);
                        minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
                        minigame.c4_npieces++;
-                       minigame.c4_nexteam = minigame_next_team(player.team,C4_TEAMS);
+                       minigame.c4_nexteam = minigame_next_team(TMID(player.team),C4_TEAMS);
                        if ( c4_winning_piece(piece) )
                        {
-                               minigame.minigame_flags = C4_TURN_WIN | player.team;
+                               minigame.minigame_flags = C4_TURN_WIN | TMID(player.team);
                        }
                        else if ( minigame.c4_npieces >= C4_MAX_TILES )
                                minigame.minigame_flags = C4_TURN_DRAW;
@@ -214,7 +214,7 @@ int c4_server_event(entity minigame, string event, ...)
 
                        // Get the right team
                        if(minigame.minigame_players)
-                               return minigame_next_team(minigame.minigame_players.team, C4_TEAMS);
+                               return minigame_next_team(TMID(minigame.minigame_players.team), C4_TEAMS);
 
                        // Team 1 by default
                        return 1;
@@ -257,13 +257,13 @@ void c4_hud_board(vector pos, vector mySize)
        vector tile_size = minigame_hud_denormalize_size('1 1 0' / C4_TILE_SIZE,pos,mySize);
        vector tile_pos;
 
-       if ( (active_minigame.minigame_flags & C4_TURN_TEAM) == minigame_self.team )
+       if ( (active_minigame.minigame_flags & C4_TURN_TEAM) == TMID(minigame_self.team) )
        if ( c4_valid_tile(c4_curr_pos) )
        {
                tile_pos = minigame_tile_pos(c4_curr_pos,C4_NUM_CNT,C4_LET_CNT);
                tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
                minigame_drawpic_centered( tile_pos,
-                               minigame_texture(strcat("c4/piece",ftos(minigame_self.team))),
+                               minigame_texture(strcat("c4/piece",ftos(TMID(minigame_self.team)))),
                                tile_size, '1 1 1', panel_fg_alpha/2, DRAWFLAG_NORMAL );
        }
 
@@ -290,7 +290,7 @@ void c4_hud_board(vector pos, vector mySize)
                        }
 
                        minigame_drawpic_centered( tile_pos,
-                                       minigame_texture(strcat("c4/piece",ftos(e.team))),
+                                       minigame_texture(strcat("c4/piece",ftos(TMID(e.team)))),
                                        tile_size, '1 1 1'*icon_color, panel_fg_alpha, DRAWFLAG_NORMAL );
                }
        }
@@ -301,7 +301,7 @@ void c4_hud_board(vector pos, vector mySize)
                string playername = "";
                FOREACH_MINIGAME_ENTITY(e)
                        if ( e.classname == "minigame_player" &&
-                                       e.team == (active_minigame.minigame_flags & C4_TURN_TEAM) )
+                                       TMID(e.team) == (active_minigame.minigame_flags & C4_TURN_TEAM) )
                                playername = entcs_GetName(e.minigame_playerslot-1);
 
                vector win_pos = pos+eY*(mySize_y-winfs_y)/2;
@@ -349,7 +349,7 @@ void c4_hud_status(vector pos, vector mySize)
                if ( e.classname == "minigame_player" )
                {
                        mypos = pos;
-                       if ( e.team == 2 )
+                       if ( TMID(e.team) == 2 )
                                mypos_y  += player_fontsize_y + ts_y;
                        minigame_drawcolorcodedstring_trunc(mySize_x,mypos,
                                entcs_GetName(e.minigame_playerslot-1),
@@ -357,7 +357,7 @@ void c4_hud_status(vector pos, vector mySize)
 
                        mypos_y += player_fontsize_y;
                        drawpic( mypos,
-                                       minigame_texture(strcat("c4/piece",ftos(e.team))),
+                                       minigame_texture(strcat("c4/piece",ftos(TMID(e.team)))),
                                        tile_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
 
                        mypos_x += tile_size_x;
@@ -373,12 +373,12 @@ string c4_turn_to_string(int turnflags)
 
        if ( turnflags & C4_TURN_WIN )
        {
-               if ( (turnflags&C4_TURN_TEAM) != minigame_self.team )
+               if ( (turnflags&C4_TURN_TEAM) != TMID(minigame_self.team) )
                        return _("You lost the game!");
                return _("You win!");
        }
 
-       if ( (turnflags & C4_TURN_TEAM) != minigame_self.team )
+       if ( (turnflags & C4_TURN_TEAM) != TMID(minigame_self.team) )
                return _("Wait for your opponent to make their move");
 
        if ( turnflags & C4_TURN_PLACE )
@@ -390,7 +390,7 @@ string c4_turn_to_string(int turnflags)
 // Make the correct move
 void c4_make_move(entity minigame)
 {
-       if ( minigame.minigame_flags == (C4_TURN_PLACE|minigame_self.team) )
+       if ( minigame.minigame_flags == (C4_TURN_PLACE|TMID(minigame_self.team)) )
        {
                minigame_cmd("move ",c4_curr_pos);
        }
@@ -418,7 +418,7 @@ int c4_client_event(entity minigame, string event, ...)
                }
                case "key_pressed":
                {
-                       if((minigame.minigame_flags & C4_TURN_TEAM) == minigame_self.team)
+                       if((minigame.minigame_flags & C4_TURN_TEAM) == TMID(minigame_self.team))
                        {
                                switch ( ...(0,int) )
                                {
@@ -473,7 +473,7 @@ int c4_client_event(entity minigame, string event, ...)
                case "mouse_moved":
                {
                        vector mouse_pos = minigame_hud_normalize(mousepos,c4_boardpos,c4_boardsize);
-                       if ( minigame.minigame_flags == (C4_TURN_PLACE|minigame_self.team) )
+                       if ( minigame.minigame_flags == (C4_TURN_PLACE|TMID(minigame_self.team)) )
                        {
                                c4_set_curr_pos(c4_get_lowest_tile(minigame, minigame_tile_name(mouse_pos,C4_NUM_CNT,C4_LET_CNT)));
                        }
@@ -491,7 +491,7 @@ int c4_client_event(entity minigame, string event, ...)
                                if ( sf & MINIG_SF_UPDATE )
                                {
                                        sent.message = c4_turn_to_string(sent.minigame_flags);
-                                       if ( sent.minigame_flags & minigame_self.team )
+                                       if ( sent.minigame_flags & TMID(minigame_self.team) )
                                                minigame_prompt();
                                }
                        }
index e4e0dc6380d9aec56a1b05601a8f5d733fe1b9c5..dec04df798b2a6b15cec6ed0a49ebbf418486e61 100644 (file)
@@ -83,7 +83,7 @@ void nmm_spawn_tile(string id, entity minig, int distance)
        e.origin = minigame_tile_pos(id,7,7);
        e.netname = id;
        e.owner = minig;
-       e.team = 0;
+       e.__team = 0;
        e.nmm_tile_distance = distance;
        e.nmm_tile_hmill = strzone(nmm_tile_build_hmill(e));
        e.nmm_tile_vmill = strzone(nmm_tile_build_vmill(e));
@@ -196,7 +196,7 @@ entity nmm_find_piece(entity start, entity minigame, int teamn, int pieceflags)
        entity e = start;
        while ( ( e = findentity(e,owner,minigame) ) )
                if ( e.classname == "minigame_board_piece" &&
-                               (e.minigame_flags & pieceflags) && e.team == teamn )
+                               (e.minigame_flags & pieceflags) && TMID(e.team) == teamn )
                        return e;
        return world;
 }
@@ -222,10 +222,10 @@ int nmm_server_event(entity minigame, string event, ...)
                for ( int i = 0; i < 7; i++ )
                {
                        e = msle_spawn(minigame,"minigame_board_piece");
-                       e.team = 1;
+                       e.__team = 1;
                        e.minigame_flags = NMM_PIECE_HOME;
                        e = msle_spawn(minigame,"minigame_board_piece");
-                       e.team = 2;
+                       e.__team = 2;
                        e.minigame_flags = NMM_PIECE_HOME;
                }
 
@@ -243,7 +243,7 @@ int nmm_server_event(entity minigame, string event, ...)
                        n++;
                if ( n >= 2 )
                        return 0;
-               if ( minigame.minigame_players && minigame.minigame_players.team == 1 )
+               if ( minigame.minigame_players && TMID(minigame.minigame_players.team) == 1 )
                        return 2;
                return 1;
        }
@@ -256,7 +256,7 @@ int nmm_server_event(entity minigame, string event, ...)
                bool move_ok = false;
 
                if ( e && argc >= 2 && argv(0) == "move" &&
-                       ( minigame.minigame_flags & NMM_TURN_TEAM ) == e.team )
+                       ( minigame.minigame_flags & NMM_TURN_TEAM ) == TMID(e.team) )
                {
                        tile = nmm_find_tile(minigame,argv(1));
                        if ( !tile )
@@ -265,7 +265,7 @@ int nmm_server_event(entity minigame, string event, ...)
                        }
                        else if ( minigame.minigame_flags & NMM_TURN_PLACE )
                        {
-                               piece = nmm_find_piece(world,minigame,e.team,NMM_PIECE_HOME);
+                               piece = nmm_find_piece(world,minigame,TMID(e.team),NMM_PIECE_HOME);
                                if ( !tile.nmm_tile_piece && piece )
                                {
                                        tile.nmm_tile_piece = piece;
@@ -323,24 +323,24 @@ int nmm_server_event(entity minigame, string event, ...)
                                }
                        }
 
-                       int nextteam = e.team % 2 + 1;
+                       int nextteam = TMID(e.team) % 2 + 1;
                        int npieces = nmm_count_pieces(minigame,nextteam,NMM_PIECE_HOME|NMM_PIECE_BOARD);
 
                        if ( npieces < 3 )
                        {
-                               minigame.minigame_flags = NMM_TURN_WIN | e.team;
+                               minigame.minigame_flags = NMM_TURN_WIN | TMID(e.team);
                                minigame.SendFlags |= MINIG_SF_UPDATE;
                        }
                        else if ( move_ok)
                        {
                                if ( !(minigame.minigame_flags & NMM_TURN_TAKE) && nmm_in_mill(tile) )
                                {
-                                       minigame.minigame_flags = NMM_TURN_TAKE|e.team;
+                                       minigame.minigame_flags = NMM_TURN_TAKE|TMID(e.team);
                                        int takemill = NMM_TURN_TAKEANY;
                                        entity f = world;
                                        while ( ( f = findentity(f,owner,minigame) ) )
                                                if ( f.classname == "minigame_nmm_tile" && f.nmm_tile_piece  &&
-                                                               f.nmm_tile_piece.team == nextteam && !nmm_in_mill(f) )
+                                                               TMID(f.nmm_tile_piece.team) == nextteam && !nmm_in_mill(f) )
                                                {
                                                        takemill = 0;
                                                        break;
@@ -355,11 +355,11 @@ int nmm_server_event(entity minigame, string event, ...)
                                                minigame.minigame_flags = NMM_TURN_FLY|nextteam;
                                        else
                                        {
-                                               minigame.minigame_flags = NMM_TURN_WIN|e.team;
+                                               minigame.minigame_flags = NMM_TURN_WIN|TMID(e.team);
                                                entity f = world;
                                                while ( ( f = findentity(f,owner,minigame) ) )
                                                        if ( f.classname == "minigame_nmm_tile" && f.nmm_tile_piece  &&
-                                                               f.nmm_tile_piece.team == nextteam && nmm_tile_canmove(f) )
+                                                               TMID(f.nmm_tile_piece.team) == nextteam && nmm_tile_canmove(f) )
                                                        {
                                                                minigame.minigame_flags = NMM_TURN_MOVE|nextteam;
                                                                break;
@@ -387,7 +387,7 @@ vector nmm_boardsize;
 // whether the given tile is a valid selection
 bool nmm_valid_selection(entity tile)
 {
-       if ( ( tile.owner.minigame_flags & NMM_TURN_TEAM ) != minigame_self.team )
+       if ( ( tile.owner.minigame_flags & NMM_TURN_TEAM ) != TMID(minigame_self.team) )
                return false; // not our turn
        if ( tile.owner.minigame_flags & NMM_TURN_PLACE )
                return !tile.nmm_tile_piece; // need to put a piece on an empty spot
@@ -416,7 +416,7 @@ bool nmm_valid_selection(entity tile)
 // whether it should highlight valid tile selections
 bool nmm_draw_avaliable(entity tile)
 {
-       if ( ( tile.owner.minigame_flags & NMM_TURN_TEAM ) != minigame_self.team )
+       if ( ( tile.owner.minigame_flags & NMM_TURN_TEAM ) != TMID(minigame_self.team) )
                return false;
        if ( (tile.owner.minigame_flags & NMM_TURN_TAKE) )
                return true;
@@ -462,7 +462,7 @@ void nmm_hud_board(vector pos, vector mySize)
                        if ( e.nmm_tile_piece )
                        {
                                minigame_drawpic_centered( tile_pos,
-                                       minigame_texture(strcat("nmm/piece",ftos(e.nmm_tile_piece.team))),
+                                       minigame_texture(strcat("nmm/piece",ftos(TMID(e.nmm_tile_piece.team)))),
                                        tile_size*0.8, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
                        }
 
@@ -476,7 +476,7 @@ void nmm_hud_board(vector pos, vector mySize)
                string playername = "";
                FOREACH_MINIGAME_ENTITY(e)
                        if ( e.classname == "minigame_player" &&
-                                       e.team == (active_minigame.minigame_flags & NMM_TURN_TEAM) )
+                                       TMID(e.team) == (active_minigame.minigame_flags & NMM_TURN_TEAM) )
                                playername = entcs_GetName(e.minigame_playerslot-1);
 
                vector win_pos = pos+eY*(mySize_y-winfs_y)/2;
@@ -528,7 +528,7 @@ void nmm_hud_status(vector pos, vector mySize)
                if ( e.classname == "minigame_player" )
                {
                        mypos = pos;
-                       if ( e.team == 2 )
+                       if ( TMID(e.team) == 2 )
                                mypos_y  += player_fontsize_y + ts_y;
                        minigame_drawcolorcodedstring_trunc(mySize_x,mypos,
                                entcs_GetName(e.minigame_playerslot-1),
@@ -538,7 +538,7 @@ void nmm_hud_status(vector pos, vector mySize)
                {
                        mypos = pos;
                        mypos_y += player_fontsize_y;
-                       if ( e.team == 2 )
+                       if ( TMID(e.team) == 2 )
                        {
                                mypos_x += player2x;
                                player2x += piece_space;
@@ -556,7 +556,7 @@ void nmm_hud_status(vector pos, vector mySize)
                        else
                                piece_light = 0.15;
 
-                       drawpic(mypos, minigame_texture(strcat("nmm/piece",ftos(e.team))), piece_sz,
+                       drawpic(mypos, minigame_texture(strcat("nmm/piece",ftos(TMID(e.team)))), piece_sz,
                                '1 1 1'*piece_light, panel_fg_alpha, DRAWFLAG_NORMAL );
                }
        }
@@ -597,12 +597,12 @@ string nmm_turn_to_string(int turnflags)
 {
        if ( turnflags & NMM_TURN_WIN )
        {
-               if ( (turnflags&NMM_TURN_TEAM) != minigame_self.team )
+               if ( (turnflags&NMM_TURN_TEAM) != TMID(minigame_self.team) )
                        return _("You lost the game!");
                return _("You win!");
        }
 
-       if ( (turnflags&NMM_TURN_TEAM) != minigame_self.team )
+       if ( (turnflags&NMM_TURN_TEAM) != TMID(minigame_self.team) )
                return _("Wait for your opponent to make their move");
        if ( turnflags & NMM_TURN_PLACE )
                return _("Click on the game board to place your piece");
@@ -630,7 +630,7 @@ int nmm_client_event(entity minigame, string event, ...)
                nmm_fromtile = world;
                nmm_kill_tiles(minigame);
        }
-       else if ( event == "key_pressed" && (minigame.minigame_flags&NMM_TURN_TEAM) == minigame_self.team )
+       else if ( event == "key_pressed" && (minigame.minigame_flags&NMM_TURN_TEAM) == TMID(minigame_self.team) )
        {
                switch ( ...(0,int) )
                {
@@ -749,7 +749,7 @@ int nmm_client_event(entity minigame, string event, ...)
                else if ( self.classname == "minigame" && ( ...(1,int) & MINIG_SF_UPDATE ) )
                {
                        self.message = nmm_turn_to_string(self.minigame_flags);
-                       if ( self.minigame_flags & minigame_self.team )
+                       if ( self.minigame_flags & TMID(minigame_self.team) )
                                minigame_prompt();
                }
        }
index 87c75f48c59ab05ac3b9ce01d4c628ccb66a3580..335523bd1c8d812289355ffc6133673a0204bdf4 100644 (file)
@@ -49,7 +49,7 @@ void pong_ball_throw(entity ball)
        ball.velocity_y = sin(angle)*autocvar_sv_minigames_pong_ball_speed;
        ball.think = pong_ball_think;
        ball.nextthink = time;
-       ball.team = 0;
+       ball.__team = 0;
        ball.SendFlags |= MINIG_SF_UPDATE|PONG_SF_BALLTEAM;
 }
 
@@ -65,7 +65,7 @@ void pong_ball_reset(entity ball)
        ball.velocity = '0 0 0';
        ball.origin = '0.5 0.5 0';
        ball.think = SUB_NullThink;
-       ball.team = 0;
+       ball.__team = 0;
        ball.SendFlags |= MINIG_SF_UPDATE|PONG_SF_BALLTEAM;
        ball.think = pong_ball_throwthink;
        ball.nextthink = time + autocvar_sv_minigames_pong_ball_wait;
@@ -136,7 +136,7 @@ bool pong_goal(entity ball, int pteam)
 
        if ( !pong_paddle_hit(ball, pteam) )
        {
-               pong_add_score(ball.owner ,ball.team, pteam, 1);
+               pong_add_score(ball.owner ,TMID(ball.team), pteam, 1);
                pong_ball_reset(ball);
                return true;
        }
@@ -159,7 +159,7 @@ void pong_ball_think()
                if ( pong_paddle_hit(self, i) )
                {
                        pong_paddle_bounce(self,i);
-                       self.team = i;
+                       self.__team = i;
                        self.SendFlags |= PONG_SF_BALLTEAM;
                        return;
                }
@@ -227,7 +227,7 @@ void pong_ai_think()
        float self_pos;
 
 
-       if ( self.team <= 2 )
+       if ( TMID(self.team) <= 2 )
        {
                if ( ball )
                        target = ball.origin_y + ball.velocity_y*think_speed;
@@ -280,7 +280,7 @@ void pong_paddle_think()
                if ( self.realowner.minigame_players.pong_keys == PONG_KEY_DECREASE )
                        movement *= -1;
 
-               if ( self.team > 2 )
+               if ( TMID(self.team) > 2 )
                        self.origin_x = bound(halflen, self.origin_x+movement, 1-halflen);
                else
                        self.origin_y = bound(halflen, self.origin_y+movement, 1-halflen);
@@ -317,7 +317,7 @@ entity pong_paddle_spawn(entity minigame, int pl_team, entity real_player)
        paddle.origin = pong_team_to_paddlepos(pl_team);
        paddle.think = pong_paddle_think;
        paddle.nextthink = time;
-       paddle.team = pl_team;
+       paddle.__team = pl_team;
        paddle.mins = pong_team_to_box_halfsize(pl_team,-paddle.pong_length,-1/16);
        paddle.maxs = pong_team_to_box_halfsize(pl_team,paddle.pong_length,1/16);
 
@@ -519,7 +519,7 @@ void pong_hud_board(vector pos, vector mySize)
                                        obj_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
 
                        minigame_drawpic_centered( obj_pos, minigame_texture("pong/ball-glow"),
-                                       obj_size, pong_team_to_color(e.team),
+                                       obj_size, pong_team_to_color(TMID(e.team)),
                                        panel_fg_alpha, DRAWFLAG_ADDITIVE );
                }
                else if ( e.classname == "pong_paddle" )
@@ -527,11 +527,11 @@ void pong_hud_board(vector pos, vector mySize)
                        obj_pos = minigame_hud_denormalize(e.origin,pos,mySize);
                        obj_size = minigame_hud_denormalize_size(eX / 16 + eY*e.pong_length,pos,mySize);
 
-                       drawrotpic(obj_pos, pong_team_to_angle(e.team), minigame_texture("pong/paddle-glow"),
-                               obj_size, obj_size/2, pong_team_to_color(e.team),
+                       drawrotpic(obj_pos, pong_team_to_angle(TMID(e.team)), minigame_texture("pong/paddle-glow"),
+                               obj_size, obj_size/2, pong_team_to_color(TMID(e.team)),
                                panel_fg_alpha, DRAWFLAG_ADDITIVE );
 
-                       drawrotpic(obj_pos, pong_team_to_angle(e.team), minigame_texture("pong/paddle"),
+                       drawrotpic(obj_pos, pong_team_to_angle(TMID(e.team)), minigame_texture("pong/paddle"),
                                obj_size, obj_size/2, '1 1 1',
                                panel_fg_alpha, DRAWFLAG_NORMAL );
 
@@ -561,9 +561,9 @@ void pong_hud_status(vector pos, vector mySize)
                if ( e.classname == "minigame_player" || e.classname == "pong_ai" )
                {
                        mypos = pos;
-                       mypos_y  += (e.team-1) * (player_fontsize_y + ts_y);
+                       mypos_y  += (TMID(e.team)-1) * (player_fontsize_y + ts_y);
 
-                       drawfill(mypos, ts, pong_team_to_color(e.team), 0.25, DRAWFLAG_ADDITIVE);
+                       drawfill(mypos, ts, pong_team_to_color(TMID(e.team)), 0.25, DRAWFLAG_ADDITIVE);
 
                        minigame_drawcolorcodedstring_trunc(mySize_x,mypos,
                                (e.minigame_playerslot ? entcs_GetName(e.minigame_playerslot-1) : _("AI")),
@@ -573,7 +573,7 @@ void pong_hud_status(vector pos, vector mySize)
                                           '0.7 0.84 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 
                        if ( e == minigame_self )
-                               drawborderlines(1, mypos, ts, pong_team_to_color(e.team), 1, DRAWFLAG_NORMAL);
+                               drawborderlines(1, mypos, ts, pong_team_to_color(TMID(e.team)), 1, DRAWFLAG_NORMAL);
                }
        }
 }
index a66a839677d9ceed95f9e62bdeaea3d72ddf5c34..f7980d3fe6eb73ccbdce66a7ab1ceaff1ada32ca 100644 (file)
@@ -53,14 +53,14 @@ bool pp_winning_piece(entity piece)
        int letter = minigame_tile_letter(piece.netname);
 
        // here goes
-       if(!pp_valid_tile(minigame_tile_buildname(letter-1,number)) || pp_find_piece(piece.owner,minigame_tile_buildname(letter-1,number)).team == 5)
-       if(!pp_valid_tile(minigame_tile_buildname(letter+1,number)) || pp_find_piece(piece.owner,minigame_tile_buildname(letter+1,number)).team == 5)
-       if(!pp_valid_tile(minigame_tile_buildname(letter,number-1)) || pp_find_piece(piece.owner,minigame_tile_buildname(letter,number-1)).team == 5)
-       if(!pp_valid_tile(minigame_tile_buildname(letter,number+1)) || pp_find_piece(piece.owner,minigame_tile_buildname(letter,number+1)).team == 5)
-       if(!pp_valid_tile(minigame_tile_buildname(letter+1,number+1)) || pp_find_piece(piece.owner,minigame_tile_buildname(letter+1,number+1)).team == 5)
-       if(!pp_valid_tile(minigame_tile_buildname(letter-1,number-1)) || pp_find_piece(piece.owner,minigame_tile_buildname(letter-1,number-1)).team == 5)
-       if(!pp_valid_tile(minigame_tile_buildname(letter+1,number-1)) || pp_find_piece(piece.owner,minigame_tile_buildname(letter+1,number-1)).team == 5)
-       if(!pp_valid_tile(minigame_tile_buildname(letter-1,number+1)) || pp_find_piece(piece.owner,minigame_tile_buildname(letter-1,number+1)).team == 5)
+       if(!pp_valid_tile(minigame_tile_buildname(letter-1,number  )) || TMID(pp_find_piece(piece.owner,minigame_tile_buildname(letter-1,number  )).team) == 5)
+       if(!pp_valid_tile(minigame_tile_buildname(letter+1,number  )) || TMID(pp_find_piece(piece.owner,minigame_tile_buildname(letter+1,number  )).team) == 5)
+       if(!pp_valid_tile(minigame_tile_buildname(letter  ,number-1)) || TMID(pp_find_piece(piece.owner,minigame_tile_buildname(letter,  number-1)).team) == 5)
+       if(!pp_valid_tile(minigame_tile_buildname(letter  ,number+1)) || TMID(pp_find_piece(piece.owner,minigame_tile_buildname(letter,  number+1)).team) == 5)
+       if(!pp_valid_tile(minigame_tile_buildname(letter+1,number+1)) || TMID(pp_find_piece(piece.owner,minigame_tile_buildname(letter+1,number+1)).team) == 5)
+       if(!pp_valid_tile(minigame_tile_buildname(letter-1,number-1)) || TMID(pp_find_piece(piece.owner,minigame_tile_buildname(letter-1,number-1)).team) == 5)
+       if(!pp_valid_tile(minigame_tile_buildname(letter+1,number-1)) || TMID(pp_find_piece(piece.owner,minigame_tile_buildname(letter+1,number-1)).team) == 5)
+       if(!pp_valid_tile(minigame_tile_buildname(letter-1,number+1)) || TMID(pp_find_piece(piece.owner,minigame_tile_buildname(letter-1,number+1)).team) == 5)
                return true;
 
        return false;
@@ -70,7 +70,7 @@ bool pp_valid_move(entity minigame, string pos)
 {
        if(!pp_valid_tile(pos))
                return false;
-       if(pp_find_piece(minigame,pos).team == 5)
+       if(TMID(pp_find_piece(minigame,pos).team) == 5)
                return false;
 
        entity current = minigame.pp_curr_piece;
@@ -97,24 +97,24 @@ bool pp_valid_move(entity minigame, string pos)
 void pp_move(entity minigame, entity player, string pos )
 {
        if ( minigame.minigame_flags & PP_TURN_PLACE )
-       if ( pos && player.team == (minigame.minigame_flags & PP_TURN_TEAM) )
+       if ( pos && TMID(player.team) == (minigame.minigame_flags & PP_TURN_TEAM) )
        {
                if ( pp_valid_move(minigame,pos))
                {
                        entity existing = pp_find_piece(minigame,pos);
 
-                       if(existing && existing.team != 5)
+                       if(existing && TMID(existing.team) != 5)
                        {
-                               if(existing.team == 1)
+                               if(TMID(existing.team) == 1)
                                        minigame.pp_team1_score++;
-                               if(existing.team == 2)
+                               if(TMID(existing.team) == 2)
                                        minigame.pp_team2_score++;
                        }
 
                        if(minigame.pp_curr_piece)
                        {
                                minigame.pp_curr_piece.cnt = 0;
-                               minigame.pp_curr_piece.team = 5;
+                               minigame.pp_curr_piece.__team = 5;
                                minigame_server_sendflags(minigame.pp_curr_piece,MINIG_SF_ALL);
                        }
 
@@ -130,7 +130,7 @@ void pp_move(entity minigame, entity player, string pos )
                        piece.netname = strzone(pos);
                        minigame_server_sendflags(piece,MINIG_SF_ALL);
                        minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
-                       minigame.pp_nexteam = minigame_next_team(player.team,2);
+                       minigame.pp_nexteam = minigame_next_team(TMID(player.team),2);
                        minigame.pp_curr_piece = piece;
                        if ( pp_winning_piece(piece) )
                        {
@@ -157,7 +157,7 @@ void pp_setup_pieces(entity minigame)
                if(t1_true || t2_true)
                {
                        entity piece = msle_spawn(minigame,"minigame_board_piece");
-                       piece.team = ((t1_true) ? 1 : 2);
+                       piece.__team = ((t1_true) ? 1 : 2);
                        piece.netname = strzone(minigame_tile_buildname(i,t));
                        minigame_server_sendflags(piece,MINIG_SF_ALL);
                        minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
@@ -174,11 +174,11 @@ void pp_next_match(entity minigame, entity player)
        // on multiplayer matches, wait for both players to agree
        if ( minigame.minigame_flags & (PP_TURN_WIN|PP_TURN_DRAW) )
        {
-               minigame.minigame_flags = PP_TURN_NEXT | player.team;
+               minigame.minigame_flags = PP_TURN_NEXT | TMID(player.team);
                minigame.SendFlags |= MINIG_SF_UPDATE;
        }
        else if ( (minigame.minigame_flags & PP_TURN_NEXT) &&
-                       !( minigame.minigame_flags & player.team ) )
+                       !( minigame.minigame_flags & TMID(player.team) ) )
 #endif
        {
                minigame.minigame_flags = PP_TURN_PLACE | minigame.pp_nexteam;
@@ -228,7 +228,7 @@ int pp_server_event(entity minigame, string event, ...)
 
                        // Get the right team
                        if(minigame.minigame_players)
-                               return minigame_next_team(minigame.minigame_players.team, 2);
+                               return minigame_next_team(TMID(minigame.minigame_players.team), 2);
 
                        // Team 1 by default
                        return 1;
@@ -303,15 +303,15 @@ void pp_hud_board(vector pos, vector mySize)
                        tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
 
                        vector tile_color = '1 1 1';
-                       switch(e.team)
+                       switch(TMID(e.team))
                        {
                                case 1: tile_color = '1 0.3 0.3'; break;
                                case 2: tile_color = '0.3 0.3 1'; break;
                                // 3, 4 coming later?
                        }
 
-                       string tile_name = strcat("pp/piece",ftos(e.team));
-                       if(e.team == 5) { tile_name = "pp/piece_taken"; }
+                       string tile_name = strcat("pp/piece",ftos(TMID(e.team)));
+                       if(TMID(e.team) == 5) { tile_name = "pp/piece_taken"; }
 
                        if(e == active_minigame.pp_curr_piece)
                        {
@@ -329,7 +329,7 @@ void pp_hud_board(vector pos, vector mySize)
                }
        }
 
-       if ( (active_minigame.minigame_flags & PP_TURN_TEAM) == minigame_self.team )
+       if ( (active_minigame.minigame_flags & PP_TURN_TEAM) == TMID(minigame_self.team) )
        if ( pp_valid_move(active_minigame, pp_curr_pos) )
        {
                tile_pos = minigame_tile_pos(pp_curr_pos,PP_LET_CNT,PP_NUM_CNT);
@@ -353,7 +353,7 @@ void pp_hud_board(vector pos, vector mySize)
                string playername = "";
                FOREACH_MINIGAME_ENTITY(e)
                        if ( e.classname == "minigame_player" &&
-                                       e.team == (active_minigame.minigame_flags & PP_TURN_TEAM) )
+                                       TMID(e.team) == (active_minigame.minigame_flags & PP_TURN_TEAM) )
                                playername = entcs_GetName(e.minigame_playerslot-1);
 
                vector win_pos = pos+eY*(mySize_y-winfs_y)/2;
@@ -401,7 +401,7 @@ void pp_hud_status(vector pos, vector mySize)
                if ( e.classname == "minigame_player" )
                {
                        vector tile_color = '1 1 1';
-                       switch(e.team)
+                       switch(TMID(e.team))
                        {
                                case 1: tile_color = '1 0.3 0.3'; break;
                                case 2: tile_color = '0.3 0.3 1'; break;
@@ -409,7 +409,7 @@ void pp_hud_status(vector pos, vector mySize)
                        }
 
                        mypos = pos;
-                       if ( e.team == 2 )
+                       if ( TMID(e.team) == 2 )
                                mypos_y  += player_fontsize_y + ts_y;
                        minigame_drawcolorcodedstring_trunc(mySize_x,mypos,
                                entcs_GetName(e.minigame_playerslot-1),
@@ -417,13 +417,13 @@ void pp_hud_status(vector pos, vector mySize)
 
                        mypos_y += player_fontsize_y;
                        drawpic( mypos,
-                                       minigame_texture(strcat("pp/piece",ftos(e.team))),
+                                       minigame_texture(strcat("pp/piece",ftos(TMID(e.team)))),
                                        tile_size, tile_color, panel_fg_alpha, DRAWFLAG_NORMAL );
 
                        mypos_x += tile_size_x;
                        int myscore = 0;
-                       if(e.team == 1) { myscore = active_minigame.pp_team1_score; }
-                       if(e.team == 2) { myscore = active_minigame.pp_team2_score; }
+                       if(TMID(e.team) == 1) { myscore = active_minigame.pp_team1_score; }
+                       if(TMID(e.team) == 2) { myscore = active_minigame.pp_team2_score; }
 
                        drawstring(mypos,ftos(myscore),tile_size,
                                           '0.7 0.84 1', panel_fg_alpha, DRAWFLAG_NORMAL);
@@ -439,19 +439,19 @@ string pp_turn_to_string(int turnflags)
 
        if ( turnflags & PP_TURN_WIN )
        {
-               if ( (turnflags&PP_TURN_TEAM) != minigame_self.team )
+               if ( (turnflags&PP_TURN_TEAM) != TMID(minigame_self.team) )
                        return _("You lost the game!\nSelect \"^1Next Match^7\" on the menu for a rematch!");
                return _("You win!\nSelect \"^1Next Match^7\" on the menu to start a new match!");
        }
 
        if ( turnflags & PP_TURN_NEXT )
        {
-               if ( (turnflags&PP_TURN_TEAM) != minigame_self.team )
+               if ( (turnflags&PP_TURN_TEAM) != TMID(minigame_self.team) )
                        return _("Select \"^1Next Match^7\" on the menu to start a new match!");
                return _("Wait for your opponent to confirm the rematch");
        }
 
-       if ( (turnflags & PP_TURN_TEAM) != minigame_self.team )
+       if ( (turnflags & PP_TURN_TEAM) != TMID(minigame_self.team) )
                return _("Wait for your opponent to make their move");
 
        if ( turnflags & PP_TURN_PLACE )
@@ -463,7 +463,7 @@ string pp_turn_to_string(int turnflags)
 // Make the correct move
 void pp_make_move(entity minigame)
 {
-       if ( minigame.minigame_flags == (PP_TURN_PLACE|minigame_self.team) )
+       if ( minigame.minigame_flags == (PP_TURN_PLACE|TMID(minigame_self.team)) )
        {
                minigame_cmd("move ",pp_curr_pos);
        }
@@ -491,7 +491,7 @@ int pp_client_event(entity minigame, string event, ...)
                }
                case "key_pressed":
                {
-                       if((minigame.minigame_flags & PP_TURN_TEAM) == minigame_self.team)
+                       if((minigame.minigame_flags & PP_TURN_TEAM) == TMID(minigame_self.team))
                        {
                                switch ( ...(0,int) )
                                {
@@ -546,7 +546,7 @@ int pp_client_event(entity minigame, string event, ...)
                case "mouse_moved":
                {
                        vector mouse_pos = minigame_hud_normalize(mousepos,pp_boardpos,pp_boardsize);
-                       if ( minigame.minigame_flags == (PP_TURN_PLACE|minigame_self.team) )
+                       if ( minigame.minigame_flags == (PP_TURN_PLACE|TMID(minigame_self.team)) )
                                pp_set_curr_pos(minigame_tile_name(mouse_pos,PP_LET_CNT,PP_NUM_CNT));
                        if ( ! pp_valid_tile(pp_curr_pos) )
                                pp_set_curr_pos("");
@@ -562,7 +562,7 @@ int pp_client_event(entity minigame, string event, ...)
                                if ( sf & MINIG_SF_UPDATE )
                                {
                                        sent.message = pp_turn_to_string(sent.minigame_flags);
-                                       if ( sent.minigame_flags & minigame_self.team )
+                                       if ( sent.minigame_flags & TMID(minigame_self.team) )
                                                minigame_prompt();
                                        sent.pp_team1_score = ReadByte();
                                        sent.pp_team2_score = ReadByte();
index 4eb0009b9db2ae5383906e7772270a85cc1258bf..d39a74b1daa99b14cf1abf3b3ee71853b33f63f7 100644 (file)
@@ -120,7 +120,7 @@ void ps_setup_pieces(entity minigame)
                if(i == floor(PS_NUM_CNT * 0.5) && t == floor(PS_LET_CNT * 0.5))
                        continue; // middle piece is empty
                entity piece = msle_spawn(minigame,"minigame_board_piece");
-               piece.team = 1; // init default team?
+               piece.__team = 1; // init default team?
                piece.netname = strzone(minigame_tile_buildname(t,i));
                minigame_server_sendflags(piece,MINIG_SF_ALL);
        }
@@ -607,7 +607,7 @@ int ps_client_event(entity minigame, string event, ...)
                                if ( sf & MINIG_SF_UPDATE )
                                {
                                        sent.message = ps_turn_to_string(sent.minigame_flags);
-                                       if ( sent.minigame_flags & minigame_self.team )
+                                       if ( sent.minigame_flags & TMID(minigame_self.team) )
                                                minigame_prompt();
                                }
                        }
index 33868ad5702cbd9fa5633784e4fd01361a5f1a4d..56db93ae7a4d25cec9b619848a95197d36640f0b 100644 (file)
@@ -61,7 +61,7 @@ entity snake_find_cnt(entity minig, int steam, int tile)
 {
        entity e = world;
        while ( ( e = findentity(e,owner,minig) ) )
-               if ( e.classname == "minigame_board_piece" && e.cnt == tile && e.team == steam )
+               if ( e.classname == "minigame_board_piece" && e.cnt == tile && TMID(e.team) == steam )
                        return e;
        return world;
 }
@@ -80,7 +80,7 @@ entity snake_find_head(entity minig, int steam)
 {
        entity e = world;
        while ( ( e = findentity(e,owner,minig) ) )
-               if ( e.classname == "minigame_board_piece" && e.cnt == 1 && e.team == steam )
+               if ( e.classname == "minigame_board_piece" && e.cnt == 1 && TMID(e.team) == steam )
                        return e;
        return world;
 }
@@ -98,7 +98,7 @@ void snake_new_mouse(entity minigame)
        }
 
        entity piece = msle_spawn(minigame,"minigame_board_piece");
-       piece.team = 0;
+       piece.__team = 0;
        piece.netname = strzone(RandomSelection_chosen_string);
        minigame_server_sendflags(piece,MINIG_SF_ALL);
 
@@ -178,7 +178,7 @@ void minigame_setup_snake(entity minigame, int pteam)
        }
 
        entity piece = msle_spawn(minigame,"minigame_board_piece");
-       piece.team = pteam;
+       piece.__team = pteam;
        piece.netname = strzone(RandomSelection_chosen_string);
        piece.cnt = 1;
        piece.snake_next = world;
@@ -207,7 +207,7 @@ entity snake_get_player(entity minigame, int pteam)
        while( (e = findentity(e,owner,minigame)) )
                if ( e.classname == "minigame_player" )
 #endif
-       if(e.team == pteam)
+       if(TMID(e.team) == pteam)
                return e;
        return world;
 }
@@ -248,7 +248,7 @@ void snake_move_body(entity minigame, entity head, bool ate_mouse)
 
                int newcnt = tail.cnt + 1;
                head.snake_delay = max(autocvar_sv_minigames_snake_delay_min, autocvar_sv_minigames_snake_delay_initial - (newcnt / autocvar_sv_minigames_snake_delay_multiplier));
-               snake_add_score(minigame, head.team, 1);
+               snake_add_score(minigame, TMID(head.team), 1);
 
                entity piece = msle_spawn(minigame,"minigame_board_piece");
                piece.cnt = newcnt;
@@ -284,7 +284,7 @@ void snake_eat_team(entity minigame, int pteam)
 
        entity e = world;
        while ( ( e = findentity(e,owner,minigame) ) )
-               if ( e.classname == "minigame_board_piece" && e.cnt && e.team == pteam )
+               if ( e.classname == "minigame_board_piece" && e.cnt && TMID(e.team) == pteam )
                {
                        if(e.netname) { strunzone(e.netname); }
                        remove(e);
@@ -328,8 +328,8 @@ void snake_move_head(entity minigame, entity head)
                }
                else
                {
-                       snake_add_score(minigame, head.team, -1);
-                       snake_eat_team(minigame, head.team);
+                       snake_add_score(minigame, TMID(head.team), -1);
+                       snake_eat_team(minigame, TMID(head.team));
                }
 
                return;
@@ -347,8 +347,8 @@ void snake_move_head(entity minigame, entity head)
        // above check makes sure it's not our team
        if(hit.cnt)
        {
-               snake_eat_team(minigame, hit.team);
-               snake_add_score(minigame, head.team, 1);
+               snake_eat_team(minigame, TMID(hit.team));
+               snake_add_score(minigame, TMID(head.team), 1);
        }
 
        if(ate_mouse)
@@ -369,7 +369,7 @@ void snake_move(entity minigame, entity player, string dxs, string dys )
                //if ( snake_valid_tile(pos) )
                //if ( snake_find_piece(minigame, pos) )
                {
-                       entity head = snake_find_head(minigame, player.team);
+                       entity head = snake_find_head(minigame, TMID(player.team));
                        if(!head)
                                return; // their head is already dead
 
@@ -497,7 +497,7 @@ int snake_server_event(entity minigame, string event, ...)
                        else if ( sent.classname == "minigame_player" && (sf & SNAKE_SF_PLAYERSCORE ) )
                        {
                                WriteLong(MSG_ENTITY,sent.snake_score);
-                               WriteByte(MSG_ENTITY,max(0, minigame.snake_lives[sent.team]));
+                               WriteByte(MSG_ENTITY,max(0, minigame.snake_lives[TMID(sent.team)]));
                        }
                        else if ( sent.classname == "minigame" && (sf & MINIG_SF_UPDATE ) )
                        {
@@ -553,7 +553,7 @@ void snake_hud_board(vector pos, vector mySize)
                        tile_pos = minigame_tile_pos(e.netname,SNAKE_NUM_CNT,SNAKE_LET_CNT);
                        tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
 
-                       vector tile_color = snake_teamcolor(e.team);
+                       vector tile_color = snake_teamcolor(TMID(e.team));
 
                        string thepiece = "snake/mouse";
                        if(e.cnt)
@@ -599,7 +599,7 @@ void snake_hud_board(vector pos, vector mySize)
                                {
                                        int thex = minigame_tile_letter(e.netname);
                                        int they = minigame_tile_number(e.netname);
-                                       entity t = snake_find_cnt(active_minigame, e.team, e.cnt - 1);
+                                       entity t = snake_find_cnt(active_minigame, TMID(e.team), e.cnt - 1);
                                        int tx = minigame_tile_letter(t.netname);
                                        int ty = minigame_tile_number(t.netname);
 
@@ -640,7 +640,7 @@ void snake_hud_board(vector pos, vector mySize)
                }
        }
 
-       if ( (active_minigame.minigame_flags & SNAKE_TURN_LOSS) || (active_minigame.minigame_flags & SNAKE_TURN_WIN) || (active_minigame.snake_lives[minigame_self.team] <= 0) )
+       if ( (active_minigame.minigame_flags & SNAKE_TURN_LOSS) || (active_minigame.minigame_flags & SNAKE_TURN_WIN) || (active_minigame.snake_lives[TMID(minigame_self.team)] <= 0) )
        {
                int scores = minigame_self.snake_score;
 
@@ -650,9 +650,9 @@ void snake_hud_board(vector pos, vector mySize)
                scores_text = strcat("Score: ", ftos(scores));
 
                if(active_minigame.minigame_flags & SNAKE_TURN_WIN)
-               if((active_minigame.minigame_flags & SNAKE_TURN_TEAM) == minigame_self.team)
+               if((active_minigame.minigame_flags & SNAKE_TURN_TEAM) == TMID(minigame_self.team))
                        victory_text = "You win!";
-               if(active_minigame.snake_lives[minigame_self.team] <= 0)
+               if(active_minigame.snake_lives[TMID(minigame_self.team)] <= 0)
                        victory_text = "You ran out of lives!";
 
                vector win_pos = pos+eY*(mySize_y-winfs_y)/2;
@@ -692,9 +692,9 @@ void snake_hud_status(vector pos, vector mySize)
                if ( e.classname == "minigame_player" )
                {
                        mypos = pos;
-                       mypos_y  += (e.team-1) * (player_fontsize_y + ts_y);
+                       mypos_y  += (TMID(e.team)-1) * (player_fontsize_y + ts_y);
 
-                       drawfill(mypos, ts, snake_teamcolor(e.team), 0.25, DRAWFLAG_ADDITIVE);
+                       drawfill(mypos, ts, snake_teamcolor(TMID(e.team)), 0.25, DRAWFLAG_ADDITIVE);
 
                        minigame_drawcolorcodedstring_trunc(mySize_x,mypos,
                                entcs_GetName(e.minigame_playerslot-1),
@@ -702,11 +702,11 @@ void snake_hud_status(vector pos, vector mySize)
 
                        drawstring(mypos+eY*player_fontsize_y,ftos(e.snake_score),'48 48 0' * (SNAKE_TEAMS * 0.1),
                                           '0.7 0.84 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                       drawstring(mypos+(eY*player_fontsize_y) + (eX*player_fontsize_x),strcat("1UP: ", ftos(active_minigame.snake_lives[e.team])),'48 48 0' * (SNAKE_TEAMS * 0.1),
+                       drawstring(mypos+(eY*player_fontsize_y) + (eX*player_fontsize_x),strcat("1UP: ", ftos(active_minigame.snake_lives[TMID(e.team)])),'48 48 0' * (SNAKE_TEAMS * 0.1),
                                                         '1 0.44 0.54', panel_fg_alpha, DRAWFLAG_NORMAL);
 
                        if ( e == minigame_self )
-                               drawborderlines(1, mypos, ts, snake_teamcolor(e.team), 1, DRAWFLAG_NORMAL);
+                               drawborderlines(1, mypos, ts, snake_teamcolor(TMID(e.team)), 1, DRAWFLAG_NORMAL);
                }
        }
 }
@@ -719,15 +719,15 @@ string snake_turn_to_string(int turnflags)
 
        if ( turnflags & SNAKE_TURN_WIN )
        {
-               if ( (turnflags&SNAKE_TURN_TEAM) != minigame_self.team )
+               if ( (turnflags&SNAKE_TURN_TEAM) != TMID(minigame_self.team) )
                        return _("You ran out of lives!");
                return _("You win!");
        }
 
-       if(active_minigame.snake_lives[minigame_self.team] <= 0)
+       if(active_minigame.snake_lives[TMID(minigame_self.team)] <= 0)
                return _("You ran out of lives!");
 
-       if ( (snake_find_head(active_minigame, minigame_self.team)).snake_dir == '0 0 0' )
+       if ( (snake_find_head(active_minigame, TMID(minigame_self.team))).snake_dir == '0 0 0' )
                return _("Press an arrow key to begin the game");
 
        if ( turnflags & SNAKE_TURN_MOVE )
@@ -825,7 +825,7 @@ int snake_client_event(entity minigame, string event, ...)
                        else if ( sent.classname == "minigame_player" && (sf & SNAKE_SF_PLAYERSCORE ) )
                        {
                                sent.snake_score = ReadLong();
-                               minigame.snake_lives[sent.team] = ReadByte();
+                               minigame.snake_lives[TMID(sent.team)] = ReadByte();
                        }
 
                        return false;
index cd9565abd54ce2bf401b9459f33afa4ad4a25dd3..f6fef78673beda76d3b64d9b519a6f1cfac015c7 100644 (file)
@@ -77,7 +77,7 @@ bool ttt_valid_tile(string tile)
 void ttt_move(entity minigame, entity player, string pos )
 {
        if ( minigame.minigame_flags & TTT_TURN_PLACE )
-       if ( pos && player.team == (minigame.minigame_flags & TTT_TURN_TEAM) )
+       if ( pos && TMID(player.team) == (minigame.minigame_flags & TTT_TURN_TEAM) )
        {
                if ( ttt_valid_tile(pos) )
                if ( !ttt_find_piece(minigame,pos) )
@@ -86,14 +86,14 @@ void ttt_move(entity minigame, entity player, string pos )
                        piece.team = player.team;
                        piece.netname = strzone(pos);
                        minigame_server_sendflags(piece,MINIG_SF_ALL);
-                       minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
+                       minigame_server_sendflags(minigame, MINIG_SF_UPDATE);
                        minigame.ttt_npieces++;
-                       minigame.ttt_nexteam = minigame_next_team(player.team,2);
+                       minigame.ttt_nexteam = minigame_next_team(TMID(player.team), 2);
                        if ( ttt_winning_piece(piece) )
                        {
                                player.minigame_flags++;
                                minigame_server_sendflags(player, TTT_SF_PLAYERSCORE);
-                               minigame.minigame_flags = TTT_TURN_WIN | player.team;
+                               minigame.minigame_flags = TTT_TURN_WIN | TMID(player.team);
                        }
                        else if ( minigame.ttt_npieces >= (TTT_LET_CNT * TTT_NUM_CNT) )
                                minigame.minigame_flags = TTT_TURN_DRAW;
@@ -110,11 +110,11 @@ void ttt_next_match(entity minigame, entity player)
        // on multiplayer matches, wait for both players to agree
        if ( minigame.minigame_flags & (TTT_TURN_WIN|TTT_TURN_DRAW) )
        {
-               minigame.minigame_flags = TTT_TURN_NEXT | player.team;
+               minigame.minigame_flags = TTT_TURN_NEXT | TMID(player.team);
                minigame.SendFlags |= MINIG_SF_UPDATE;
        }
        else if ( (minigame.minigame_flags & TTT_TURN_NEXT) &&
-                       !( minigame.minigame_flags & player.team ) )
+                       !( minigame.minigame_flags & TMID(player.team) ) )
 #endif
        {
                minigame.minigame_flags = TTT_TURN_PLACE | minigame.ttt_nexteam;
@@ -164,7 +164,7 @@ int ttt_server_event(entity minigame, string event, ...)
 
                        // Get the right team
                        if(minigame.minigame_players)
-                               return minigame_next_team(minigame.minigame_players.team, 2);
+                               return minigame_next_team(TMID(minigame.minigame_players.team), 2);
 
                        // Team 1 by default
                        return 1;
@@ -182,7 +182,7 @@ int ttt_server_event(entity minigame, string event, ...)
                                case "singleplayer":
                                        if ( minigame_count_players(minigame) == 1 )
                                        {
-                                               minigame.ttt_ai = minigame_next_team(minigame.minigame_players.team, 2);
+                                               minigame.ttt_ai = minigame_next_team(TMID(minigame.minigame_players.team), 2);
                                                minigame.SendFlags = TTT_SF_SINGLEPLAYER;
                                        }
                                        return true;
@@ -229,13 +229,13 @@ void ttt_hud_board(vector pos, vector mySize)
        vector tile_size = minigame_hud_denormalize_size('1 1 0'/TTT_TILE_SIZE,pos,mySize);
        vector tile_pos;
 
-       if ( (active_minigame.minigame_flags & TTT_TURN_TEAM) == minigame_self.team )
+       if ( (active_minigame.minigame_flags & TTT_TURN_TEAM) == TMID(minigame_self.team) )
        if ( ttt_valid_tile(ttt_curr_pos) )
        {
                tile_pos = minigame_tile_pos(ttt_curr_pos,TTT_LET_CNT,TTT_NUM_CNT);
                tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
                minigame_drawpic_centered( tile_pos,
-                               minigame_texture(strcat("ttt/piece",ftos(minigame_self.team))),
+                               minigame_texture(strcat("ttt/piece",ftos(TMID(minigame_self.team)))),
                                tile_size, '1 1 1', panel_fg_alpha/2, DRAWFLAG_NORMAL );
        }
 
@@ -262,7 +262,7 @@ void ttt_hud_board(vector pos, vector mySize)
                        }
 
                        minigame_drawpic_centered( tile_pos,
-                                       minigame_texture(strcat("ttt/piece",ftos(e.team))),
+                                       minigame_texture(strcat("ttt/piece",ftos(TMID(e.team)))),
                                        tile_size, '1 1 1'*icon_color, panel_fg_alpha, DRAWFLAG_NORMAL );
                }
        }
@@ -292,7 +292,7 @@ void ttt_hud_status(vector pos, vector mySize)
                if ( e.classname == "minigame_player" )
                {
                        mypos = pos;
-                       if ( e.team == 2 )
+                       if ( TMID(e.team) == 2 )
                                mypos_y  += player_fontsize_y + ts_y;
                        minigame_drawcolorcodedstring_trunc(mySize_x,mypos,
                                (e.minigame_playerslot ? entcs_GetName(e.minigame_playerslot-1) : _("AI")),
@@ -300,7 +300,7 @@ void ttt_hud_status(vector pos, vector mySize)
 
                        mypos_y += player_fontsize_y;
                        drawpic( mypos,
-                                       minigame_texture(strcat("ttt/piece",ftos(e.team))),
+                                       minigame_texture(strcat("ttt/piece",ftos(TMID(e.team)))),
                                        tile_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
 
                        mypos_x += tile_size_x;
@@ -319,19 +319,19 @@ string ttt_turn_to_string(int turnflags)
 
        if ( turnflags & TTT_TURN_WIN )
        {
-               if ( (turnflags&TTT_TURN_TEAM) != minigame_self.team )
+               if ( (turnflags&TTT_TURN_TEAM) != TMID(minigame_self.team) )
                        return _("You lost the game!\nSelect \"^1Next Match^7\" on the menu for a rematch!");
                return _("You win!\nSelect \"^1Next Match^7\" on the menu to start a new match!");
        }
 
        if ( turnflags & TTT_TURN_NEXT )
        {
-               if ( (turnflags&TTT_TURN_TEAM) != minigame_self.team )
+               if ( (turnflags&TTT_TURN_TEAM) != TMID(minigame_self.team) )
                        return _("Select \"^1Next Match^7\" on the menu to start a new match!");
                return _("Wait for your opponent to confirm the rematch");
        }
 
-       if ( (turnflags & TTT_TURN_TEAM) != minigame_self.team )
+       if ( (turnflags & TTT_TURN_TEAM) != TMID(minigame_self.team) )
                return _("Wait for your opponent to make their move");
 
        if ( turnflags & TTT_TURN_PLACE )
@@ -525,7 +525,7 @@ void ttt_aimove(entity minigame)
 // Make the correct move
 void ttt_make_move(entity minigame)
 {
-       if ( minigame.minigame_flags == (TTT_TURN_PLACE|minigame_self.team) )
+       if ( minigame.minigame_flags == (TTT_TURN_PLACE|TMID(minigame_self.team)) )
        {
                if ( minigame.ttt_ai  )
                {
@@ -559,7 +559,7 @@ int ttt_client_event(entity minigame, string event, ...)
                }
                case "key_pressed":
                {
-                       if((minigame.minigame_flags & TTT_TURN_TEAM) == minigame_self.team)
+                       if((minigame.minigame_flags & TTT_TURN_TEAM) == TMID(minigame_self.team))
                        {
                                switch ( ...(0,int) )
                                {
@@ -614,7 +614,7 @@ int ttt_client_event(entity minigame, string event, ...)
                case "mouse_moved":
                {
                        vector mouse_pos = minigame_hud_normalize(mousepos,ttt_boardpos,ttt_boardsize);
-                       if ( minigame.minigame_flags == (TTT_TURN_PLACE|minigame_self.team) )
+                       if ( minigame.minigame_flags == (TTT_TURN_PLACE|TMID(minigame_self.team)) )
                                ttt_set_curr_pos(minigame_tile_name(mouse_pos,TTT_LET_CNT,TTT_NUM_CNT));
                        if ( ! ttt_valid_tile(ttt_curr_pos) )
                                ttt_set_curr_pos("");
@@ -630,7 +630,7 @@ int ttt_client_event(entity minigame, string event, ...)
                                if ( sf & MINIG_SF_UPDATE )
                                {
                                        sent.message = ttt_turn_to_string(sent.minigame_flags);
-                                       if ( sent.minigame_flags & minigame_self.team )
+                                       if ( sent.minigame_flags & TMID(minigame_self.team) )
                                                minigame_prompt();
                                }
 
@@ -644,7 +644,7 @@ int ttt_client_event(entity minigame, string event, ...)
                                        {
                                                entity aiplayer = new(minigame_player);
                                                aiplayer.owner = minigame;
-                                               aiplayer.team = ai;
+                                               aiplayer.__team = ai;
                                                aiplayer.minigame_playerslot = 0;
                                                aiplayer.minigame_autoclean = 1;
                                                ttt_aimove(minigame);
index 7c19c43dd6f4f2d037ac56dc7c0aa9ee54d601bb..a4a496400302c8d85b4fa057968d31f647693f39 100644 (file)
@@ -89,7 +89,7 @@ bool minigame_SendEntity(entity this, entity to, int sf)
                        WriteLong(MSG_ENTITY,etof(self.minigame_players));
                }
                if ( sf & MINIG_SF_UPDATE )
-                       WriteByte(MSG_ENTITY,self.team);
+                       WriteByte(MSG_ENTITY, TMID(self.team));
        }
        MINIGAME_SIMPLELINKED_ENTITIES
 
@@ -136,7 +136,7 @@ int minigame_addplayer(entity minigame_session, entity player)
        {
                player_pointer.owner = minigame_session;
                player_pointer.minigame_players = player;
-               player_pointer.team = mgteam;
+               player_pointer.__team = mgteam;
                player_pointer.list_next = minigame_session.minigame_players;
                minigame_session.minigame_players = player_pointer;
                player.active_minigame = minigame_session;
index 8f1d8027617fd7443794b47b41fac7ddbd6cce0c..0cc3760186db25a281cb9af97414f2f09aefcac5 100644 (file)
@@ -155,7 +155,7 @@ void monster_setupcolors(entity mon)
        if(IS_PLAYER(mon.realowner))
                mon.colormap = mon.realowner.colormap;
        else if(teamplay && mon.team)
-               mon.colormap = 1024 + (mon.team - 1) * 17;
+               mon.colormap = 1024 + (TMID(mon.team) - 1) * 17;
        else
        {
                if(mon.monster_skill <= MONSTER_SKILL_EASY)
@@ -177,7 +177,7 @@ void monster_changeteam(entity ent, float newteam)
 {
        if(!teamplay) { return; }
 
-       ent.team = newteam;
+       ent.__team = newteam;
        ent.monster_attack = true; // new team, activate attacking
        monster_setupcolors(ent);
 
@@ -185,7 +185,7 @@ void monster_changeteam(entity ent, float newteam)
        {
                WaypointSprite_UpdateTeamRadar(ent.sprite, RADARICON_DANGER, ((newteam) ? Team_ColorRGB(newteam) : '1 0 0'));
 
-               ent.sprite.team = newteam;
+               ent.sprite.__team = newteam;
                ent.sprite.SendFlags |= 1;
        }
 }
@@ -1275,9 +1275,9 @@ bool Monster_Spawn_Setup(entity this)
 
        if(autocvar_g_monsters_healthbars)
        {
-               entity wp = WaypointSprite_Spawn(WP_Monster, 0, 1024, this, '0 0 1' * (this.maxs.z + 15), world, this.team, this, sprite, true, RADARICON_DANGER);
+               entity wp = WaypointSprite_Spawn(WP_Monster, 0, 1024, this, '0 0 1' * (this.maxs.z + 15), world, TMID(this.team), this, sprite, true, RADARICON_DANGER);
                wp.wp_extra = this.monsterid;
-               wp.colormod = ((this.team) ? Team_ColorRGB(this.team) : '1 0 0');
+               wp.colormod = ((TMID(this.team)) ? Team_ColorRGB(TMID(this.team)) : '1 0 0');
                if(!(this.spawnflags & MONSTERFLAG_INVINCIBLE))
                {
                        WaypointSprite_UpdateMaxHealth(this.sprite, this.max_health);
@@ -1313,7 +1313,7 @@ bool Monster_Spawn(entity this, int mon_id)
        if(this.monster_skill == MONSTER_SKILL_HARD) if(this.spawnflags & MONSTERSKILL_NOTHARD) { Monster_Remove(this); return false; }
 
        if(this.team && !teamplay)
-               this.team = 0;
+               this.__team = 0;
 
        if(!(this.spawnflags & MONSTERFLAG_SPAWNED)) // naturally spawned monster
        if(!(this.spawnflags & MONSTERFLAG_RESPAWNED)) // don't count re-spawning monsters either
index b45cb0621d87b85918358ada79411cf54905fdac..b05aa3ae70e35c8f84567533ded3de829e86f02b 100644 (file)
@@ -45,7 +45,7 @@ ENDCLASS(Buff)
        void buff_Init_Compat(entity ent, entity replacement);
        #define BUFF_SPAWNFUNC(e, b, t) spawnfunc(item_buff_##e) { \
                self.buffs = b.m_itemid; \
-               self.team = t; \
+               self.__team = t; \
                buff_Init(self); \
        }
        #define BUFF_SPAWNFUNCS(e, b)                       \
index 30e19f0f5429ae82bc7c3864f041c575973eaeea..f18fc5439f10b052c72369d6c2a75815aa72c0f0 100644 (file)
@@ -169,7 +169,7 @@ float buff_Waypoint_visible_for_player(entity plr)
 void buff_Waypoint_Spawn(entity e)
 {
        entity buff = buff_FirstFromFlags(e.buffs);
-       entity wp = WaypointSprite_Spawn(WP_Buff, 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, world, e.team, e, buff_waypoint, true, RADARICON_Buff);
+       entity wp = WaypointSprite_Spawn(WP_Buff, 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, world, TMID(e.team), e, buff_waypoint, true, RADARICON_Buff);
        wp.wp_extra = buff.m_id;
        WaypointSprite_UpdateTeamRadar(e.buff_waypoint, RADARICON_Buff, e.glowmod);
        e.buff_waypoint.waypointsprite_visible_for_player = buff_Waypoint_visible_for_player;
@@ -412,7 +412,7 @@ void buff_Init(entity ent)
 {SELFPARAM();
        if(!cvar("g_buffs")) { remove(ent); return; }
 
-       if(!teamplay && ent.team) { ent.team = 0; }
+       if(!teamplay && ent.team) { ent.__team = 0; }
 
        entity buff = buff_FirstFromFlags(self.buffs);
 
@@ -459,9 +459,9 @@ void buff_Init(entity ent)
 void buff_Init_Compat(entity ent, entity replacement)
 {
        if (ent.spawnflags & 2)
-               ent.team = NUM_TEAM_1;
+               ent.__team = NUM_TEAM_1;
        else if (ent.spawnflags & 4)
-               ent.team = NUM_TEAM_2;
+               ent.__team = NUM_TEAM_2;
 
        ent.buffs = replacement.m_itemid;
 
index 16a435dd17339875072602fff898b02a58128f68..e52ad32c9ddc9e61b2a13cc2a1620552507220ea 100644 (file)
@@ -53,7 +53,7 @@ MUTATOR_HOOKFUNCTION(cl_nades, Ent_Projectile)
        if (Nade_FromProjectile(self.cnt) != NADE_TYPE_Null)
        {
                setmodel(self, MDL_PROJECTILE_NADE);
-               entity trail = Nade_TrailEffect(self.cnt, self.team);
+               entity trail = Nade_TrailEffect(self.cnt, TMID(self.team));
                if (trail.eent_eff_name) self.traileffect = trail.m_id;
                return true;
        }
@@ -374,7 +374,7 @@ void nade_ice_think()
        {
                if ( autocvar_g_nades_ice_explode )
                {
-                       entity expef = EFFECT_NADE_EXPLODE(self.realowner.team);
+                       entity expef = EFFECT_NADE_EXPLODE(TMID(self.realowner.team));
                        Send_Effect(expef, self.origin + '0 0 1', '0 0 0', 1);
                        sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
 
@@ -616,7 +616,7 @@ void nade_boom()
                case NADE_TYPE_MONSTER:
                case NADE_TYPE_SPAWN:
                        nade_blast = false;
-                       switch(self.realowner.team)
+                       switch(TMID(self.realowner.team))
                        {
                                case NUM_TEAM_1: expef = EFFECT_SPAWN_RED; break;
                                case NUM_TEAM_2: expef = EFFECT_SPAWN_BLUE; break;
@@ -632,7 +632,7 @@ void nade_boom()
 
                default:
                case NADE_TYPE_NORMAL:
-                       expef = EFFECT_NADE_EXPLODE(self.realowner.team);
+                       expef = EFFECT_NADE_EXPLODE(TMID(self.realowner.team));
                        break;
        }
 
@@ -941,7 +941,7 @@ float nade_customize()
        {
                //self.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
                if(!self.traileffectnum)
-                       self.traileffectnum = _particleeffectnum(Nade_TrailEffect(Nades_from(self.nade_type).m_projectile[false], self.team).eent_eff_name);
+                       self.traileffectnum = _particleeffectnum(Nade_TrailEffect(Nades_from(self.nade_type).m_projectile[false], TMID(self.team)).eent_eff_name);
                self.alpha = 1;
        }
 
@@ -959,7 +959,7 @@ void spawn_held_nade(entity player, entity nowner, float ntime, int ntype, strin
        //setattachment(n, player, "bip01 l hand");
        n.exteriormodeltoclient = player;
        n.customizeentityforclient = nade_customize;
-       n.traileffectnum = _particleeffectnum(Nade_TrailEffect(Nades_from(n.nade_type).m_projectile[false], player.team).eent_eff_name);
+       n.traileffectnum = _particleeffectnum(Nade_TrailEffect(Nades_from(n.nade_type).m_projectile[false], TMID(player.team)).eent_eff_name);
        n.colormod = Nades_from(n.nade_type).m_color;
        n.realowner = nowner;
        n.colormap = player.colormap;
index 23348f39de912359df2e8b5f080310ff1532be7d..16ec85c6f25d24d35bcede0f40f15947d28aa800 100644 (file)
@@ -55,7 +55,7 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn)
        int num_red = 0, num_blue = 0, num_yellow = 0, num_pink = 0;
        FOREACH_CLIENT(IS_PLAYER(it),
        {
-               switch(it.team)
+               switch(TMID(it.team))
                {
                        case NUM_TEAM_1: ++num_red; break;
                        case NUM_TEAM_2: ++num_blue; break;
index 1fb8fda3b09db8952ec0d7e1e9516a89f719dd5b..6a6e6257dd5607fc121f106cd512ea79fed4d23a 100644 (file)
@@ -52,7 +52,7 @@ bool WaypointSprite_SendEntity(entity this, entity to, float sendflags)
 
     if (sendflags & 1)
     {
-        WriteByte(MSG_ENTITY, self.team);
+        WriteByte(MSG_ENTITY, TMID(self.team));
         WriteByte(MSG_ENTITY, self.rule);
     }
 
@@ -161,7 +161,7 @@ void Ent_WaypointSprite(entity this)
 
     if (sendflags & 1)
     {
-        this.team = ReadByte();
+        this.__team = ReadByte();
         this.rule = ReadByte();
     }
 
@@ -487,7 +487,7 @@ void Draw_WaypointSprite(entity this)
         case SPRITERULE_DEFAULT:
             if (this.team)
             {
-                if (this.team == t)
+                if (TMID(this.team) == t)
                     spriteimage = this.netname;
                 else
                     spriteimage = "";
@@ -498,7 +498,7 @@ void Draw_WaypointSprite(entity this)
         case SPRITERULE_TEAMPLAY:
             if (t == NUM_SPECTATOR + 1)
                 spriteimage = this.netname3;
-            else if (this.team == t)
+            else if (TMID(this.team) == t)
                 spriteimage = this.netname2;
             else
                 spriteimage = this.netname;
@@ -818,7 +818,7 @@ void WaypointSprite_UpdateRule(entity e, float t, float r)
 {
     // no check, as this is never called without doing an actual change (usually only once)
     e.rule = r;
-    e.team = t;
+    e.__team = t;
     e.SendFlags |= 1;
 }
 
@@ -1008,7 +1008,7 @@ entity WaypointSprite_Spawn(
     else
         setorigin(wp, ofs);
     wp.enemy = showto;
-    wp.team = t;
+    wp.__team = t;
     wp.owner = own;
     wp.currentammo = hideable;
     if (own)
@@ -1051,7 +1051,7 @@ entity WaypointSprite_DeployFixed(
 {SELFPARAM();
     float t;
     if (teamplay)
-        t = self.team;
+        t = TMID(self.team);
     else
         t = 0;
     float maxdistance;
@@ -1081,7 +1081,7 @@ entity WaypointSprite_Attach(
     if (self.waypointsprite_attachedforcarrier)
         return world; // can't attach to FC
     if (teamplay)
-        t = self.team;
+        t = TMID(self.team);
     else
         t = 0;
     float maxdistance;
@@ -1099,7 +1099,7 @@ entity WaypointSprite_AttachCarrier(
 )
 {
     WaypointSprite_Kill(carrier.waypointsprite_attached); // FC overrides attached
-    entity e = WaypointSprite_Spawn(spr, 0, 0, carrier, '0 0 64', world, carrier.team, carrier, waypointsprite_attachedforcarrier, false, icon);
+    entity e = WaypointSprite_Spawn(spr, 0, 0, carrier, '0 0 64', world, TMID(carrier.team), carrier, waypointsprite_attachedforcarrier, false, icon);
     if (e)
     {
         WaypointSprite_UpdateMaxHealth(e, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id) * 2);
index 8f00087c0870a33bd57662a7941fca43045f0091..d9bde09d34f644952c7521e82750cb77685b9539 100644 (file)
@@ -77,7 +77,7 @@ typedef entity Notification;
 // used for notification system multi-team identifiers
 #define APP_TEAM_NUM(num, prefix) ((num == NUM_TEAM_1) ? prefix##_RED : ((num == NUM_TEAM_2) ? prefix##_BLUE : ((num == NUM_TEAM_3) ? prefix##_YELLOW : prefix##_PINK)))
 /** @deprecated use APP_TEAM_NUM */
-#define APP_TEAM_ENT(ent, prefix) APP_TEAM_NUM(ent.team, prefix)
+#define APP_TEAM_ENT(ent, prefix) APP_TEAM_NUM(TMID(ent.team), prefix)
 
 #define EIGHT_VARS_TO_VARARGS_VARLIST \
        VARITEM(1, 0, s1) \
index 253010c0c957e981127a359863fa56f07b6ae5b3..74faeface68859c5aedaa14e105aefee5872f45d 100644 (file)
@@ -1304,7 +1304,7 @@ void PM_Main(entity this)
        this.v_angle = PHYS_INPUT_ANGLES(this);
        this.angles = PHYS_WORLD_ANGLES(this);
 
-       this.team = myteam + 1; // is this correct?
+       this.__team = myteam + 1; // is this correct?
        if (!(PHYS_INPUT_BUTTON_JUMP(this))) // !jump
                UNSET_JUMP_HELD(this); // canjump = true
        pmove_waterjumptime -= PHYS_INPUT_TIMELENGTH;
index 233762202efda470e23ed15819f2fa2fadf34bd5..d852e7a931a6522aaa510a4adb96fe85b13ee805 100644 (file)
@@ -135,7 +135,7 @@ void PlayerStats_GameReport_FinalizePlayer(entity p)
                db_put(PS_GR_OUT_DB, sprintf("%s:_netname", p.playerstats_id), p.netname);
 
        if(teamplay)
-               db_put(PS_GR_OUT_DB, sprintf("%s:_team", p.playerstats_id), ftos(p.team));
+               db_put(PS_GR_OUT_DB, sprintf("%s:_team", p.playerstats_id), ftos(TMID(p.team)));
 
        if(stof(db_get(PS_GR_OUT_DB, sprintf("%s:%s", p.playerstats_id, PLAYERSTATS_ALIVETIME))) > 0)
                PS_GR_P_ADDVAL(p, PLAYERSTATS_JOINS, 1);
index 751462498c2a0a4743c998f869a381c8e9da9040..863197faeec21b08169f9ababa4d8c7a4816dbe0 100644 (file)
@@ -125,7 +125,7 @@ float spamsound(entity e, int chan, string samp, float vol, float _atten)
        return false;
 }
 
-void play2team(float t, string filename)
+void play2team(team_t t, string filename)
 {
        if (autocvar_bot_sound_monopoly) return;
        FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it.team == t, play2(it, filename));
index e2bafb82fe5d1921eaa363f4f6f0d8a0d344fcd3..33bc95af29940b0209756ad2948726188b61413e 100644 (file)
@@ -826,7 +826,7 @@ void Item_Touch()
                if(this.team)
                {
                        RandomSelection_Init();
-                       for(entity head = world; (head = findfloat(head, team, this.team)); )
+                       for(entity head = world; (head = findfloat(head, __team, TMID(this.team))); )
                        {
                                if(head.flags & FL_ITEM)
                                if(head.classname != "item_flag_team" && head.classname != "item_key_team")
@@ -870,10 +870,9 @@ void Item_FindTeam()
        if(self.effects & EF_NODRAW)
        {
                // marker for item team search
-               LOG_TRACE("Initializing item team ", ftos(self.team), "\n");
+               LOG_TRACE("Initializing item team ", ftos(TMID(self.team)), "\n");
                RandomSelection_Init();
-               FOREACH_ENTITY_FLOAT(team, self.team,
-               {
+               FOREACH_ENTITY_FLOAT(__team, TMID(self.team), {
                        if(it.flags & FL_ITEM)
                        if(it.classname != "item_flag_team" && it.classname != "item_key_team")
                                RandomSelection_Add(it, 0, string_null, it.cnt, 0);
@@ -883,8 +882,7 @@ void Item_FindTeam()
                e.state = 0;
                Item_Show(e, 1);
 
-               FOREACH_ENTITY_FLOAT(team, self.team,
-               {
+               FOREACH_ENTITY_FLOAT(__team, TMID(self.team), {
                        if(it.flags & FL_ITEM)
                        if(it.classname != "item_flag_team" && it.classname != "item_key_team")
                        {
index 9342b4c00f4949de2f4e50befe8baf1cc99f7e85..5f49faac730771dd4cb26411a16898516d0eb810 100644 (file)
@@ -2,7 +2,6 @@
 #define TEAMS_H
 
 REGISTRY(Teams, BITS(5))
-#define Teams_from(i) _Teams_from(i, TEAM_SPECTATOR)
 REGISTER_REGISTRY(Teams)
 REGISTRY_CHECK(Teams)
 
@@ -12,12 +11,13 @@ CLASS(Team, Object)
     ATTRIB(Team, m_playercolor, int, 0)
     ATTRIB(Team, m_colorstr, string, string_null)
     ATTRIB(Team, m_color, vector, '0 0 0')
+    .int Team_id;
     CONSTRUCTOR(Team, string _name, string _name_nonls, int _playercolor, string _colorstr, vector _color) {
         CONSTRUCT(Team);
         #ifndef CSQC
         _playercolor++;
         #endif
-        this.team = _playercolor; // for team numbers that aren't stupid, use `this.m_id`
+        this.Team_id = _playercolor; // for team numbers that aren't stupid, use `this.m_id`
 
         this.m_name = _name;
         this.m_name_nonls = _name_nonls;
@@ -66,7 +66,7 @@ float myteam;
 
 Team TM(int teamid) {
     if (teamid == 0) return NULL;
-    FOREACH(Teams, it.team == teamid, return it);
+    FOREACH(Teams, it.Team_id == teamid, return it);
     LOG_SEVEREF("Unknown team: %d", teamid);
     return NULL;
 }
index e3c74b35626ba894f03335c432b91b64ecf4a38b..3e35edd7f3c90a9fd1e9f966d87c538aec57640f 100644 (file)
@@ -267,7 +267,7 @@ void func_breakable_damage(entity this, entity inflictor, entity attacker, float
 
 void func_breakable_reset(entity this)
 {
-       this.team = this.team_saved;
+       this.__team = this.team_saved;
        func_breakable_look_restore();
        if(this.spawnflags & 1)
                func_breakable_behave_destroyed();
@@ -334,7 +334,7 @@ spawnfunc(func_breakable)
        if(this.noise1)
                precache_sound(this.noise1);
 
-       this.team_saved = this.team;
+       this.team_saved = TMID(this.team);
        this.dropped_origin = this.origin;
 
        this.reset = func_breakable_reset;
index 141fd458f4c865ea878786f61886516e328bdb6a..1873fe8f9a05b3d06eb4e00a049ca531bda1fa43 100644 (file)
@@ -344,7 +344,7 @@ float trigger_push_send(entity this, entity to, float sf)
 {
        WriteHeader(MSG_ENTITY, ENT_CLIENT_TRIGGER_PUSH);
 
-       WriteByte(MSG_ENTITY, self.team);
+       WriteByte(MSG_ENTITY, TMID(self.team));
        WriteInt24_t(MSG_ENTITY, self.spawnflags);
        WriteByte(MSG_ENTITY, self.active);
        WriteCoord(MSG_ENTITY, self.height);
@@ -442,7 +442,7 @@ NET_HANDLE(ENT_CLIENT_TRIGGER_PUSH, bool isnew)
        make_pure(this);
 
        self.classname = "jumppad";
-       int mytm = ReadByte(); if(mytm) { self.team = mytm - 1; }
+       int mytm = ReadByte(); if(mytm) { self.__team = mytm - 1; }
        self.spawnflags = ReadInt24_t();
        self.active = ReadByte();
        self.height = ReadCoord();
index b9d3aeb96e9081a7eab274bfb5cc535896c55088..08989688ed93d499fa2eab6cea59d5fb33d3cc01 100644 (file)
@@ -127,7 +127,7 @@ void multi_reset(entity this)
        }
        this.think = func_null;
        this.nextthink = 0;
-       this.team = this.team_saved;
+       this.__team = this.team_saved;
 }
 
 /*QUAKED spawnfunc_trigger_multiple (.5 .5 .5) ? notouch
@@ -164,7 +164,7 @@ spawnfunc(trigger_multiple)
 
        EXACTTRIGGER_INIT;
 
-       self.team_saved = self.team;
+       self.team_saved = TMID(self.team);
 
        if (self.health)
        {
index 193dba36825fe8ce1aefc43b06948c9d1a223277..91b487dfaaaf56596e53df7283f6064d4b410c6f 100644 (file)
@@ -23,12 +23,12 @@ void trigger_relay_teamcheck_use()
 
 void trigger_relay_teamcheck_reset(entity this)
 {
-       this.team = this.team_saved;
+       this.__team = this.team_saved;
 }
 
 spawnfunc(trigger_relay_teamcheck)
 {
-       this.team_saved = this.team;
+       this.team_saved = TMID(this.team);
        this.use = trigger_relay_teamcheck_use;
        this.reset = trigger_relay_teamcheck_reset;
 }
index be8040079b91f36670492816498228debff65bfa..0860264dcd466515fcf8367edcccad7719e13c29 100644 (file)
@@ -63,7 +63,7 @@ float trigger_teleport_send(entity this, entity to, float sf)
 {
        WriteHeader(MSG_ENTITY, ENT_CLIENT_TRIGGER_TELEPORT);
 
-       WriteByte(MSG_ENTITY, this.team);
+       WriteByte(MSG_ENTITY, TMID(this.team));
        WriteInt24_t(MSG_ENTITY, this.spawnflags);
        WriteByte(MSG_ENTITY, this.active);
        WriteCoord(MSG_ENTITY, this.speed);
@@ -106,7 +106,7 @@ spawnfunc(trigger_teleport)
 NET_HANDLE(ENT_CLIENT_TRIGGER_TELEPORT, bool isnew)
 {
        self.classname = "trigger_teleport";
-       int mytm = ReadByte(); if(mytm) { self.team = mytm - 1; }
+       int mytm = ReadByte(); if(mytm) { self.__team = mytm - 1; }
        self.spawnflags = ReadInt24_t();
        self.active = ReadByte();
        self.speed = ReadCoord();
index 079d6b3f0dbc445577c8b95b1834f81d0e0d353e..ae0e15b3ccfaf0820f151725b466253208e66e72 100644 (file)
@@ -8,11 +8,11 @@ void turret_remove(entity this)
 .vector glowmod;
 void turret_changeteam()
 {SELFPARAM();
-       self.glowmod = Team_ColorRGB(self.team - 1) * 2;
-       self.teamradar_color = Team_ColorRGB(self.team - 1);
+       self.glowmod = Team_ColorRGB(TMID(self.team) - 1) * 2;
+       self.teamradar_color = Team_ColorRGB(TMID(self.team) - 1);
 
        if(self.team)
-               self.colormap = 1024 + (self.team - 1) * 17;
+               self.colormap = 1024 + (TMID(self.team) - 1) * 17;
 
        self.tur_head.colormap = self.colormap;
        self.tur_head.glowmod = self.glowmod;
@@ -71,7 +71,7 @@ void turret_draw2d(entity this)
        string txt;
 
        if(autocvar_cl_vehicles_hud_tactical)
-       if(dist < 10240 && t != this.team)
+       if(dist < 10240 && t != TMID(this.team))
        {
                // TODO: Vehicle tactical hud
                o = project_3d_to_2d(this.origin + '0 0 32');
@@ -119,7 +119,7 @@ void turret_draw2d(entity this)
        else
                txt = spritelookuptext(this, spriteimage);
 
-       if(time - floor(time) > 0.5 && t == this.team)
+       if(time - floor(time) > 0.5 && t == TMID(this.team))
        {
                if(this.helpme && time < this.helpme)
                {
@@ -424,9 +424,9 @@ NET_HANDLE(ENT_CLIENT_TURRET, bool isnew)
        {
                float _tmp;
                _tmp = ReadByte();
-               if(_tmp != self.team)
+               if(_tmp != TMID(self.team))
                {
-                       self.team = _tmp;
+                       self.__team = _tmp;
                        turret_changeteam();
                }
 
index fec1e885f1e0cce7d1b5c3fac6ad2fdb48372336..c1b92404893c1fda0adc08d25e9eac97ad9fe380 100644 (file)
@@ -349,7 +349,7 @@ bool turret_send(entity this, entity to, float sf)
 
        if(sf & TNSF_STATUS)
        {
-               WriteByte(MSG_ENTITY, self.team);
+               WriteByte(MSG_ENTITY, TMID(self.team));
 
                if(self.health <= 0)
                        WriteByte(MSG_ENTITY, 0);
@@ -1184,7 +1184,7 @@ void turret_use()
 
        self.team = activator.team;
 
-       if(self.team == 0)
+       if(TMID(self.team) == 0)
                self.active = ACTIVE_NOT;
        else
                self.active = ACTIVE_ACTIVE;
@@ -1271,7 +1271,7 @@ float turret_initialize(Turret tur)
        self.netname = tur.netname;
        load_unit_settings(self, 0);
 
-       if(!self.team || !teamplay)             { self.team = MAX_SHOT_DISTANCE; }
+       if(!self.team || !teamplay)             { self.__team = MAX_SHOT_DISTANCE; }
        if(!self.ticrate)                               { self.ticrate = ((self.turret_flags & TUR_FLAG_SUPPORT) ? 0.2 : 0.1); }
        if(!self.health)                                { self.health = 1000; }
        if(!self.shot_refire)                   { self.shot_refire = 1; }
index 37bdd93299978f50f11671369fccdd897a8618ba..92c923e32bbf7134ccf5dabe2dd1b237a36980f2 100644 (file)
@@ -37,7 +37,7 @@ METHOD(PlasmaTurret, tr_attack, void(PlasmaTurret this, entity it))
 
         // teamcolor / hit beam effect
         vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
-        WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(self.team)), self.tur_shotorg, v);
+        WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(TMID(self.team))), self.tur_shotorg, v);
     }
     else
     {
index 183d4d96512a564139a8789cf12526add639742e..e0ef0b33c4fee386e2e950dca4462de1d3ba324a 100644 (file)
@@ -39,7 +39,7 @@ METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret this, entity it))
 
         // teamcolor / hit beam effect
         vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
-        WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(self.team)), self.tur_shotorg, v);
+        WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(TMID(self.team))), self.tur_shotorg, v);
     } else {
         SUPER(PlasmaTurret).tr_attack(this, it);
     }
index 699c13f27fc984cbf8045d550ff98b150ae8741e..8ed633a4c4356d25c2a5486cdb13916202382b93 100644 (file)
@@ -393,7 +393,7 @@ void vehicles_reset_colors()
                _effects |= EF_FULLBRIGHT;
 
        if(self.team)
-               _colormap = 1024 + (self.team - 1) * 17;
+               _colormap = 1024 + (TMID(self.team) - 1) * 17;
        else
                _colormap = 1024;
 
@@ -507,14 +507,14 @@ void vehicles_showwp()
        }
 
        if(teamplay && self.team)
-               rgb = Team_ColorRGB(self.team);
+               rgb = Team_ColorRGB(TMID(self.team));
        else
                rgb = '1 1 1';
        entity wp = WaypointSprite_Spawn(WP_Vehicle, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_Vehicle);
        wp.colormod = rgb;
        if(self.waypointsprite_attached)
        {
-               WaypointSprite_UpdateRule(self.waypointsprite_attached, self.wp00.team, SPRITERULE_DEFAULT);
+               WaypointSprite_UpdateRule(self.waypointsprite_attached, TMID(self.wp00.team), SPRITERULE_DEFAULT);
                if(this == NULL)
                        WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, self.nextthink);
                WaypointSprite_Ping(self.waypointsprite_attached);
@@ -556,7 +556,7 @@ void vehicle_use()
 
        self.tur_head.team = activator.team;
 
-       if(self.tur_head.team == 0)
+       if(TMID(self.tur_head.team) == 0)
                self.active = ACTIVE_NOT;
        else
                self.active = ACTIVE_ACTIVE;
@@ -882,7 +882,7 @@ void vehicles_exit(bool eject)
        _vehicle.tur_head.nodrawtoclient = world;
 
        if(!teamplay)
-               _vehicle.team = 0;
+               _vehicle.__team = 0;
 
        Kill_Notification(NOTIF_ONE, _player, MSG_CENTER, CPID_VEHICLES);
        Kill_Notification(NOTIF_ONE, _player, MSG_CENTER, CPID_VEHICLES_OTHER); // kill all vehicle notifications when exiting a vehicle?
@@ -1012,8 +1012,8 @@ void vehicles_enter(entity pl, entity veh)
                Send_Notification(NOTIF_ONE, pl, MSG_CENTER, CENTER_VEHICLE_STEAL_SELF);
 
                if (autocvar_g_vehicles_steal_show_waypoint) {
-                       entity wp = WaypointSprite_Spawn(WP_VehicleIntruder, 0, 0, pl, '0 0 68', world, veh.team, veh, wps_intruder, true, RADARICON_DANGER);
-                       wp.colormod = Team_ColorRGB(pl.team);
+                       entity wp = WaypointSprite_Spawn(WP_VehicleIntruder, 0, 0, pl, '0 0 68', world, TMID(veh.team), veh, wps_intruder, true, RADARICON_DANGER);
+                       wp.colormod = Team_ColorRGB(TMID(pl.team));
                }
        }
        else return;
@@ -1202,7 +1202,7 @@ bool vehicle_initialize(entity veh, bool nodrop)
 
                        if(teamplay)
                        {
-                               if(self.vehicle_controller.team == 0)
+                               if(TMID(self.vehicle_controller.team) == 0)
                                        self.active = ACTIVE_NOT;
                                else
                                        self.active = ACTIVE_ACTIVE;
@@ -1212,7 +1212,7 @@ bool vehicle_initialize(entity veh, bool nodrop)
        else { self.active = ACTIVE_ACTIVE; }
 
        if(self.team && (!teamplay || !autocvar_g_vehicles_teams))
-               self.team = 0;
+               self.__team = 0;
 
        if(self.mdl == "" || !self.mdl)
                _setmodel(self, veh.model);
index db456825b5c5df7d6ddf9f70bcf93943d6c3d3ba..6894c5c7c8efa41dee83da0e6dcb1aecb7e34ca3 100644 (file)
@@ -38,7 +38,7 @@ bool bumble_raygun_send(entity this, entity to, float sf)
     if(sf & BRG_SETUP)
     {
         WriteByte(MSG_ENTITY, etof(self.realowner));
-        WriteByte(MSG_ENTITY, self.realowner.team);
+        WriteByte(MSG_ENTITY, TMID(self.realowner.team));
         WriteByte(MSG_ENTITY, self.cnt);
     }
 
@@ -71,9 +71,9 @@ NET_HANDLE(ENT_CLIENT_BUMBLE_RAYGUN, bool isnew)
 
     if(sf & BRG_SETUP)
     {
-        self.cnt  = ReadByte();
-        self.team = ReadByte();
-        self.cnt  = ReadByte();
+        self.cnt    = ReadByte();
+        self.__team = ReadByte();
+        self.cnt    = ReadByte();
 
         if(self.cnt)
             self.colormod = '1 0 0';
index 0760f79e32f574a81ccd229df7dfe11c622f8a47..50b231690a1ae642ba14110d0c3cceb3be1a7d2c 100644 (file)
@@ -226,7 +226,7 @@ int W_Tuba_GetNote(entity pl, int hittype)
        // that way, holes in the range of notes are "plugged"
        if(teamplay)
        {
-               if(pl.team == NUM_TEAM_2 || pl.team == NUM_TEAM_4)
+               if(TMID(pl.team) == NUM_TEAM_2 || TMID(pl.team) == NUM_TEAM_4)
                        note += 3;
        }
        else
index 92c795421a401cb88e6d50490e28e48a5bf73d31..a1e0c84ebe71cd813987c4806aef26c80525bee8 100644 (file)
@@ -76,7 +76,7 @@ void SendCSQCVaporizerBeamParticle(entity player, int hit) {
        WriteCoord(MSG_BROADCAST, v.z);
        WriteByte(MSG_BROADCAST, hit);
        WriteByte(MSG_BROADCAST, etof(player));
-       WriteByte(MSG_BROADCAST, player.team);
+       WriteByte(MSG_BROADCAST, TMID(player.team));
 }
 #elif defined(CSQC)
 bool autocvar_cl_vaporizerbeam_particle = false;
@@ -148,11 +148,11 @@ NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, bool isNew)
        int myowner = ReadByte();
        this.owner = playerslots[myowner - 1];
        this.sv_entnum = myowner;
-       this.team = ReadByte() - 1;
+       this.__team = ReadByte() - 1;
 
        if(autocvar_cl_vaporizerbeam_particle)
        {
-               WarpZone_TrailParticles(world, particleeffectnum(((this.cnt) ? EFFECT_VAPORIZER_HIT(this.team) : EFFECT_VAPORIZER(this.team))), this.vorg1, this.vorg2);
+               WarpZone_TrailParticles(world, particleeffectnum(((this.cnt) ? EFFECT_VAPORIZER_HIT(TMID(this.team)) : EFFECT_VAPORIZER(TMID(this.team)))), this.vorg1, this.vorg2);
                this.draw = func_null;
                this.drawmask = MASK_NORMAL;
                remove(this);
index 9aaf524493719d0171363d086cfd29db0944bf05..b6375c067f6e600d792e159a39035a02b95940af 100644 (file)
        #include <dpdefs/keycodes.qh>
 #endif
 
+.int team;
+.int __team = team;
+.entity m_team;
+#if 1
+#define team_t int
+#define TMID(t) (t)
+#else
+#define team_t Team
+#define TMID(t) (t.Team_id)
+#define team m_team
+#endif
+
 #include "macro.qh"
 
 #include "warpzone/mathlib.qc"
index 7202547fc0b8491a72619f510e89a7be2dedf3f8..34797a56f1d4f6aa7d7a7bee42152f7f20f6724b 100644 (file)
@@ -116,7 +116,7 @@ float bot_shouldattack(entity e)
                if (e == self)
                        return false;
                if (teamplay)
-               if (e.team != 0)
+               if (TMID(e.team) != 0)
                        return false;
        }
 
@@ -125,7 +125,7 @@ float bot_shouldattack(entity e)
 
        if(teamplay)
        {
-               if(e.team==0)
+               if(TMID(e.team)==0)
                        return false;
        }
        else if(bot_ignore_bots)
index 37079a33c32cf2da4ccf45a7c307849fee1d53ce..aba8ece03706f8efad44118ebd9b21b7e20081d1 100644 (file)
@@ -414,13 +414,13 @@ void bot_clientconnect(entity this)
                bot_setnameandstuff();
 
        if(self.bot_forced_team==1)
-               self.team = NUM_TEAM_1;
+               self.__team = NUM_TEAM_1;
        else if(self.bot_forced_team==2)
-               self.team = NUM_TEAM_2;
+               self.__team = NUM_TEAM_2;
        else if(self.bot_forced_team==3)
-               self.team = NUM_TEAM_3;
+               self.__team = NUM_TEAM_3;
        else if(self.bot_forced_team==4)
-               self.team = NUM_TEAM_4;
+               self.__team = NUM_TEAM_4;
        else
                JoinBestTeam(self, false, true);
 
@@ -441,13 +441,13 @@ void bot_removefromlargestteam()
        bestcount = 0;
        while (head)
        {
-               if(head.team == NUM_TEAM_1)
+               if(TMID(head.team) == NUM_TEAM_1)
                        thiscount = c1;
-               else if(head.team == NUM_TEAM_2)
+               else if(TMID(head.team) == NUM_TEAM_2)
                        thiscount = c2;
-               else if(head.team == NUM_TEAM_3)
+               else if(TMID(head.team) == NUM_TEAM_3)
                        thiscount = c3;
-               else if(head.team == NUM_TEAM_4)
+               else if(TMID(head.team) == NUM_TEAM_4)
                        thiscount = c4;
                else
                        thiscount = 0;
index d41cf563a85d9c4865109cfe3965982fbb96c001..eeca8337d7c09c9e236bc95a6e3024bf6b551e07 100644 (file)
@@ -215,7 +215,7 @@ void PutObserverInServer()
        if (mutator_returnvalue) {
            // mutator prevents resetting teams+score
        } else {
-               this.team = -1;  // move this as it is needed to log the player spectating in eventlog
+               this.__team = -1;  // move this as it is needed to log the player spectating in eventlog
         this.frags = FRAGS_SPECTATOR;
         PlayerScore_Clear(this);  // clear scores when needed
     }
@@ -314,7 +314,7 @@ void FixPlayermodel(entity player)
        {
                if(teamplay)
                {
-                       string s = Static_Team_ColorName_Lower(player.team);
+                       string s = Static_Team_ColorName_Lower(TMID(player.team));
                        if (s != "neutral")
                        {
                                defaultmodel = cvar_string(strcat("sv_defaultplayermodel_", s));
@@ -419,7 +419,7 @@ void PutClientInServer()
                PlayerState_attach(this);
                accuracy_resend(this);
 
-               if (this.team < 0)
+               if (TMID(this.team) < 0)
                        JoinBestTeam(this, false, true);
 
                entity spot = SelectSpawnPoint(false);
@@ -1047,13 +1047,13 @@ void ClientConnect()
        if (autocvar_sv_eventlog)
                GameLogEcho(strcat(":join:", ftos(this.playerid), ":", ftos(etof(this)), ":", ((IS_REAL_CLIENT(this)) ? this.netaddress : "bot"), ":", this.netname));
 
-       LogTeamchange(this.playerid, this.team, 1);
+       LogTeamchange(this.playerid, TMID(this.team), 1);
 
        this.just_joined = true;  // stop spamming the eventlog with additional lines when the client connects
 
        this.netname_previous = strzone(this.netname);
 
-       Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((teamplay && IS_PLAYER(this)) ? APP_TEAM_ENT(this, INFO_JOIN_CONNECT_TEAM) : INFO_JOIN_CONNECT), this.netname);
+       Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((teamplay && IS_PLAYER(this)) ? APP_TEAM_NUM(TMID(this.team), INFO_JOIN_CONNECT_TEAM) : INFO_JOIN_CONNECT), this.netname);
 
        stuffcmd(this, clientstuff, "\n");
        stuffcmd(this, "cl_particles_reloadeffects\n"); // TODO do we still need this?
@@ -1752,7 +1752,7 @@ void LeaveSpectatorMode()
 
                        PutClientInServer();
 
-                       if(IS_PLAYER(self)) { Send_Notification(NOTIF_ALL, world, MSG_INFO, ((teamplay && this.team != -1) ? APP_TEAM_ENT(this, INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), self.netname); }
+                       if(IS_PLAYER(self)) { Send_Notification(NOTIF_ALL, world, MSG_INFO, ((teamplay && TMID(this.team) != -1) ? APP_TEAM_NUM(TMID(this.team), INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), self.netname); }
                }
                else
                        stuffcmd(self, "menu_showteamselect\n");
index 979e6d860bf3cf1455c12179b2c47e6973b582b9..849b40869623aaeb9df4218863eb293154aeae60 100644 (file)
@@ -654,7 +654,7 @@ void MoveToTeam(entity client, int team_colour, int type)
        SetPlayerColors(client, team_colour - 1);  // set the players colour
        Damage(client, client, client, 100000, DEATH_AUTOTEAMCHANGE.m_id, client.origin, '0 0 0');  // kill the player
        lockteams = lockteams_backup;  // restore the team lock
-       LogTeamchange(client.playerid, client.team, type);
+       LogTeamchange(client.playerid, TMID(client.team), type);
 }
 
 /**
@@ -681,7 +681,7 @@ int Say(entity source, float teamsay, entity privatesay, string msgin, bool floo
        if (!IS_PLAYER(source))
                colorstr = "^0"; // black for spectators
        else if(teamplay)
-               colorstr = Team_ColorCode(source.team);
+               colorstr = Team_ColorCode(TMID(source.team));
        else
        {
                colorstr = "";
index 23c57ea6e29d254dae14d6505aa08c2898f4a916..679b86030288ba2908c6a5d794f50dcd7542c7d2 100644 (file)
@@ -181,7 +181,7 @@ void ClientCommand_join(float request)
                                                self.classname = STR_PLAYER;
                                                PlayerScore_Clear(self);
                                                Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CPID_PREVENT_JOIN);
-                                               Send_Notification(NOTIF_ALL, world, MSG_INFO, ((teamplay && self.team != -1) ? APP_TEAM_ENT(this, INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), self.netname);
+                                               Send_Notification(NOTIF_ALL, world, MSG_INFO, ((teamplay && TMID(self.team) != -1) ? APP_TEAM_NUM(TMID(this.team), INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), self.netname);
                                                PutClientInServer();
                                        }
                                        else
@@ -373,7 +373,7 @@ void ClientCommand_selectteam(float request, float argc)
 
                                                                if (selection)
                                                                {
-                                                                       if (self.team == selection && !IS_DEAD(self))
+                                                                       if (TMID(self.team) == selection && !IS_DEAD(self))
                                                                        {
                                                                                sprint(self, "^7You already are on that team.\n");
                                                                        }
@@ -387,7 +387,7 @@ void ClientCommand_selectteam(float request, float argc)
                                                                                {
                                                                                        CheckAllowedTeams(self);
                                                                                        GetTeamCounts(self);
-                                                                                       if (!TeamSmallerEqThanTeam(Team_TeamToNumber(selection), Team_TeamToNumber(self.team), self))
+                                                                                       if (!TeamSmallerEqThanTeam(Team_TeamToNumber(selection), Team_TeamToNumber(TMID(self.team)), self))
                                                                                        {
                                                                                                Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_TEAMCHANGE_LARGERTEAM);
                                                                                                return;
index 2f1400245083fafea22aaeed9f5863fb0de4dd2e..7fc3068f957e5c433c4e7d73f6320ec7128f4d06 100644 (file)
@@ -1052,10 +1052,10 @@ void GameCommand_moveplayer(float request, float argc)
 
                                                                // find the team to move the player to
                                                                team_id = Team_ColorToTeam(destination);
-                                                               if (team_id == client.team)  // already on the destination team
+                                                               if (team_id == TMID(client.team))  // already on the destination team
                                                                {
                                                                        // keep the forcing undone
-                                                                       LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") is already on the ", Team_ColoredFullName(client.team), (targets ? "^7, skipping to next player.\n" : "^7.\n"));
+                                                                       LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") is already on the ", Team_ColoredFullName(TMID(client.team)), (targets ? "^7, skipping to next player.\n" : "^7.\n"));
                                                                        continue;
                                                                }
                                                                else if (team_id == 0)  // auto team
@@ -1387,7 +1387,7 @@ void GameCommand_shuffleteams(float request)
 
                                                        if (VerifyClientNumber(shuffleteams_players[z])) setself(edict_num(shuffleteams_players[z]));
 
-                                                       if (self.team != team_color) MoveToTeam(self, team_color, 6);
+                                                       if (TMID(self.team) != team_color) MoveToTeam(self, team_color, 6);
 
                                                        shuffleteams_players[z] = 0;
                                                        shuffleteams_teams[i] = shuffleteams_teams[i] + 1;
index 4cf5b7dc5145199bb8512a00d511d7b02d989f77..8f8d1d89cd2d3e94572fc6db99eb09e6f15f3279 100644 (file)
@@ -341,15 +341,15 @@ void reset_map(bool dorespawn)
 
        MUTATOR_CALLHOOK(reset_map_global);
 
-       FOREACH_ENTITY_ORDERED(IS_NOT_A_CLIENT(it), LAMBDA(
+       FOREACH_ENTITY_ORDERED(IS_NOT_A_CLIENT(it), {
                if (it.reset)
                {
                        WITH(entity, self, it, it.reset(it));
                        continue;
                }
-               if (it.team_saved) it.team = it.team_saved;
+               if (it.team_saved) it.__team = it.team_saved;
                if (it.flags & FL_PROJECTILE) remove(it);  // remove any projectiles left
-       ));
+       });
 
        // Waypoints and assault start come LAST
        FOREACH_ENTITY_ORDERED(IS_NOT_A_CLIENT(it), LAMBDA(
index 9570f359c6756894ed2905f859ae0f9a79cc8e92..85c24b892c7dfc2deb3136a0b090d5c6550eff50 100644 (file)
@@ -302,7 +302,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
                {
                        if(deathtype == DEATH_TEAMCHANGE.m_id || deathtype == DEATH_AUTOTEAMCHANGE.m_id)
                        {
-                               Obituary_SpecialDeath(targ, false, deathtype, targ.netname, deathlocation, "", targ.team, 0, 0);
+                               Obituary_SpecialDeath(targ, false, deathtype, targ.netname, deathlocation, "", TMID(targ.team), 0, 0);
                        }
                        else
                        {
@@ -345,7 +345,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
 
                        Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_TEAMKILL_FRAG, targ.netname);
                        Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_TEAMKILL_FRAGGED, attacker.netname);
-                       Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(targ.team, INFO_DEATH_TEAMKILL), targ.netname, attacker.netname, deathlocation, targ.killcount);
+                       Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(TMID(targ.team), INFO_DEATH_TEAMKILL), targ.netname, attacker.netname, deathlocation, targ.killcount);
 
                        // In this case, the death message will ALWAYS be "foo was betrayed by bar"
                        // No need for specific death/weapon messages...
@@ -535,7 +535,7 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
        ice.frame = floor(random() * 21); // ice model has 20 different looking frames
        setmodel(ice, MDL_ICE);
        ice.alpha = 1;
-       ice.colormod = Team_ColorRGB(targ.team);
+       ice.colormod = Team_ColorRGB(TMID(targ.team));
        ice.glowmod = ice.colormod;
        targ.iceblock = ice;
        targ.revival_time = 0;
@@ -548,7 +548,7 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
 
        // add waypoint
        if(show_waypoint)
-               WaypointSprite_Spawn(WP_Frozen, 0, 0, targ, '0 0 64', world, targ.team, targ, waypointsprite_attached, true, RADARICON_WAYPOINT);
+               WaypointSprite_Spawn(WP_Frozen, 0, 0, targ, '0 0 64', world, TMID(targ.team), targ, waypointsprite_attached, true, RADARICON_WAYPOINT);
 }
 
 void Unfreeze (entity targ)
index 6612b837c1542ff8b7991051cf4d54f868f5ceae..6848e4b088f8cf2d534655d7ce258e7f9b783798 100644 (file)
@@ -21,7 +21,7 @@ void g_model_setcolormaptoactivator ()
        if(teamplay)
        {
                if(activator.team)
-                       self.colormap = (activator.team - 1) * 0x11;
+                       self.colormap = (TMID(activator.team) - 1) * 0x11;
                else
                        self.colormap = 0x00;
        }
index 6398cbe939d72be500f4fb542536e06af27fa3de..c0151b9d74fb48573aedf8b38222fab62a009a0c 100644 (file)
@@ -1411,11 +1411,11 @@ 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 - it.jointime)), ":");
                if(IS_PLAYER(it) || MUTATOR_CALLHOOK(GetPlayerStatus, it, s))
-                       s = strcat(s, ftos(it.team), ":");
+                       s = strcat(s, ftos(TMID(it.team)), ":");
                else
                        s = strcat(s, "spectator:");
 
@@ -1425,7 +1425,7 @@ void DumpStats(float final)
                        GameLogEcho(strcat(s, ftos(it.playerid), ":", it.netname));
                if(to_file)
                        fputs(file, strcat(s, it.netname, "\n"));
-       ));
+       });
 
        if(teamplay)
        {
@@ -1680,7 +1680,7 @@ float WinningCondition_Scores(float limit, float leadlimit)
        if(WinningConditionHelper_winner)
                WinningConditionHelper_winner.winning = 1;
        if(WinningConditionHelper_winnerteam >= 0)
-               SetWinners(team, WinningConditionHelper_winnerteam);
+               SetWinners(__team, WinningConditionHelper_winnerteam);
 
        if(WinningConditionHelper_lowerisbetter)
        {
@@ -1745,25 +1745,25 @@ float WinningCondition_RanOutOfSpawns()
 
        team1_score = team2_score = team3_score = team4_score = 0;
 
-       FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), LAMBDA(
-               switch(it.team)
+       FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), {
+               switch(TMID(it.team))
                {
                        case NUM_TEAM_1: team1_score = 1; break;
                        case NUM_TEAM_2: team2_score = 1; break;
                        case NUM_TEAM_3: team3_score = 1; break;
                        case NUM_TEAM_4: team4_score = 1; break;
                }
-       ));
+       });
 
-       FOREACH_ENTITY_CLASS("info_player_deathmatch", true, LAMBDA(
-               switch(it.team)
+       FOREACH_ENTITY_CLASS("info_player_deathmatch", true, {
+               switch(TMID(it.team))
                {
                        case NUM_TEAM_1: team1_score = 1; break;
                        case NUM_TEAM_2: team2_score = 1; break;
                        case NUM_TEAM_3: team3_score = 1; break;
                        case NUM_TEAM_4: team4_score = 1; break;
                }
-       ));
+       });
 
        ClearWinners();
        if(team1_score + team2_score + team3_score + team4_score == 0)
@@ -1791,7 +1791,7 @@ float WinningCondition_RanOutOfSpawns()
                        if(t != NUM_TEAM_4) if(c4 >= 0) TeamScore_AddToTeam(NUM_TEAM_4, i, -1000);
                }
 
-               AddWinners(team, t);
+               AddWinners(__team, t);
                return WINNING_YES;
        }
        else
index c59e8a4bfaaf7f939dc2ccd5d9b90cb309ad9759..72e0d48d833f73d65bfefc41fb592a15fa20ca50 100644 (file)
@@ -455,7 +455,7 @@ string playername(entity p)
     string t;
     if (teamplay && !intermission_running && IS_PLAYER(p))
     {
-        t = Team_ColorCode(p.team);
+        t = Team_ColorCode(TMID(p.team));
         return strcat(t, strdecolorize(p.netname));
     }
     else
index 4a6829a74306df60412c366ab5e3a08eaf3e9959..9629f0e50b72e1bbe22119b42782e34badb4817f 100644 (file)
@@ -38,7 +38,7 @@ void write_recordmarker(entity pl, float tstart, float dt);
 
 void play2all(string samp);
 
-void play2team(float t, string filename);
+void play2team(team_t t, string filename);
 
 void GetCvars_handleFloat(string thisname, float f, .float field, string name);
 
index e9c31f3269f8cf73817fc7c3c993b8a95978bc6c..466450f92946777fda78396d575e94817190997d 100644 (file)
@@ -104,7 +104,7 @@ void assault_objective_reset(entity this)
 // decrease the health of targeted objectives
 void assault_objective_decrease_use()
 {SELFPARAM();
-       if(activator.team != assault_attacker_team)
+       if(TMID(activator.team) != assault_attacker_team)
        {
                // wrong team triggered decrease
                return;
@@ -231,16 +231,16 @@ void assault_roundstart_use()
        SUB_UseTargets();
 
        //(Re)spawn all turrets
-       FOREACH_ENTITY_CLASS("turret_main", true, LAMBDA(
+       FOREACH_ENTITY_CLASS("turret_main", true, {
                // Swap turret teams
-               if(it.team == NUM_TEAM_1)
-                       it.team = NUM_TEAM_2;
+               if(TMID(it.team) == NUM_TEAM_1)
+                       it.__team = NUM_TEAM_2;
                else
-                       it.team = NUM_TEAM_1;
+                       it.__team = NUM_TEAM_1;
 
-               // Dubbles as teamchange
+               // Doubles as teamchange
                WITH(entity, self, it, turret_respawn());
-       ));
+       });
 }
 
 void assault_wall_think()
@@ -307,11 +307,11 @@ int WinningCondition_Assault()
        // as the timelimit has not yet passed just assume the defending team will win
        if(assault_attacker_team == NUM_TEAM_1)
        {
-               SetWinners(team, NUM_TEAM_2);
+               SetWinners(__team, NUM_TEAM_2);
        }
        else
        {
-               SetWinners(team, NUM_TEAM_1);
+               SetWinners(__team, NUM_TEAM_1);
        }
 
        entity ent;
@@ -321,7 +321,7 @@ int WinningCondition_Assault()
                if(ent.winning) // round end has been triggered by attacking team
                {
                        bprint("ASSAULT: round completed...\n");
-                       SetWinners(team, assault_attacker_team);
+                       SetWinners(__team, assault_attacker_team);
 
                        TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 666 - TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 0));
 
@@ -344,7 +344,7 @@ spawnfunc(info_player_attacker)
 {
        if (!g_assault) { remove(self); return; }
 
-       self.team = NUM_TEAM_1; // red, gets swapped every round
+       self.__team = NUM_TEAM_1; // red, gets swapped every round
        spawnfunc_info_player_deathmatch(this);
 }
 
@@ -352,7 +352,7 @@ spawnfunc(info_player_defender)
 {
        if (!g_assault) { remove(self); return; }
 
-       self.team = NUM_TEAM_2; // blue, gets swapped every round
+       self.__team = NUM_TEAM_2; // blue, gets swapped every round
        spawnfunc_info_player_deathmatch(this);
 }
 
@@ -394,9 +394,9 @@ spawnfunc(func_assault_destructible)
        self.classname = "func_assault_destructible";
 
        if(assault_attacker_team == NUM_TEAM_1)
-               self.team = NUM_TEAM_2;
+               self.__team = NUM_TEAM_2;
        else
-               self.team = NUM_TEAM_1;
+               self.__team = NUM_TEAM_1;
 
        spawnfunc_func_breakable(this);
 }
@@ -613,7 +613,7 @@ void havocbot_ast_reset_role(entity bot)
        if(IS_DEAD(self))
                return;
 
-       if(bot.team == assault_attacker_team)
+       if(TMID(bot.team) == assault_attacker_team)
                havocbot_role_ast_setrole(bot, HAVOCBOT_AST_ROLE_OFFENSE);
        else
                havocbot_role_ast_setrole(bot, HAVOCBOT_AST_ROLE_DEFENSE);
@@ -622,7 +622,7 @@ void havocbot_ast_reset_role(entity bot)
 // mutator hooks
 MUTATOR_HOOKFUNCTION(as, PlayerSpawn)
 {SELFPARAM();
-       if(self.team == assault_attacker_team)
+       if(TMID(self.team) == assault_attacker_team)
                Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_ASSAULT_ATTACKING);
        else
                Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_ASSAULT_DEFENDING);
@@ -632,8 +632,8 @@ MUTATOR_HOOKFUNCTION(as, PlayerSpawn)
 
 MUTATOR_HOOKFUNCTION(as, TurretSpawn)
 {SELFPARAM();
-       if(!self.team || self.team == MAX_SHOT_DISTANCE)
-               self.team = 5; // this gets reversed when match starts?
+       if(!self.team || TMID(self.team) == MAX_SHOT_DISTANCE)
+               self.__team = 5; // this gets reversed when match starts?
 
        return false;
 }
index c90f7d1787c2aef9f56467560e59e98b0eb9dfd8..be7d52fa671ee30af0ae1dd27d41f79e7d305391 100644 (file)
@@ -73,21 +73,21 @@ bool autocvar_g_ca_spectate_enemies;
 void CA_count_alive_players()
 {
        total_players = redalive = bluealive = yellowalive = pinkalive = 0;
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
-               switch(it.team)
+       FOREACH_CLIENT(IS_PLAYER(it), {
+               switch(TMID(it.team))
                {
                        case NUM_TEAM_1: ++total_players; if(!IS_DEAD(it)) ++redalive; break;
                        case NUM_TEAM_2: ++total_players; if(!IS_DEAD(it)) ++bluealive; break;
                        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()
@@ -246,7 +246,7 @@ MUTATOR_HOOKFUNCTION(ca, reset_map_players)
                it.killcount = 0;
                if (!it.caplayer && IS_BOT_CLIENT(it))
                {
-                       it.team = -1;
+                       it.__team = -1;
                        it.caplayer = 1;
                }
                if (it.caplayer)
index 8cdad32558dcd01bcfaada28c1f167ab725f96dd..7178ffee2fc52cbf08ffe4c7f3f023f6d4f079e7 100644 (file)
@@ -154,7 +154,7 @@ void ctf_CaptureRecord(entity flag, entity player)
 
 void ctf_FlagcarrierWaypoints(entity player)
 {
-       WaypointSprite_Spawn(WP_FlagCarrier, 0, 0, player, FLAG_WAYPOINT_OFFSET, world, player.team, player, wps_flagcarrier, true, RADARICON_FLAG);
+       WaypointSprite_Spawn(WP_FlagCarrier, 0, 0, player, FLAG_WAYPOINT_OFFSET, world, TMID(player.team), player, wps_flagcarrier, true, RADARICON_FLAG);
        WaypointSprite_UpdateMaxHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id) * 2);
        WaypointSprite_UpdateHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(player.health, player.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id));
        WaypointSprite_UpdateTeamRadar(player.wps_flagcarrier, RADARICON_FLAGCARRIER, WPCOLOR_FLAGCARRIER(player.team));
@@ -339,7 +339,7 @@ void ctf_Handle_Drop(entity flag, entity player, int droptype)
        // messages and sounds
        Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_LOST) : INFO_CTF_LOST_NEUTRAL), player.netname);
        _sound(flag, CH_TRIGGER, flag.snd_flag_dropped, VOL_BASE, ATTEN_NONE);
-       ctf_EventLog("dropped", player.team, player);
+       ctf_EventLog("dropped", TMID(player.team), player);
 
        // scoring
        PlayerTeamScore_AddScore(player, -autocvar_g_ctf_score_penalty_drop);
@@ -347,8 +347,8 @@ void ctf_Handle_Drop(entity flag, entity player, int droptype)
 
        // waypoints
        if(autocvar_g_ctf_flag_dropped_waypoint) {
-               entity wp = WaypointSprite_Spawn(WP_FlagDropped, 0, 0, flag, FLAG_WAYPOINT_OFFSET, world, ((autocvar_g_ctf_flag_dropped_waypoint == 2) ? 0 : player.team), flag, wps_flagdropped, true, RADARICON_FLAG);
-               wp.colormod = WPCOLOR_DROPPEDFLAG(flag.team);
+               entity wp = WaypointSprite_Spawn(WP_FlagDropped, 0, 0, flag, FLAG_WAYPOINT_OFFSET, world, ((autocvar_g_ctf_flag_dropped_waypoint == 2) ? 0 : TMID(player.team)), flag, wps_flagdropped, true, RADARICON_FLAG);
+               wp.colormod = WPCOLOR_DROPPEDFLAG(TMID(flag.team));
        }
 
        if(autocvar_g_ctf_flag_return_time || (autocvar_g_ctf_flag_return_damage && autocvar_g_ctf_flag_health))
@@ -395,7 +395,7 @@ void ctf_Handle_Retrieve(entity flag, entity player)
 
        // messages and sounds
        _sound(player, CH_TRIGGER, flag.snd_flag_pass, VOL_BASE, ATTEN_NORM);
-       ctf_EventLog("receive", flag.team, player);
+       ctf_EventLog("receive", TMID(flag.team), player);
 
        FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(
                if(it == sender)
@@ -462,7 +462,7 @@ void ctf_Handle_Throw(entity player, entity receiver, int droptype)
                        // other
                        _sound(player, CH_TRIGGER, flag.snd_flag_touch, VOL_BASE, ATTEN_NORM);
                        WarpZone_TrailParticles(world, _particleeffectnum(flag.passeffect), player.origin, targ_origin);
-                       ctf_EventLog("pass", flag.team, player);
+                       ctf_EventLog("pass", TMID(flag.team), player);
                        break;
                }
 
@@ -543,8 +543,8 @@ void ctf_Handle_Capture(entity flag, entity toucher, int capturetype)
 
        switch(capturetype)
        {
-               case CAPTURE_NORMAL: ctf_EventLog("capture", enemy_flag.team, player); break;
-               case CAPTURE_DROPPED: ctf_EventLog("droppedcapture", enemy_flag.team, player); break;
+               case CAPTURE_NORMAL: ctf_EventLog("capture", TMID(enemy_flag.team), player); break;
+               case CAPTURE_DROPPED: ctf_EventLog("droppedcapture", TMID(enemy_flag.team), player); break;
                default: break;
        }
 
@@ -589,7 +589,7 @@ void ctf_Handle_Return(entity flag, entity player)
                Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT(flag, INFO_CTF_RETURN), player.netname);
        }
        _sound(player, CH_TRIGGER, flag.snd_flag_returned, VOL_BASE, ATTEN_NONE);
-       ctf_EventLog("return", flag.team, player);
+       ctf_EventLog("return", TMID(flag.team), player);
 
        // scoring
        if(IS_PLAYER(player))
@@ -600,7 +600,7 @@ void ctf_Handle_Return(entity flag, entity player)
                nades_GiveBonus(player,autocvar_g_nades_bonus_score_medium);
        }
 
-       TeamScore_AddToTeam(flag.team, ST_SCORE, -autocvar_g_ctf_score_penalty_returned); // punish the team who was last carrying it
+       TeamScore_AddToTeam(TMID(flag.team), ST_SCORE, -autocvar_g_ctf_score_penalty_returned); // punish the team who was last carrying it
 
        if(flag.ctf_dropper)
        {
@@ -656,21 +656,21 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype)
        if(ctf_stalemate) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER); }
        if(!flag.team) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_PICKUP_NEUTRAL); }
        else if(CTF_DIFFTEAM(player, flag)) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT(flag, CENTER_CTF_PICKUP)); }
-       else { Send_Notification(NOTIF_ONE, player, MSG_CENTER, ((SAME_TEAM(player, flag)) ? CENTER_CTF_PICKUP_TEAM : CENTER_CTF_PICKUP_TEAM_ENEMY), Team_ColorCode(flag.team)); }
+       else { Send_Notification(NOTIF_ONE, player, MSG_CENTER, ((SAME_TEAM(player, flag)) ? CENTER_CTF_PICKUP_TEAM : CENTER_CTF_PICKUP_TEAM_ENEMY), Team_ColorCode(TMID(flag.team))); }
 
-       Send_Notification(NOTIF_TEAM_EXCEPT, player, MSG_CHOICE, ((flag.team) ? APP_TEAM_ENT(flag, CHOICE_CTF_PICKUP_TEAM) : CHOICE_CTF_PICKUP_TEAM_NEUTRAL), Team_ColorCode(player.team), player.netname);
+       Send_Notification(NOTIF_TEAM_EXCEPT, player, MSG_CHOICE, ((flag.team) ? APP_TEAM_ENT(flag, CHOICE_CTF_PICKUP_TEAM) : CHOICE_CTF_PICKUP_TEAM_NEUTRAL), Team_ColorCode(TMID(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), LAMBDA(Send_Notification(NOTIF_ONE, it, MSG_CHOICE, CHOICE_CTF_PICKUP_ENEMY_NEUTRAL, Team_ColorCode(TMID(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_ENT(flag, CHOICE_CTF_PICKUP_TEAM), Team_ColorCode(player.team), player.netname);
+                               Send_Notification(NOTIF_ONE, it, MSG_CHOICE, APP_TEAM_ENT(flag, CHOICE_CTF_PICKUP_TEAM), Team_ColorCode(TMID(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);
-               ));
+                               Send_Notification(NOTIF_ONE, it, MSG_CHOICE, ((SAME_TEAM(flag, player)) ? CHOICE_CTF_PICKUP_ENEMY_TEAM : CHOICE_CTF_PICKUP_ENEMY), Team_ColorCode(TMID(player.team)), player.netname);
+               });
 
        _sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTEN_NONE);
 
@@ -682,7 +682,7 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype)
                case PICKUP_BASE:
                {
                        PlayerTeamScore_AddScore(player, autocvar_g_ctf_score_pickup_base);
-                       ctf_EventLog("steal", flag.team, player);
+                       ctf_EventLog("steal", TMID(flag.team), player);
                        break;
                }
 
@@ -692,7 +692,7 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype)
                        pickup_dropped_score = floor((autocvar_g_ctf_score_pickup_dropped_late * (1 - pickup_dropped_score) + autocvar_g_ctf_score_pickup_dropped_early * pickup_dropped_score) + 0.5);
                        LOG_TRACE("pickup_dropped_score is ", ftos(pickup_dropped_score), "\n");
                        PlayerTeamScore_AddScore(player, pickup_dropped_score);
-                       ctf_EventLog("pickup", flag.team, player);
+                       ctf_EventLog("pickup", TMID(flag.team), player);
                        break;
                }
 
@@ -741,7 +741,7 @@ void ctf_CheckFlagReturn(entity flag, int returntype)
                                        { Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_TIMEOUT) : INFO_CTF_FLAGRETURN_TIMEOUT_NEUTRAL)); break; }
                        }
                        _sound(flag, CH_TRIGGER, flag.snd_flag_respawn, VOL_BASE, ATTEN_NONE);
-                       ctf_EventLog("returned", flag.team, world);
+                       ctf_EventLog("returned", TMID(flag.team), world);
                        ctf_RespawnFlag(flag);
                }
        }
@@ -780,7 +780,7 @@ void ctf_CheckStalemate()
                        tmp_entity.ctf_staleflagnext = ctf_staleflaglist; // link flag into staleflaglist
                        ctf_staleflaglist = tmp_entity;
 
-                       switch(tmp_entity.team)
+                       switch(TMID(tmp_entity.team))
                        {
                                case NUM_TEAM_1: ++stale_red_flags; break;
                                case NUM_TEAM_2: ++stale_blue_flags; break;
@@ -813,7 +813,7 @@ void ctf_CheckStalemate()
                        if((tmp_entity.owner) && (!tmp_entity.owner.wps_enemyflagcarrier))
                        {
                                entity wp = WaypointSprite_Spawn(((ctf_oneflag) ? WP_FlagCarrier : WP_FlagCarrierEnemy), 0, 0, tmp_entity.owner, FLAG_WAYPOINT_OFFSET, world, 0, tmp_entity.owner, wps_enemyflagcarrier, true, RADARICON_FLAG);
-                               wp.colormod = WPCOLOR_ENEMYFC(tmp_entity.owner.team);
+                               wp.colormod = WPCOLOR_ENEMYFC(TMID(tmp_entity.owner.team));
                                tmp_entity.owner.wps_enemyflagcarrier.customizeentityforclient = ctf_Stalemate_Customize;
                        }
                }
@@ -1167,7 +1167,7 @@ void ctf_DelayedFlagSetup() // called after a flag is placed on a map by ctf_Fla
 
        // waypointsprites
        entity basename;
-       switch (self.team)
+       switch (TMID(self.team))
        {
                case NUM_TEAM_1: basename = WP_FlagBaseRed; break;
                case NUM_TEAM_2: basename = WP_FlagBaseBlue; break;
@@ -1177,8 +1177,8 @@ void ctf_DelayedFlagSetup() // called after a flag is placed on a map by ctf_Fla
        }
 
        entity wp = WaypointSprite_SpawnFixed(basename, self.origin + FLAG_WAYPOINT_OFFSET, self, wps_flagbase, RADARICON_FLAG);
-       wp.colormod = ((self.team) ? Team_ColorRGB(self.team) : '1 1 1');
-       WaypointSprite_UpdateTeamRadar(self.wps_flagbase, RADARICON_FLAG, ((self.team) ? colormapPaletteColor(self.team - 1, false) : '1 1 1'));
+       wp.colormod = ((TMID(self.team)) ? Team_ColorRGB(TMID(self.team)) : '1 1 1');
+       WaypointSprite_UpdateTeamRadar(self.wps_flagbase, RADARICON_FLAG, ((TMID(self.team)) ? colormapPaletteColor(TMID(self.team) - 1, false) : '1 1 1'));
 
        // captureshield setup
        ctf_CaptureShield_Spawn(self);
@@ -1198,7 +1198,7 @@ void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag e
        setattachment(flag, world, "");
 
        flag.netname = strzone(sprintf("%s%s^7 flag", Team_ColorCode(teamnumber), Team_ColorName_Upper(teamnumber)));
-       flag.team = teamnumber;
+       flag.__team = teamnumber;
        flag.classname = "item_flag_team";
        flag.target = "###item###"; // wut?
        flag.flags = FL_ITEM | FL_NOTARGET;
@@ -1995,11 +1995,11 @@ MUTATOR_HOOKFUNCTION(ctf, PlayerPreThink)
        // scan through all the flags and notify the client about them
        for(flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext)
        {
-               if(flag.team == NUM_TEAM_1) { t = CTF_RED_FLAG_CARRYING;                t2 = CTF_RED_FLAG_TAKEN;                t3 = CTF_RED_FLAG_LOST; }
-               if(flag.team == NUM_TEAM_2) { t = CTF_BLUE_FLAG_CARRYING;               t2 = CTF_BLUE_FLAG_TAKEN;               t3 = CTF_BLUE_FLAG_LOST; }
-               if(flag.team == NUM_TEAM_3) { t = CTF_YELLOW_FLAG_CARRYING;     t2 = CTF_YELLOW_FLAG_TAKEN;             t3 = CTF_YELLOW_FLAG_LOST; }
-               if(flag.team == NUM_TEAM_4) { t = CTF_PINK_FLAG_CARRYING;               t2 = CTF_PINK_FLAG_TAKEN;               t3 = CTF_PINK_FLAG_LOST; }
-               if(flag.team == 0)                      { t = CTF_NEUTRAL_FLAG_CARRYING;        t2 = CTF_NEUTRAL_FLAG_TAKEN;    t3 = CTF_NEUTRAL_FLAG_LOST; self.ctf_flagstatus |= CTF_FLAG_NEUTRAL; }
+               if(TMID(flag.team) == NUM_TEAM_1) { t = CTF_RED_FLAG_CARRYING;      t2 = CTF_RED_FLAG_TAKEN;     t3 = CTF_RED_FLAG_LOST; }
+               if(TMID(flag.team) == NUM_TEAM_2) { t = CTF_BLUE_FLAG_CARRYING;     t2 = CTF_BLUE_FLAG_TAKEN;    t3 = CTF_BLUE_FLAG_LOST; }
+               if(TMID(flag.team) == NUM_TEAM_3) { t = CTF_YELLOW_FLAG_CARRYING;   t2 = CTF_YELLOW_FLAG_TAKEN;  t3 = CTF_YELLOW_FLAG_LOST; }
+               if(TMID(flag.team) == NUM_TEAM_4) { t = CTF_PINK_FLAG_CARRYING;     t2 = CTF_PINK_FLAG_TAKEN;    t3 = CTF_PINK_FLAG_LOST; }
+               if(TMID(flag.team) == 0)          { t = CTF_NEUTRAL_FLAG_CARRYING;  t2 = CTF_NEUTRAL_FLAG_TAKEN; t3 = CTF_NEUTRAL_FLAG_LOST; self.ctf_flagstatus |= CTF_FLAG_NEUTRAL; }
 
                switch(flag.ctf_status)
                {
@@ -2219,7 +2219,7 @@ MUTATOR_HOOKFUNCTION(ctf, HelpMePing)
        }
        else // create a normal help me waypointsprite
        {
-               WaypointSprite_Spawn(WP_Helpme, waypointsprite_deployed_lifetime, waypointsprite_limitedrange, self, FLAG_WAYPOINT_OFFSET, world, self.team, self, wps_helpme, false, RADARICON_HELPME);
+               WaypointSprite_Spawn(WP_Helpme, waypointsprite_deployed_lifetime, waypointsprite_limitedrange, self, FLAG_WAYPOINT_OFFSET, world, TMID(self.team), self, wps_helpme, false, RADARICON_HELPME);
                WaypointSprite_Ping(self.wps_helpme);
        }
 
@@ -2374,15 +2374,15 @@ MUTATOR_HOOKFUNCTION(ctf, SV_ParseClientCommand)
                        }
                }
 
-               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
-                       if(it.flagcarried && (it.team == _team || _team == 0))
+               FOREACH_CLIENT(IS_PLAYER(it), {
+                       if(it.flagcarried && (TMID(it.team) == _team || _team == 0))
                        {
                                found = true;
                                if(_team == 0 && IS_SPEC(self) && self.enemy == it)
                                        continue; // already spectating this fc, try another
                                return superspec_Spectate(it);
                        }
-               ));
+               });
 
                if(!found)
                        superspec_msg("", "", self, "No active flag carrier\n", 1);
@@ -2507,7 +2507,7 @@ spawnfunc(ctf_team)
        if(!g_ctf) { remove(self); return; }
 
        self.classname = "ctf_team";
-       self.team = self.cnt + 1;
+       self.__team = self.cnt + 1;
 }
 
 // compatibility for quake maps
@@ -2560,9 +2560,9 @@ void ctf_DelayedInit() // Do this check with a delay so we can wait for teams to
        entity tmp_entity;
        for(tmp_entity = ctf_worldflaglist; tmp_entity; tmp_entity = tmp_entity.ctf_worldflagnext)
        {
-               if(tmp_entity.team == NUM_TEAM_3) { ctf_teams = max(3, ctf_teams); }
-               if(tmp_entity.team == NUM_TEAM_4) { ctf_teams = max(4, ctf_teams); }
-               if(tmp_entity.team == 0) { ctf_oneflag = true; }
+               if (TMID(tmp_entity.team) == NUM_TEAM_3) { ctf_teams = max(3, ctf_teams); }
+               if (TMID(tmp_entity.team) == NUM_TEAM_4) { ctf_teams = max(4, ctf_teams); }
+               if (TMID(tmp_entity.team) == 0) { ctf_oneflag = true; }
        }
 
        ctf_teams = bound(2, ctf_teams, 4);
index 56111a34d7b795cb42935458cdda8766dc39f6b2..4313a472f0b096bfd62912a3b76ea20151f96838 100644 (file)
@@ -107,7 +107,7 @@ void dompoint_captured ()
        real_team = self.cnt;
        self.cnt = -1;
 
-       dom_EventLog("taken", self.team, self.dmg_inflictor);
+       dom_EventLog("taken", TMID(self.team), self.dmg_inflictor);
        self.dmg_inflictor = world;
 
        self.goalentity = head;
@@ -147,16 +147,16 @@ void dompoint_captured ()
 
        // do trigger work
        old_delay = self.delay;
-       old_team = self.team;
-       self.team = real_team;
+       old_team = TMID(self.team);
+       self.__team = real_team;
        self.delay = 0;
        activator = self;
        SUB_UseTargets ();
        self.delay = old_delay;
-       self.team = old_team;
+       self.__team = old_team;
 
        entity msg = WP_DomNeut;
-       switch(self.team)
+       switch(TMID(self.team))
        {
                case NUM_TEAM_1: msg = WP_DomRed; break;
                case NUM_TEAM_2: msg = WP_DomBlue; break;
@@ -168,7 +168,7 @@ void dompoint_captured ()
 
        total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0;
        for(head = world; (head = find(head, classname, "dom_controlpoint")) != world; )
-       FOREACH_ENTITY_CLASS("dom_controlpoint", true, LAMBDA(
+       FOREACH_ENTITY_CLASS("dom_controlpoint", true, {
                if (autocvar_g_domination_point_amt)
                        points = autocvar_g_domination_point_amt;
                else
@@ -177,7 +177,7 @@ void dompoint_captured ()
                        wait_time = autocvar_g_domination_point_rate;
                else
                        wait_time = it.wait;
-               switch(it.goalentity.team)
+               switch(TMID(it.goalentity.team))
                {
                        case NUM_TEAM_1: pps_red += points/wait_time; break;
                        case NUM_TEAM_2: pps_blue += points/wait_time; break;
@@ -185,9 +185,9 @@ void dompoint_captured ()
                        case NUM_TEAM_4: pps_pink += points/wait_time; break;
                }
                total_pps += points/wait_time;
-       ));
+       });
 
-       WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_DOMPOINT, colormapPaletteColor(self.goalentity.team - 1, 0));
+       WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_DOMPOINT, colormapPaletteColor(TMID(self.goalentity.team) - 1, 0));
        WaypointSprite_Ping(self.sprite);
 
        self.captime = time;
@@ -238,8 +238,8 @@ void dompointthink()
                        fragamt = autocvar_g_domination_point_amt;
                else
                        fragamt = self.frags;
-               TeamScore_AddToTeam(self.goalentity.team, ST_SCORE, fragamt);
-               TeamScore_AddToTeam(self.goalentity.team, ST_DOM_TICKS, fragamt);
+               TeamScore_AddToTeam(TMID(self.goalentity.team), ST_SCORE, fragamt);
+               TeamScore_AddToTeam(TMID(self.goalentity.team), ST_DOM_TICKS, fragamt);
 
                // give credit to the individual player, if he is still there
                if (self.enemy.playerid == self.enemy_playerid)
@@ -277,7 +277,7 @@ void dompointtouch()
 
        self.team = self.goalentity.team; // this stores the PREVIOUS team!
 
-       self.cnt = other.team;
+       self.cnt = TMID(other.team);
        self.owner = head; // team to switch to after the delay
        self.dmg_inflictor = other;
 
@@ -372,10 +372,10 @@ void Domination_count_controlpoints()
        for(e = world; (e = find(e, classname, "dom_controlpoint")) != world; )
        {
                ++total_controlpoints;
-               redowned += (e.goalentity.team == NUM_TEAM_1);
-               blueowned += (e.goalentity.team == NUM_TEAM_2);
-               yellowowned += (e.goalentity.team == NUM_TEAM_3);
-               pinkowned += (e.goalentity.team == NUM_TEAM_4);
+               redowned    += (TMID(e.goalentity.team) == NUM_TEAM_1);
+               blueowned   += (TMID(e.goalentity.team) == NUM_TEAM_2);
+               yellowowned += (TMID(e.goalentity.team) == NUM_TEAM_3);
+               pinkowned   += (TMID(e.goalentity.team) == NUM_TEAM_4);
        }
 }
 
@@ -479,7 +479,7 @@ MUTATOR_HOOKFUNCTION(dom, GetTeamCount)
        {
                if(head.netname != "")
                {
-                       switch(head.team)
+                       switch(TMID(head.team))
                        {
                                case NUM_TEAM_1: c1 = 0; break;
                                case NUM_TEAM_2: c2 = 0; break;
@@ -600,7 +600,7 @@ spawnfunc(dom_team)
        self.modelindex = 0;
        // this would have to be changed if used in quakeworld
        if(self.cnt)
-               self.team = self.cnt + 1; // WHY are these different anyway?
+               self.__team = self.cnt + 1; // WHY are these different anyway?
 }
 
 // scoreboard setup
@@ -649,7 +649,7 @@ void dom_spawnteam (string teamname, float teamcolor, string pointmodel, float p
        self.model = "";
        self.modelindex = 0;
        // this would have to be changed if used in quakeworld
-       self.team = self.cnt + 1;
+       self.__team = self.cnt + 1;
 
        //eprint(self);
        setself(this);
index a451cf88adf4ae86c1a1923224d16170eec9bad3..967c7cadb81fe6d2cfedd244d27581805e2a39fc 100644 (file)
@@ -72,15 +72,15 @@ void freezetag_ScoreRules(float teams)
 void freezetag_count_alive_players()
 {
        total_players = redalive = bluealive = yellowalive = pinkalive = 0;
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
-               switch(it.team)
+       FOREACH_CLIENT(IS_PLAYER(it), {
+               switch(TMID(it.team))
                {
                        case NUM_TEAM_1: ++total_players; if(it.health >= 1 && STAT(FROZEN, it) != 1) ++redalive; break;
                        case NUM_TEAM_2: ++total_players; if(it.health >= 1 && STAT(FROZEN, it) != 1) ++bluealive; break;
                        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(
                it.redalive_stat = redalive;
                it.bluealive_stat = bluealive;
index 7b2972c84c5b07be474e905fc62c06012e15e76d..29cfbd94730b821ebff2b849294a3fd38857e1fd 100644 (file)
@@ -152,7 +152,7 @@ void invasion_SpawnChosenMonster(float mon)
        if(spawn_point && spawn_point.target_range) monster.target_range = spawn_point.target_range;
 
        if(teamplay)
-       if(spawn_point && spawn_point.team && inv_monsters_perteam[spawn_point.team] > 0)
+       if(spawn_point && spawn_point.team && inv_monsters_perteam[TMID(spawn_point.team)] > 0)
                monster.team = spawn_point.team;
        else
        {
@@ -162,7 +162,7 @@ void invasion_SpawnChosenMonster(float mon)
                if(invasion_teams >= 3) if(inv_monsters_perteam[NUM_TEAM_3] > 0) { RandomSelection_Add(world, NUM_TEAM_3, string_null, 1, 1); }
                if(invasion_teams >= 4) if(inv_monsters_perteam[NUM_TEAM_4] > 0) { RandomSelection_Add(world, NUM_TEAM_4, string_null, 1, 1); }
 
-               monster.team = RandomSelection_chosen_float;
+               monster.__team = RandomSelection_chosen_float;
        }
 
        if(teamplay)
@@ -171,9 +171,9 @@ void invasion_SpawnChosenMonster(float mon)
 
                if(monster.sprite)
                {
-                       WaypointSprite_UpdateTeamRadar(monster.sprite, RADARICON_DANGER, ((monster.team) ? Team_ColorRGB(monster.team) : '1 0 0'));
+                       WaypointSprite_UpdateTeamRadar(monster.sprite, RADARICON_DANGER, ((monster.team) ? Team_ColorRGB(TMID(monster.team)) : '1 0 0'));
 
-                       monster.sprite.team = 0;
+                       monster.sprite.__team = 0;
                        monster.sprite.SendFlags |= 1;
                }
        }
@@ -205,7 +205,7 @@ float Invasion_CheckWinner()
 
        float total_alive_monsters = 0, supermonster_count = 0, red_alive = 0, blue_alive = 0, yellow_alive = 0, pink_alive = 0;
 
-       FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, LAMBDA(
+       FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, {
                if(it.health > 0)
                {
                        if((get_monsterinfo(it.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER)
@@ -213,7 +213,7 @@ float Invasion_CheckWinner()
                        ++total_alive_monsters;
 
                        if(teamplay)
-                       switch(it.team)
+                       switch(TMID(it.team))
                        {
                                case NUM_TEAM_1: ++red_alive; break;
                                case NUM_TEAM_2: ++blue_alive; break;
@@ -221,7 +221,7 @@ float Invasion_CheckWinner()
                                case NUM_TEAM_4: ++pink_alive; break;
                        }
                }
-       ));
+       });
 
        if((total_alive_monsters + inv_numkilled) < inv_maxspawned && inv_maxcurrent < inv_maxspawned)
        {
@@ -335,7 +335,7 @@ MUTATOR_HOOKFUNCTION(inv, MonsterDies)
        {
                inv_numkilled += 1;
                inv_maxcurrent -= 1;
-               if(teamplay) { inv_monsters_perteam[frag_target.team] -= 1; }
+               if(teamplay) { inv_monsters_perteam[TMID(frag_target.team)] -= 1; }
 
                if(IS_PLAYER(frag_attacker))
                if(SAME_TEAM(frag_attacker, frag_target)) // in non-teamplay modes, same team = same player, so this works
@@ -344,7 +344,7 @@ MUTATOR_HOOKFUNCTION(inv, MonsterDies)
                {
                        PlayerScore_Add(frag_attacker, SP_KILLS, +1);
                        if(teamplay)
-                               TeamScore_AddToTeam(frag_attacker.team, ST_INV_KILLS, +1);
+                               TeamScore_AddToTeam(TMID(frag_attacker.team), ST_INV_KILLS, +1);
                }
        }
 
index 28270b88525074edfb781efc9fb9448289aa4614..c536048f29b4e81719b07c71c72cbcc892673f9e 100644 (file)
@@ -106,7 +106,7 @@ void ka_RespawnBall() // runs whenever the ball needs to be relocated
        Send_Effect(EFFECT_ELECTRO_COMBO, oldballorigin, '0 0 0', 1);
        Send_Effect(EFFECT_ELECTRO_COMBO, self.origin, '0 0 0', 1);
 
-       WaypointSprite_Spawn(WP_KaBall, 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
+       WaypointSprite_Spawn(WP_KaBall, 0, 0, self, '0 0 64', world, TMID(self.team), self, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
        WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);
 
        sound(self, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
@@ -216,7 +216,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        // PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
 
        // waypoints
-       WaypointSprite_Spawn(WP_KaBall, 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
+       WaypointSprite_Spawn(WP_KaBall, 0, 0, ball, '0 0 64', world, TMID(ball.team), ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
        WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
        WaypointSprite_Ping(ball.waypointsprite_attachedforcarrier);
        WaypointSprite_Kill(plyr.waypointsprite_attachedforcarrier);
index 8e0bcd8ee8a89e751911ba90962e935c6166a870..bc59c89bebce375b166a2d71f36338565674c3e5 100644 (file)
@@ -187,7 +187,7 @@ void kh_update_state()
        FOR_EACH_KH_KEY(key)
        {
                if(key.owner)
-                       f = key.team;
+                       f = TMID(key.team);
                else
                        f = 30;
                s |= pow(32, key.count) * f;
@@ -414,16 +414,16 @@ void kh_Key_AssignTo(entity key, entity player)  // runs every time a key is pic
                {
                        // player is now a key carrier
                        entity wp = WaypointSprite_AttachCarrier(WP_Null, player, RADARICON_FLAGCARRIER);
-                       wp.colormod = colormapPaletteColor(player.team - 1, 0);
+                       wp.colormod = colormapPaletteColor(TMID(player.team) - 1, 0);
                        player.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = kh_KeyCarrier_waypointsprite_visible_for_player;
-                       WaypointSprite_UpdateRule(player.waypointsprite_attachedforcarrier, player.team, SPRITERULE_TEAMPLAY);
-                       if(player.team == NUM_TEAM_1)
+                       WaypointSprite_UpdateRule(player.waypointsprite_attachedforcarrier, TMID(player.team), SPRITERULE_TEAMPLAY);
+                       if (TMID(player.team) == NUM_TEAM_1)
                                WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, WP_KeyCarrierRed, WP_KeyCarrierFriend, WP_KeyCarrierRed);
-                       else if(player.team == NUM_TEAM_2)
+                       else if (TMID(player.team) == NUM_TEAM_2)
                                WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, WP_KeyCarrierBlue, WP_KeyCarrierFriend, WP_KeyCarrierBlue);
-                       else if(player.team == NUM_TEAM_3)
+                       else if (TMID(player.team) == NUM_TEAM_3)
                                WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, WP_KeyCarrierYellow, WP_KeyCarrierFriend, WP_KeyCarrierYellow);
-                       else if(player.team == NUM_TEAM_4)
+                       else if (TMID(player.team) == NUM_TEAM_4)
                                WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, WP_KeyCarrierPink, WP_KeyCarrierFriend, WP_KeyCarrierPink);
                        if(!kh_no_radar_circles)
                                WaypointSprite_Ping(player.waypointsprite_attachedforcarrier);
@@ -441,7 +441,7 @@ void kh_Key_AssignTo(entity key, entity player)  // runs every time a key is pic
                if(ownerteam != -1)
                {
                        kh_interferemsg_time = time + 0.2;
-                       kh_interferemsg_team = player.team;
+                       kh_interferemsg_team = TMID(player.team);
 
                        // audit all key carrier sprites, update them to RUN HERE
                        FOR_EACH_KH_KEY(k)
@@ -494,7 +494,7 @@ void kh_Key_Collect(entity key, entity player)  //a player picks up a dropped ke
 {
        sound(player, CH_TRIGGER, SND_KH_COLLECT, VOL_BASE, ATTEN_NORM);
 
-       if(key.kh_dropperteam != player.team)
+       if(key.kh_dropperteam != TMID(player.team))
        {
                kh_Scores_Event(player, key, "collect", autocvar_g_balance_keyhunt_score_collect, 0);
                PlayerScore_Add(player, SP_KH_PICKUPS, 1);
@@ -650,7 +650,7 @@ void kh_LoserTeam(float teem, entity lostkey)  // runs when a player pushes a fl
 
        attacker = world;
        if(lostkey.pusher)
-               if(lostkey.pusher.team != teem)
+               if(TMID(lostkey.pusher.team) != teem)
                        if(IS_PLAYER(lostkey.pusher))
                                attacker = lostkey.pusher;
 
@@ -670,10 +670,10 @@ void kh_LoserTeam(float teem, entity lostkey)  // runs when a player pushes a fl
                float of, fragsleft, i, j, thisteam;
                of = autocvar_g_balance_keyhunt_score_destroyed_ownfactor;
 
-               FOREACH_CLIENT(IS_PLAYER(it) && it.team != teem, LAMBDA(++players));
+               FOREACH_CLIENT(IS_PLAYER(it) && TMID(it.team) != teem, ++players);
 
                FOR_EACH_KH_KEY(key)
-                       if(key.owner && key.team != teem)
+                       if(key.owner && TMID(key.team) != teem)
                                ++keys;
 
                if(lostkey.kh_previous_owner)
@@ -686,7 +686,7 @@ void kh_LoserTeam(float teem, entity lostkey)  // runs when a player pushes a fl
                DistributeEvenly_Init(autocvar_g_balance_keyhunt_score_destroyed, keys * of + players);
 
                FOR_EACH_KH_KEY(key)
-                       if(key.owner && key.team != teem)
+                       if(key.owner && TMID(key.team) != teem)
                        {
                                f = DistributeEvenly_Get(of);
                                kh_Scores_Event(key.owner, world, "destroyed_holdingkey", f, 0);
@@ -703,16 +703,16 @@ void kh_LoserTeam(float teem, entity lostkey)  // runs when a player pushes a fl
                                continue;
 
                        players = 0;
-                       FOREACH_CLIENT(IS_PLAYER(it) && it.team == thisteam, LAMBDA(++players));
+                       FOREACH_CLIENT(IS_PLAYER(it) && TMID(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) && TMID(it.team) == thisteam, {
                                f = DistributeEvenly_Get(1);
                                kh_Scores_Event(it, world, "destroyed", f, 0);
-                       ));
+                       });
 
                        --j;
                }
@@ -742,7 +742,7 @@ void kh_Key_Think()  // runs all the time
        // if in nodrop or time over, end the round
        if(!self.owner)
                if(time > self.pain_finished)
-                       kh_LoserTeam(self.team, self);
+                       kh_LoserTeam(TMID(self.team), self);
 
        if(self.owner)
        if(kh_Key_AllOwnedByWhichTeam() != -1)
@@ -759,22 +759,22 @@ void kh_Key_Think()  // runs all the time
                FOR_EACH_KH_KEY(key)
                        if(vlen(key.owner.origin - p) > autocvar_g_balance_keyhunt_maxdist)
                                goto not_winning;
-               kh_WinnerTeam(self.team);
+               kh_WinnerTeam(TMID(self.team));
 :not_winning
        }
 
        if(kh_interferemsg_time && time > kh_interferemsg_time)
        {
                kh_interferemsg_time = 0;
-               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
-                       if(it.team == kh_interferemsg_team)
+               FOREACH_CLIENT(IS_PLAYER(it), {
+                       if (TMID(it.team) == kh_interferemsg_team)
                                if(it.kh_next)
                                        Send_Notification(NOTIF_ONE, it, MSG_CENTER, CENTER_KEYHUNT_MEET);
                                else
                                        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));
-               ));
+               });
        }
 
        self.nextthink = time + 0.05;
@@ -805,10 +805,10 @@ void kh_Key_Spawn(entity initial_owner, float _angle, float i)  // runs every ti
        key.kh_dropperteam = 0;
        key.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
        setsize(key, KH_KEY_MIN, KH_KEY_MAX);
-       key.colormod = Team_ColorRGB(initial_owner.team) * KH_KEY_BRIGHTNESS;
+       key.colormod = Team_ColorRGB(TMID(initial_owner.team)) * KH_KEY_BRIGHTNESS;
        key.reset = key_reset;
 
-       switch(initial_owner.team)
+       switch(TMID(initial_owner.team))
        {
                case NUM_TEAM_1:
                        key.netname = "^1red key";
@@ -831,9 +831,9 @@ void kh_Key_Spawn(entity initial_owner, float _angle, float i)  // runs every ti
        key.kh_worldkeynext = kh_worldkeylist;
        kh_worldkeylist = key;
 
-       Send_Notification(NOTIF_ONE, initial_owner, MSG_CENTER, APP_TEAM_NUM(initial_owner.team, CENTER_KEYHUNT_START));
+       Send_Notification(NOTIF_ONE, initial_owner, MSG_CENTER, APP_TEAM_NUM(TMID(initial_owner.team), CENTER_KEYHUNT_START));
 
-       WaypointSprite_Spawn(WP_KeyDropped, 0, 0, key, '0 0 1' * KH_KEY_WP_ZSHIFT, world, key.team, key, waypointsprite_attachedforcarrier, false, RADARICON_FLAG);
+       WaypointSprite_Spawn(WP_KeyDropped, 0, 0, key, '0 0 1' * KH_KEY_WP_ZSHIFT, world, TMID(key.team), key, waypointsprite_attachedforcarrier, false, RADARICON_FLAG);
        key.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = kh_Key_waypointsprite_visible_for_player;
 
        kh_Key_AssignTo(key, initial_owner);
@@ -853,8 +853,8 @@ float kh_Key_AllOwnedByWhichTeam()  // constantly called. check to see if all th
                if(!key.owner)
                        return -1;
                if(teem == -1)
-                       teem = key.team;
-               else if(teem != key.team)
+                       teem = TMID(key.team);
+               else if(teem != TMID(key.team))
                        return -1;
                --keys;
        }
@@ -881,7 +881,7 @@ void kh_Key_DropOne(entity key)
        key.velocity = W_CalculateProjectileVelocity(player.velocity, autocvar_g_balance_keyhunt_throwvelocity * v_forward, false);
        key.pusher = world;
        key.pushltime = time + autocvar_g_balance_keyhunt_protecttime;
-       key.kh_dropperteam = key.team;
+       key.kh_dropperteam = TMID(key.team);
 
        sound(player, CH_TRIGGER, SND_KH_DROP, VOL_BASE, ATTEN_NORM);
 }
@@ -907,7 +907,7 @@ void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies
                        key.pusher = mypusher;
                        key.pushltime = time + autocvar_g_balance_keyhunt_protecttime;
                        if(suicide)
-                               key.kh_dropperteam = player.team;
+                               key.kh_dropperteam = TMID(player.team);
                }
                sound(player, CH_TRIGGER, SND_KH_DROP, VOL_BASE, ATTEN_NORM);
        }
@@ -919,10 +919,10 @@ float kh_CheckPlayers(float num)
        {
                float t_team = kh_Team_ByID(num);
                float players = 0;
-               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
-                       if(!IS_DEAD(it) && !PHYS_INPUT_BUTTON_CHAT(it) && it.team == t_team)
+               FOREACH_CLIENT(IS_PLAYER(it), {
+                       if(!IS_DEAD(it) && !PHYS_INPUT_BUTTON_CHAT(it) && TMID(it.team) == t_team)
                                ++players;
-               ));
+               });
 
                if (!players) { return t_team; }
        }
@@ -1005,14 +1005,14 @@ void kh_StartRound()  // runs at the start of each round
                teem = kh_Team_ByID(i);
                players = 0;
                entity my_player = world;
-               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
-                       if(!IS_DEAD(it) && !PHYS_INPUT_BUTTON_CHAT(it) && it.team == teem)
+               FOREACH_CLIENT(IS_PLAYER(it), {
+                       if(!IS_DEAD(it) && !PHYS_INPUT_BUTTON_CHAT(it) && TMID(it.team) == teem)
                        {
                                ++players;
                                if(random() * players <= 1)
                                        my_player = it;
                        }
-               ));
+               });
                kh_Key_Spawn(my_player, 360 * i / kh_teams, i);
        }
 
@@ -1144,7 +1144,7 @@ void havocbot_role_kh_carrier()
                self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
                navigation_goalrating_start();
 
-               if(kh_Key_AllOwnedByWhichTeam() == self.team)
+               if(kh_Key_AllOwnedByWhichTeam() == TMID(self.team))
                        havocbot_goalrating_kh(10, 0.1, 0.1); // bring home
                else
                        havocbot_goalrating_kh(4, 4, 1); // play defensively
@@ -1183,7 +1183,7 @@ void havocbot_role_kh_defense()
                navigation_goalrating_start();
 
                key_owner_team = kh_Key_AllOwnedByWhichTeam();
-               if(key_owner_team == self.team)
+               if(key_owner_team == TMID(self.team))
                        havocbot_goalrating_kh(10, 0.1, 0.1); // defend key carriers
                else if(key_owner_team == -1)
                        havocbot_goalrating_kh(4, 1, 0.1); // play defensively
@@ -1225,7 +1225,7 @@ void havocbot_role_kh_offense()
                navigation_goalrating_start();
 
                key_owner_team = kh_Key_AllOwnedByWhichTeam();
-               if(key_owner_team == self.team)
+               if(key_owner_team == TMID(self.team))
                        havocbot_goalrating_kh(10, 0.1, 0.1); // defend anyway
                else if(key_owner_team == -1)
                        havocbot_goalrating_kh(0.1, 1, 4); // play offensively
@@ -1275,7 +1275,7 @@ void havocbot_role_kh_freelancer()
                navigation_goalrating_start();
 
                key_owner_team = kh_Key_AllOwnedByWhichTeam();
-               if(key_owner_team == self.team)
+               if(key_owner_team == TMID(self.team))
                        havocbot_goalrating_kh(10, 0.1, 0.1); // defend anyway
                else if(key_owner_team == -1)
                        havocbot_goalrating_kh(1, 10, 4); // prefer dropped keys
index 3167d603bf9798a57e0bc59f31b540da65b97646..7f2075ca954025feb23619a329d925eaa08f39d7 100644 (file)
@@ -54,7 +54,7 @@ spawnfunc(tdm_team)
        if(!g_tdm || !self.cnt) { remove(self); return; }
 
        self.classname = "tdm_team";
-       self.team = self.cnt + 1;
+       self.__team = self.cnt + 1;
 }
 
 // code from here on is just to support maps that don't have team entities
index b7c994598010e8ee036136c62833bf5e555b6dab..abc88f4c6a537cfd6d849de828fd4adca713846f 100644 (file)
@@ -59,7 +59,7 @@ bool TeamScore_SendEntity(entity this, entity to, float sendflags)
        float i, p, longflags;
 
        WriteHeader(MSG_ENTITY, ENT_CLIENT_TEAMSCORES);
-       int t = this.team - 1;
+       int t = TMID(this.team) - 1;
        assert(t, eprint(this));
        WriteByte(MSG_ENTITY, t);
 
@@ -91,7 +91,7 @@ void TeamScore_Spawn(float t, string name)
 {
        entity ts = new_pure(csqc_score_team);
        ts.netname = name; // not used yet, FIXME
-       ts.team = t;
+       ts.__team = t;
        Net_LinkEntity(ts, false, 0, TeamScore_SendEntity);
        teamscorekeepers[t - 1] = ts;
        ++teamscores_entities_count;
@@ -127,7 +127,7 @@ float TeamScore_AddToTeam(float t, float scorefield, float score)
 
 float TeamScore_Add(entity player, float scorefield, float score)
 {
-       return TeamScore_AddToTeam(player.team, scorefield, score);
+       return TeamScore_AddToTeam(TMID(player.team), scorefield, score);
 }
 
 float TeamScore_Compare(entity t1, entity t2, float strict)
@@ -144,7 +144,7 @@ float TeamScore_Compare(entity t1, entity t2, float strict)
        }
 
        if (result.x == 0 && strict)
-               result.x = t1.team - t2.team;
+               result.x = TMID(t1.team) - TMID(t2.team);
 
        return result.x;
 }
@@ -682,8 +682,8 @@ float PlayerTeamScore_Compare(entity p1, entity p2, float teams, float strict)
                {
                        entity t1, t2;
                        float r;
-                       t1 = teamscorekeepers[p1.team - 1];
-                       t2 = teamscorekeepers[p2.team - 1];
+                       t1 = teamscorekeepers[TMID(p1.team) - 1];
+                       t2 = teamscorekeepers[TMID(p2.team) - 1];
                        r = TeamScore_Compare(t1, t2, ((teams >= 0) ? 1 : strict));
                        return r;
                }
@@ -891,10 +891,10 @@ void Score_NicePrint(entity to)
        while(p)
        {
                if(teamscores_entities_count)
-                       if(t != p.team)
-                               Score_NicePrint_Team(to, p.team, w);
+                       if(t != TMID(p.team))
+                               Score_NicePrint_Team(to, TMID(p.team), w);
                Score_NicePrint_Player(to, p, w);
-               t = p.team;
+               t = TMID(p.team);
                p = p.chain;
        }
 
index 0692d90886521cabe42d84eb1477b32aff438cc6..05c6ae7de0827644f701ab79695018da15db2a8c 100644 (file)
@@ -14,7 +14,7 @@ bool SpawnPoint_Send(entity this, entity to, int sf)
 {
        WriteHeader(MSG_ENTITY, ENT_CLIENT_SPAWNPOINT);
 
-       WriteByte(MSG_ENTITY, self.team);
+       WriteByte(MSG_ENTITY, TMID(self.team));
        WriteCoord(MSG_ENTITY, self.origin.x);
        WriteCoord(MSG_ENTITY, self.origin.y);
        WriteCoord(MSG_ENTITY, self.origin.z);
@@ -104,14 +104,14 @@ void relocate_spawnpoint()
     self.use = spawnpoint_use;
     self.think = spawnpoint_think;
     self.nextthink = time + 0.5 + random() * 2; // shouldn't need it for a little second
-    self.team_saved = self.team;
+    self.team_saved = TMID(self.team);
     if (!self.cnt)
         self.cnt = 1;
 
     if (have_team_spawns != 0)
         if (self.team)
             have_team_spawns = 1;
-    have_team_spawns_forteam[self.team] = 1;
+    have_team_spawns_forteam[TMID(self.team)] = 1;
 
     if (autocvar_r_showbboxes)
     {
@@ -130,20 +130,20 @@ void relocate_spawnpoint()
                !(
                        ( // if this passes, there is a DM spawn on a team match
                                teamplay
-                               && (self.team != NUM_TEAM_1)
-                               && (self.team != NUM_TEAM_2)
-                               && (self.team != NUM_TEAM_3)
-                               && (self.team != NUM_TEAM_4)
+                               && (TMID(self.team) != NUM_TEAM_1)
+                               && (TMID(self.team) != NUM_TEAM_2)
+                               && (TMID(self.team) != NUM_TEAM_3)
+                               && (TMID(self.team) != NUM_TEAM_4)
                        )
                        ||
                        ( // if this passes, there is a team spawn on a DM match
                                !teamplay
                                &&
                                (
-                                       (self.team == NUM_TEAM_1)
-                                       || (self.team == NUM_TEAM_2)
-                                       || (self.team == NUM_TEAM_3)
-                                       || (self.team == NUM_TEAM_4)
+                                          (TMID(self.team) == NUM_TEAM_1)
+                                       || (TMID(self.team) == NUM_TEAM_2)
+                                       || (TMID(self.team) == NUM_TEAM_3)
+                                       || (TMID(self.team) == NUM_TEAM_4)
                                )
                        )
                )
@@ -174,7 +174,7 @@ Starting point for a player in team one (Red).
 Keys: "angle" viewing angle when spawning. */
 spawnfunc(info_player_team1)
 {
-       this.team = NUM_TEAM_1; // red
+       this.__team = NUM_TEAM_1; // red
        spawnfunc_info_player_deathmatch(this);
 }
 
@@ -184,7 +184,7 @@ Starting point for a player in team two (Blue).
 Keys: "angle" viewing angle when spawning. */
 spawnfunc(info_player_team2)
 {
-       this.team = NUM_TEAM_2; // blue
+       this.__team = NUM_TEAM_2; // blue
        spawnfunc_info_player_deathmatch(this);
 }
 
@@ -193,7 +193,7 @@ Starting point for a player in team three (Yellow).
 Keys: "angle" viewing angle when spawning. */
 spawnfunc(info_player_team3)
 {
-       this.team = NUM_TEAM_3; // yellow
+       this.__team = NUM_TEAM_3; // yellow
        spawnfunc_info_player_deathmatch(this);
 }
 
@@ -203,7 +203,7 @@ Starting point for a player in team four (Purple).
 Keys: "angle" viewing angle when spawning. */
 spawnfunc(info_player_team4)
 {
-       this.team = NUM_TEAM_4; // purple
+       this.__team = NUM_TEAM_4; // purple
        spawnfunc_info_player_deathmatch(this);
 }
 
@@ -219,7 +219,7 @@ vector Spawn_Score(entity spot, float mindist, float teamcheck)
 
        // filter out spots for the wrong team
        if(teamcheck >= 0)
-               if(spot.team != teamcheck)
+               if(TMID(spot.team) != teamcheck)
                        return '-1 0 0';
 
        if(race_spawns)
@@ -345,7 +345,7 @@ entity SelectSpawnPoint (float anypoint)
                teamcheck = -1;
        else if(have_team_spawns > 0)
        {
-               if(have_team_spawns_forteam[self.team] == 0)
+               if(have_team_spawns_forteam[TMID(self.team)] == 0)
                {
                        // we request a spawn for a team, and we have team
                        // spawns, but that team has no spawns?
@@ -357,7 +357,7 @@ entity SelectSpawnPoint (float anypoint)
                                teamcheck = -1;
                }
                else
-                       teamcheck = self.team; // MUST be team
+                       teamcheck = TMID(self.team); // MUST be team
        }
        else if(have_team_spawns == 0 && have_team_spawns_forteam[0])
                teamcheck = 0; // MUST be noteam
index 34ee3277a5fa6ce755520cfe520db6f29e030fe9..d2f58d3b80de20cd95669fb368293d355ab938d9 100644 (file)
@@ -215,7 +215,7 @@ void SetPlayerTeam(entity pl, float t, float s, float noprint)
        SetPlayerColors(pl,_color);
 
        if(t != s) {
-               LogTeamchange(pl.playerid, pl.team, 3);  // log manual team join
+               LogTeamchange(pl.playerid, TMID(pl.team), 3);  // log manual team join
 
                if(!noprint)
                bprint(pl.netname, "^7 has changed from ", Team_NumberToColoredFullName(s), "^7 to ", Team_NumberToColoredFullName(t), "\n");
@@ -253,7 +253,7 @@ void CheckAllowedTeams (entity for_whom)
                entity head = find(world, classname, teament_name);
                while(head)
                {
-                       switch(head.team)
+                       switch(TMID(head.team))
                        {
                                case NUM_TEAM_1: c1 = 0; break;
                                case NUM_TEAM_2: c2 = 0; break;
@@ -314,10 +314,10 @@ 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;
+                       t = TMID(it.team);
                else if(it.team_forced > 0)
                        t = it.team_forced; // reserve the spot
                else
@@ -362,7 +362,7 @@ void GetTeamCounts(entity ignore)
                                }
                        }
                }
-       ));
+       });
 
        // if the player who has a forced team has not joined yet, reserve the spot
        if(autocvar_g_campaign)
@@ -514,14 +514,14 @@ float JoinBestTeam(entity pl, float only_return_best, float forcebestteam)
        // if he's not on a valid team, then let other code put him on the smallest team
        if(!forcebestteam)
        {
-               if(     c1 >= 0 && pl.team == NUM_TEAM_1)
-                       selectedteam = pl.team;
-               else if(c2 >= 0 && pl.team == NUM_TEAM_2)
-                       selectedteam = pl.team;
-               else if(c3 >= 0 && pl.team == NUM_TEAM_3)
-                       selectedteam = pl.team;
-               else if(c4 >= 0 && pl.team == NUM_TEAM_4)
-                       selectedteam = pl.team;
+               if(     c1 >= 0 && TMID(pl.team) == NUM_TEAM_1)
+                       selectedteam = TMID(pl.team);
+               else if(c2 >= 0 && TMID(pl.team) == NUM_TEAM_2)
+                       selectedteam = TMID(pl.team);
+               else if(c3 >= 0 && TMID(pl.team) == NUM_TEAM_3)
+                       selectedteam = TMID(pl.team);
+               else if(c4 >= 0 && TMID(pl.team) == NUM_TEAM_4)
+                       selectedteam = TMID(pl.team);
                else
                        selectedteam = -1;
 
@@ -533,7 +533,7 @@ float JoinBestTeam(entity pl, float only_return_best, float forcebestteam)
 
                                // when JoinBestTeam is called by client.qc/ClientKill_Now_TeamChange the players team is -1 and thus skipped
                                // when JoinBestTeam is called by cl_client.qc/ClientConnect the player_id is 0 the log attempt is rejected
-                               LogTeamchange(pl.playerid, pl.team, 99);
+                               LogTeamchange(pl.playerid, TMID(pl.team), 99);
                        }
                        return selectedteam;
                }
@@ -566,7 +566,7 @@ float JoinBestTeam(entity pl, float only_return_best, float forcebestteam)
                        error("smallest team: invalid team\n");
                }
 
-               LogTeamchange(pl.playerid, pl.team, 2); // log auto join
+               LogTeamchange(pl.playerid, TMID(pl.team), 2); // log auto join
 
                if(!IS_DEAD(pl))
                        Damage(pl, pl, pl, 100000, DEATH_TEAMCHANGE.m_id, pl.origin, '0 0 0');
@@ -716,7 +716,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) && TMID(it.team) == steam, {
                if(it.isbot)
                {
                        if(it.totalfrags < lowest_bot_score)
@@ -733,7 +733,7 @@ void ShufflePlayerOutOfTeam (float source_team)
                                lowest_player_score = it.totalfrags;
                        }
                }
-       ));
+       });
 
        // prefers to move a bot...
        if(lowest_bot != world)
index f3e9f22ef6859a2b8e538a39e6b14be0b602c92f..39c204f9dfdd489a69d6c59850434a22088f9c5a 100644 (file)
@@ -58,7 +58,7 @@ bool CSQCProjectile_SendEntity(entity this, entity to, int sf)
                        WriteByte(MSG_ENTITY, fr);
                }
 
-               WriteByte(MSG_ENTITY, self.realowner.team);
+               WriteByte(MSG_ENTITY, TMID(self.realowner.team));
        }
 
        if(sf & 2)
index 579e6fdff74ea6793a760cebb27b43ced7940e72..f84734bd45d22983ded3a5a30865a35d39e376fc 100644 (file)
@@ -46,7 +46,7 @@ void weapon_defaultspawnfunc(entity this, Weapon e)
                int t = tokenize_console(s);
                if (t >= 2)
                {
-                       this.team = --internalteam;
+                       this.__team = --internalteam;
                        for (int i = 1; i < t; ++i)
                        {
                                s = argv(i);