]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/domination/sv_domination.qc
Clean up droptofloor() macro hacks and clarify naming
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / domination / sv_domination.qc
index 0a5daff457955b9fdd8521e029a19388b4e8bbbc..e245ff92faf92d106c613493b8df1e49824b5375 100644 (file)
@@ -32,9 +32,9 @@ void set_dom_state(entity e)
        STAT(DOM_TOTAL_PPS, e) = total_pps;
        STAT(DOM_PPS_RED, e) = pps_red;
        STAT(DOM_PPS_BLUE, e) = pps_blue;
-       if(domination_teams >= 3)
+       if(domination_teams & BIT(2))
                STAT(DOM_PPS_YELLOW, e) = pps_yellow;
-       if(domination_teams >= 4)
+       if(domination_teams & BIT(3))
                STAT(DOM_PPS_PINK, e) = pps_pink;
 }
 
@@ -183,7 +183,7 @@ void dompointthink(entity this)
                TeamScore_AddToTeam(this.goalentity.team, ST_SCORE, fragamt);
                TeamScore_AddToTeam(this.goalentity.team, ST_DOM_TICKS, fragamt);
 
-               // give credit to the individual player, if he is still there
+               // give credit to the individual player, if they are still there
                if (this.enemy.playerid == this.enemy_playerid)
                {
                        GameRules_scoring_add(this.enemy, SCORE, fragamt);
@@ -297,9 +297,9 @@ void dom_controlpoint_setup(entity this)
        if(!this.flags & FL_ITEM)
                IL_PUSH(g_items, this);
        this.flags = FL_ITEM;
-       setsize(this, '-32 -32 -32', '32 32 32');
+       setsize(this, '-48 -48 -32', '48 48 32'); // 0.8.6 used '-32 -32 -32', '32 32 32' with sv_legacy_bbox_expand 1 and FL_ITEM
        setorigin(this, this.origin + '0 0 20');
-       droptofloor(this);
+       DropToFloor_QC_DelayedInit(this);
 
        waypoint_spawnforitem(this);
        WaypointSprite_SpawnFixed(WP_DomNeut, this.origin + '0 0 32', this, sprite, RADARICON_DOMPOINT);
@@ -487,6 +487,23 @@ spawnfunc(dom_controlpoint)
        IL_PUSH(g_dompoints, this);
 }
 
+       // Quake Live CP
+/*QUAKED team_dom_point (0 .2 1) (-16 -16 0) (16 16 88)
+Domination capture point.
+-------- KEYS --------
+identifier : Set to 1, 2, or 3 to match to point 'A', 'B', or 'C'.
+count : Adjust the range of the capture point (in units, eg: 64, 128... etc).
+target : Target name for multiple info_player_deathmatch entities (to allow spawning near that particular dom point).
+-------- NOTES --------
+Do not assign a 'gametype' key to this item. It is used in all four team game types. The game will call for it as needed.
+-------- MODEL FOR RADIANT ONLY - DO NOT SET THIS AS A KEY --------
+model="models/powerups/domination/dompoint.md3"
+*/
+spawnfunc(team_dom_point)
+{
+       spawnfunc_dom_controlpoint(this);
+}
+
 /*QUAKED spawnfunc_dom_team (0 .5 .8) (-32 -32 -24) (32 32 32)
 Team declaration for Domination gameplay, this allows you to decide what team
 names and control point models are used in your map.
@@ -601,9 +618,9 @@ void dom_spawnteams(int teams)
        TC(int, teams);
        dom_spawnteam(Team_ColoredFullName(NUM_TEAM_1), NUM_TEAM_1-1, "models/domination/dom_red.md3", 0, SND_DOM_CLAIM, "", "Red team has captured a control point");
        dom_spawnteam(Team_ColoredFullName(NUM_TEAM_2), NUM_TEAM_2-1, "models/domination/dom_blue.md3", 0, SND_DOM_CLAIM, "", "Blue team has captured a control point");
-       if(teams >= 3)
+       if(teams & BIT(2))
                dom_spawnteam(Team_ColoredFullName(NUM_TEAM_3), NUM_TEAM_3-1, "models/domination/dom_yellow.md3", 0, SND_DOM_CLAIM, "", "Yellow team has captured a control point");
-       if(teams >= 4)
+       if(teams & BIT(3))
                dom_spawnteam(Team_ColoredFullName(NUM_TEAM_4), NUM_TEAM_4-1, "models/domination/dom_pink.md3", 0, SND_DOM_CLAIM, "", "Pink team has captured a control point");
        dom_spawnteam("", 0, "models/domination/dom_unclaimed.md3", 0, SND_Null, "", "");
 }
@@ -617,14 +634,15 @@ void dom_DelayedInit(entity this) // Do this check with a delay so we can wait f
                domination_teams = autocvar_g_domination_teams_override;
                if (domination_teams < 2)
                        domination_teams = autocvar_g_domination_default_teams;
-               domination_teams = bound(2, domination_teams, 4);
+               domination_teams = BITS(bound(2, domination_teams, 4));
                dom_spawnteams(domination_teams);
        }
-
-       entity balance = TeamBalance_CheckAllowedTeams(NULL);
-       int teams = TeamBalance_GetAllowedTeams(balance);
-       TeamBalance_Destroy(balance);
-       domination_teams = teams;
+       else
+       {
+               entity balance = TeamBalance_CheckAllowedTeams(NULL);
+               domination_teams = TeamBalance_GetAllowedTeams(balance);
+               TeamBalance_Destroy(balance);
+       }
 
        domination_roundbased = autocvar_g_domination_roundbased;