]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
rename teamplay_default to teamplay_mode, stop using the "teamplay" cvar (more cleanu...
authorRudolf Polzer <divverent@alientrap.org>
Sat, 4 Dec 2010 14:10:27 +0000 (15:10 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 4 Dec 2010 14:10:27 +0000 (15:10 +0100)
15 files changed:
defaultXonotic.cfg
qcsrc/client/View.qc
qcsrc/common/constants.qh
qcsrc/server/autocvars.qh
qcsrc/server/cl_client.qc
qcsrc/server/ctf.qc
qcsrc/server/domination.qc
qcsrc/server/g_damage.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/monsters/mode_management.qc
qcsrc/server/sv_main.qc
qcsrc/server/teamplay.qc
qcsrc/server/tturrets/system/system_damage.qc
qcsrc/server/w_minelayer.qc
qcsrc/server/w_rocketlauncher.qc

index 16b30d8161378e299c554bf4342c86373d0acf4b..6ec248453f27756272bfd0e4682b05772edde2b3 100644 (file)
@@ -637,7 +637,7 @@ seta timelimit_suddendeath 5 "number of minutes suddendeath mode lasts after all
 // common team values
 set g_tdm 0 "Team Deathmatch: the team who kills their opponents most often wins"
 
-seta teamplay_default 4 "default teamplay setting in team games. 1 = no friendly fire, self damage. 2 = friendly fire and self damage enabled. 3 = no friendly fire, but self damage enabled. 4 = obey the following four cvars"
+seta teamplay_mode 4 "default teamplay setting in team games. 1 = no friendly fire, self damage. 2 = friendly fire and self damage enabled. 3 = no friendly fire, but self damage enabled. 4 = obey the following four cvars"
 seta g_mirrordamage 0.300000   "for teamplay 4: mirror damage factor"
 seta g_friendlyfire 0.100000   "for teamplay 4: fiendly fire factor"
 seta g_teamdamage_threshold 50 "for teamplay 4: threshold over which to apply mirror damage"
index 3f8cd6c71e76a06d81948bd18e0271009b5bec72..e640e906d9977d099fdefe7e145268cb5da35c65 100644 (file)
@@ -479,7 +479,7 @@ void CSQC_UpdateView(float w, float h)
 
        ColorTranslateMode = cvar("cl_stripcolorcodes");
        activeweapon = getstati(STAT_SWITCHWEAPON);
-       f = cvar("teamplay");
+       f = (serverflags & SERVERFLAG_TEAMPLAY);
        if(f != teamplay)
        {
                teamplay = f;
index b3929c7cda9ffc057e2a6dd495bea87eac8e5d9e..50abe9875e0899dae8da1a549b0639511ee6aa83 100644 (file)
@@ -660,3 +660,4 @@ string HUD_PANELNAME_INFOMESSAGES   = "infomessages";
 float HUD_MENU_ENABLE          = 0;
 
 #define SERVERFLAG_ALLOW_FULLBRIGHT 1
+#define SERVERFLAG_TEAMPLAY 2
index 6d79ebe30bd622e426295c956eb669f78a21c4ec..a9c5233537df2ba1f371462e5f0600ed045e0cb5 100644 (file)
@@ -1,4 +1,4 @@
 float autocvar_sv_cheats;
 float autocvar_g_bastet;
-float autocvar_teamplay;
+float autocvar_teamplay_mode;
 var float autocvar_g_movement_highspeed = 1;
index 173ef23064ceb645c2f4f2de0de85c1b3cfd465a..3a416375b3874eb41a6593fb8933e9a5813bb4d6 100644 (file)
@@ -1619,9 +1619,6 @@ void ClientConnect (void)
        // get other cvars from player
        GetCvars(0);
 
-       // set cvar for team scoreboard
-       stuffcmd(self, strcat("set teamplay ", ftos(autocvar_teamplay), "\n"));
-
        // notify about available teams
        if(teams_matter)
        {
index a6d31ca57a01da68d842917532ca8aa7686d0fc4..4bc47b9a2dfd5f1477c986f3e7be19fc1192e3f5 100644 (file)
@@ -775,9 +775,6 @@ void spawnfunc_item_flag_team1()
                return;
        }
 
-       //if(!cvar("teamplay"))
-       //      cvar_set("teamplay", "3");
-
        // link flag into ctf_worldflaglist
        self.ctf_worldflagnext = ctf_worldflaglist;
        ctf_worldflaglist = self;
@@ -875,8 +872,6 @@ void spawnfunc_item_flag_team2()
                remove(self);
                return;
        }
-       //if(!cvar("teamplay"))
-       //      cvar_set("teamplay", "3");
 
        // link flag into ctf_worldflaglist
        self.ctf_worldflagnext = ctf_worldflaglist;
index 9742da1ecdc6701fa3016fb118e16aa5a7840b19..10fc2a1ab4aa190bbfa09c83ed37b75c51e650f5 100644 (file)
@@ -648,9 +648,5 @@ void dom_init()
        precache_model("models/domination/dom_unclaimed.md3");
        precache_sound("domination/claim.wav");
        InitializeEntity(world, dom_delayedinit, INITPRIO_GAMETYPE);
-
-       // teamplay is always on in domination, defaults to hurt self but not teammates
-       //if(!teams_matter)
-       //      cvar_set("teamplay", "3");
 };
 
index 3bec2ebc8d87a2616c6fa192446ae57349946fa8..8998c6afbc16c9771c894a30f776e35e8a6bc3b9 100644 (file)
@@ -537,15 +537,15 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                damage = 0;
                                force = '0 0 0';
                        }
-                       else if(attacker.team == targ.team)
+                       else if(teams_matter && attacker.team == targ.team)
                        {
-                               if(autocvar_teamplay == 1)
+                               if(autocvar_teamplay_mode == 1)
                                        damage = 0;
                                else if(attacker != targ)
                                {
-                                       if(autocvar_teamplay == 3)
+                                       if(autocvar_teamplay_mode == 3)
                                                damage = 0;
-                                       else if(autocvar_teamplay == 4)
+                                       else if(autocvar_teamplay_mode == 4)
                                        {
                                                if(targ.classname == "player" && targ.deadflag == DEAD_NO)
                                                {
index a5b33acf7d4f526b0a765dbc7ef2f1f02ee44a33..fa054c1f9d372a76d8a46ad506d6cef81af6543a 100644 (file)
@@ -1171,7 +1171,6 @@ void readlevelcvars(void)
        if(cvar("g_vampire"))
                MUTATOR_ADD(mutator_vampire);
 
-       serverflags = 0;
        if(cvar("sv_allow_fullbright"))
                serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT;
 
index 9014f093813e160443e6b1e6d39d284534ca76c8..daaa76f617660180e03a9adf8509649256f7ae43 100644 (file)
@@ -163,57 +163,17 @@ string dmmessage;
 
 void(string m) setdm =
 {
-       dmmessage = m;
-       if (cvar("deathmatch") != stof(m))
-               cvar_set("deathmatch", m);
+       error("THIS MUST NOT BE CALLED IN XONOTIC");
 }
 
 void(string m) setteamplay =
 {
-       dmmessage = m;
-       if (cvar("teamplay") != stof(m))
-               cvar_set("teamplay", m);
+       error("THIS MUST NOT BE CALLED IN XONOTIC");
 }
 
 void() mode_updatecvars =
 {
-       local float dm, tp;
-       dm = cvar("deathmatch");
-       tp = cvar("teamplay");
-       // now set deathmatch cvar
-       if (dm ==  0) setdm("0?Dark Places - Coop");
-       else if (dm ==  1) setdm("1?Dark Places - Deathmatch");
-       else if (dm ==  2) setdm("2?Dark Places - Deathmatch 2 (can only pickup gun once)");
-       else if (dm ==  3) setdm("3?Dark Places - Deathmatch 3 (quick ammo respawn)");
-       else if (dm ==  5) setdm("5?Dark Places - Frag Fest (spawn with full pack)");
-//     else if (dm ==  6) setdm("6?Dark Places - Random Weapons (spawn with 2 random weapons)"); // removed
-       else if (dm ==  7) setdm("7?Dark Places - Monsters");
-//     else if (dm ==  8) setdm("8?Dark Places - Elimination");
-//     else if (dm ==  9) setdm("9?Dark Places - Kill The Leader Mode");
-       else if (dm == 10) setdm("10?Dark Places - Capture The Flag - 2 Team");
-       else if (dm == 11) setdm("11?Dark Places - Capture The Flag - 3 Team");
-       else if (dm == 12) setdm("12?Dark Places - Domination");
-       else if (dm == 13) setdm("13?Dark Places - Monster Capture The Flag - 2 Team");
-       else if (dm == 14) setdm("14?Dark Places - Super Domination");
-       else if (dm == 30) setdm("30?Dark Places - Role Playing Game");
-       else                               setdm("1?Dark Places - Deathmatch");
-
-       // now set teamplay cvar
-       if (dm == 0) setteamplay("4?Dark Places - Coop (Can't hurt other players)");
-       //else if (dm == 8) setteamplay("3?Dark Places - Elimination");
-       //else if (dm == 9) setteamplay("3?Dark Places - Kill The Leader");
-       else if (dm == 10) setteamplay("3?Dark Places - Capture The Flag - 2 Team");
-       else if (dm == 11) setteamplay("3?Dark Places - Capture The Flag - 3 Team");
-       else if (dm == 12) setteamplay("3?Dark Places - Domination");
-       else if (dm == 13) setteamplay("3?Dark Places - Monster Capture The Flag - 2 Team");
-       else
-       {
-               if (tp == 0) setteamplay("0?Dark Places - No Teamplay");
-               else if (tp == 1) setteamplay("1?Dark Places - No team damage");
-               else if (tp == 2) setteamplay("2?Dark Places - Can hurt anyone");
-               else if (tp == 3) setteamplay("3?Dark Places - No team damage, but can hurt self");
-               else              setteamplay("0?Dark Places - No Teamplay");
-       }
+       error("THIS MUST NOT BE CALLED IN XONOTIC");
 };
 
 float nextcvarupdate;
index aef4031b7e1cd26f6de3e29c6a920986f9971fe9..0a170635b877781576890064bff53e450ce4dda7 100644 (file)
@@ -182,11 +182,6 @@ void StartFrame (void)
        if (timeoutStatus == 1) // just before the timeout (when timeoutStatus will be 2)
                orig_slowmo = cvar("slowmo"); // slowmo will be restored after the timeout
 
-       if(teams_matter && !autocvar_teamplay)
-               cvar_set("teamplay", "3"); // this also updates the autocvar
-       if(!teams_matter && autocvar_teamplay)
-               cvar_set("teamplay", "0"); // this also updates the autocvar
-
        skill = cvar("skill");
 
        Spawnqueue_Check();
index d7a73f7d65f648f9cb41345ea500c79bdab50530..b001e4a4a2cd46f00f542860a6ca63f9482be4be 100644 (file)
@@ -162,9 +162,7 @@ void ActivateTeamplay()
 {
        float teamplay_default;
 
-       teamplay_default = cvar_or("teamplay_default", 3);
-       cvar_set("teamplay", teamplay_default);
-
+       serverflags |= SERVERFLAG_TEAMPLAY;
        teams_matter = 1;
 }
 
@@ -177,7 +175,6 @@ void InitGameplayMode()
        VoteReset();
 
        teams_matter = 0;
-       cvar_set("teamplay", "0");
 
        // make sure only ONE type is selected
        ReadGameCvars();
index 4e9c8a7621943063508275f36f140ca83e011cfe..fdeb4dd5ccb1a757d9b3af95a99be20b05e4fa15 100644 (file)
@@ -269,7 +269,7 @@ void turret_stdproc_damage (entity inflictor, entity attacker, float damage, flo
     if not (self.tur_active)
         return;
 
-    if (autocvar_teamplay != 0)
+    if (teams_matter)
     if (self.team == attacker.team)
     {
         // This does not happen anymore. Re-enable if you fix that.
index 8e0548ecf9029d842fd5582701de271e238c02ed..225fa5ebab22df27b768b26a0feacfb01ba25bfd 100644 (file)
@@ -314,9 +314,9 @@ float w_minelayer(float req)
                        }
                        float desirabledamage;
                        desirabledamage = enemydamage;
-                       if (autocvar_teamplay != 1 && time > self.invincible_finished && time > self.spawnshieldtime)
+                       if (time > self.invincible_finished && time > self.spawnshieldtime)
                                desirabledamage = desirabledamage - selfdamage * cvar("g_balance_selfdamagepercent");
-                       if (self.team && autocvar_teamplay != 1)
+                       if (teams_matter && self.team)
                                desirabledamage = desirabledamage - teamdamage;
 
                        mine = find(world, classname, "mine");
index 9efd46d79dd68a9ec81bccdfe456acde947ec119..969f54bdbe8a4cda2521280df35b303f02b8d5d3 100644 (file)
@@ -349,9 +349,9 @@ float w_rlauncher(float req)
                        }
                        local float desirabledamage;
                        desirabledamage = enemydamage;
-                       if (autocvar_teamplay != 1 && time > self.invincible_finished && time > self.spawnshieldtime)
+                       if (time > self.invincible_finished && time > self.spawnshieldtime)
                                desirabledamage = desirabledamage - selfdamage * cvar("g_balance_selfdamagepercent");
-                       if (self.team && autocvar_teamplay != 1)
+                       if (teams_matter && self.team)
                                desirabledamage = desirabledamage - teamdamage;
 
                        missile = find(world, classname, "rocket");