]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Apply standard code style to gametype headers and ecs code
authorbones_was_here <bones_was_here@xonotic.au>
Sun, 26 Jan 2025 10:32:29 +0000 (20:32 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Tue, 22 Apr 2025 05:38:16 +0000 (15:38 +1000)
36 files changed:
qcsrc/common/gamemodes/gamemode/assault/assault.qh
qcsrc/common/gamemodes/gamemode/assault/sv_assault.qh
qcsrc/common/gamemodes/gamemode/clanarena/clanarena.qh
qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qh
qcsrc/common/gamemodes/gamemode/ctf/ctf.qh
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qh
qcsrc/common/gamemodes/gamemode/cts/cts.qh
qcsrc/common/gamemodes/gamemode/cts/sv_cts.qh
qcsrc/common/gamemodes/gamemode/deathmatch/deathmatch.qh
qcsrc/common/gamemodes/gamemode/deathmatch/sv_deathmatch.qh
qcsrc/common/gamemodes/gamemode/domination/domination.qh
qcsrc/common/gamemodes/gamemode/duel/duel.qh
qcsrc/common/gamemodes/gamemode/duel/sv_duel.qh
qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qh
qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qh
qcsrc/common/gamemodes/gamemode/invasion/invasion.qh
qcsrc/common/gamemodes/gamemode/invasion/sv_invasion.qh
qcsrc/common/gamemodes/gamemode/keepaway/keepaway.qh
qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qh
qcsrc/common/gamemodes/gamemode/keyhunt/keyhunt.qh
qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qh
qcsrc/common/gamemodes/gamemode/lms/lms.qh
qcsrc/common/gamemodes/gamemode/lms/sv_lms.qh
qcsrc/common/gamemodes/gamemode/nexball/nexball.qh
qcsrc/common/gamemodes/gamemode/nexball/sv_nexball.qh
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qh
qcsrc/common/gamemodes/gamemode/race/race.qh
qcsrc/common/gamemodes/gamemode/race/sv_race.qh
qcsrc/common/gamemodes/gamemode/survival/survival.qh
qcsrc/common/gamemodes/gamemode/survival/sv_survival.qh
qcsrc/common/gamemodes/gamemode/tdm/sv_tdm.qh
qcsrc/common/gamemodes/gamemode/tdm/tdm.qh
qcsrc/common/gamemodes/gamemode/tka/tka.qh
qcsrc/common/gamemodes/gamemode/tmayhem/tmayhem.qh
qcsrc/ecs/systems/physics.qc
qcsrc/ecs/systems/sv_physics.qc

index c07002d8f3594585b17a4301cddb3da5934970de..f0a500e903550b78d768aa690411c4f426678b0a 100644 (file)
@@ -3,25 +3,25 @@
 #include <common/mapinfo.qh>
 
 CLASS(Assault, Gametype)
-    INIT(Assault)
-    {
-        this.gametype_init(this, _("Assault"),"as","g_assault",GAMETYPE_FLAG_TEAMPLAY,"","timelimit=20",_("Destroy obstacles to find and destroy the enemy power core before time runs out"));
-    }
-    METHOD(Assault, m_generate_mapinfo, void(Gametype this, string v))
-    {
-        if(v == "target_assault_roundend")
-            MapInfo_Map_supportedGametypes |= this.gametype_flags;
-    }
-    METHOD(Assault, m_isTwoBaseMode, bool())
-    {
-        return true;
-    }
-    METHOD(Assault, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
-    {
-        TC(Gametype, this);
-        returns(menu, _("Point limit:"),    50,  500, 10, string_null,                 string_null,                    string_null);
-    }
-    ATTRIB(Assault, m_legacydefaults, string, "20 0");
+       INIT(Assault)
+       {
+               this.gametype_init(this, _("Assault"),"as","g_assault",GAMETYPE_FLAG_TEAMPLAY,"","timelimit=20",_("Destroy obstacles to find and destroy the enemy power core before time runs out"));
+       }
+       METHOD(Assault, m_generate_mapinfo, void(Gametype this, string v))
+       {
+               if(v == "target_assault_roundend")
+                       MapInfo_Map_supportedGametypes |= this.gametype_flags;
+       }
+       METHOD(Assault, m_isTwoBaseMode, bool())
+       {
+               return true;
+       }
+       METHOD(Assault, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
+       {
+               TC(Gametype, this);
+               returns(menu, _("Point limit:"),    50,  500, 10, string_null,                 string_null,                    string_null);
+       }
+       ATTRIB(Assault, m_legacydefaults, string, "20 0");
 ENDCLASS(Assault)
 REGISTER_GAMETYPE(ASSAULT, NEW(Assault));
 #define g_assault IS_GAMETYPE(ASSAULT)
index 6e30d4d9d5054191e05d1e6a533dd77f7f24f370..803d6ec87f5240387601199b794bfdefe1e5604e 100644 (file)
@@ -13,18 +13,19 @@ IntrusiveList g_assault_objectives;
 
 REGISTER_MUTATOR(as, false)
 {
-    MUTATOR_STATIC();
+       MUTATOR_STATIC();
        MUTATOR_ONADD
        {
                g_assault_destructibles = IL_NEW();
                g_assault_objectivedecreasers = IL_NEW();
                g_assault_objectives = IL_NEW();
-        GameRules_teams(true);
-        int teams = BITS(2); // always red vs blue
-        GameRules_scoring(teams, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, {
-            field_team(ST_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
-            field(SP_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
-        });
+               GameRules_teams(true);
+               int teams = BITS(2); // always red vs blue
+               GameRules_scoring(teams, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY,
+               {
+                       field_team(ST_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
+                       field(SP_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
+               });
        }
        return 0;
 }
index b3a8635a14a396f3e55d5093a1809c627cc7e529..392786842b539b9c6c6cdd6cb5ae5d4cd84172ba 100644 (file)
@@ -7,43 +7,45 @@ void HUD_Mod_CA(vector pos, vector mySize);
 void HUD_Mod_CA_Export(int fh);
 #endif
 CLASS(ClanArena, Gametype)
-    INIT(ClanArena)
-    {
-        this.gametype_init(this, _("Clan Arena"),"ca","g_ca",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=10 teams=2 leadlimit=6",_("Kill all enemy teammates to win the round"));
-    }
-    METHOD(ClanArena, m_parse_mapinfo, bool(string k, string v))
-    {
-        if (!k) {
-            cvar_set("g_ca_teams", cvar_defstring("g_ca_teams"));
-            return true;
-        }
-        switch (k) {
-            case "teams":
-                cvar_set("g_ca_teams", v);
-                return true;
-        }
-        return false;
-    }
-    METHOD(ClanArena, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
-    {
-        if(spawnpoints >= 8 && diameter > 3250)
-            return true;
-        return false;
-    }
-    METHOD(ClanArena, m_setTeams, void(string sa))
-    {
-        cvar_set("g_ca_teams", sa);
-    }
-    METHOD(ClanArena, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
-    {
-        TC(Gametype, this);
-        returns(menu, _("Round limit:"),     5,  100,  5, "fraglimit_override",        "g_ca_teams_override",          _("The amount of rounds won needed before the match will end"));
-    }
+       INIT(ClanArena)
+       {
+               this.gametype_init(this, _("Clan Arena"),"ca","g_ca",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=10 teams=2 leadlimit=6",_("Kill all enemy teammates to win the round"));
+       }
+       METHOD(ClanArena, m_parse_mapinfo, bool(string k, string v))
+       {
+               if (!k)
+               {
+                       cvar_set("g_ca_teams", cvar_defstring("g_ca_teams"));
+                       return true;
+               }
+               switch (k)
+               {
+                       case "teams":
+                               cvar_set("g_ca_teams", v);
+                               return true;
+               }
+               return false;
+       }
+       METHOD(ClanArena, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+       {
+               if(spawnpoints >= 8 && diameter > 3250)
+                       return true;
+               return false;
+       }
+       METHOD(ClanArena, m_setTeams, void(string sa))
+       {
+               cvar_set("g_ca_teams", sa);
+       }
+       METHOD(ClanArena, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
+       {
+               TC(Gametype, this);
+               returns(menu, _("Round limit:"),     5,  100,  5, "fraglimit_override",        "g_ca_teams_override",          _("The amount of rounds won needed before the match will end"));
+       }
 #ifdef CSQC
-    ATTRIB(ClanArena, m_modicons, void(vector pos, vector mySize), HUD_Mod_CA);
-    ATTRIB(ClanArena, m_modicons_export, void(int fh), HUD_Mod_CA_Export);
+       ATTRIB(ClanArena, m_modicons, void(vector pos, vector mySize), HUD_Mod_CA);
+       ATTRIB(ClanArena, m_modicons_export, void(int fh), HUD_Mod_CA_Export);
 #endif
-    ATTRIB(ClanArena, m_legacydefaults, string, "10 20 0");
+       ATTRIB(ClanArena, m_legacydefaults, string, "10 20 0");
 ENDCLASS(ClanArena)
 REGISTER_GAMETYPE(CA, NEW(ClanArena));
 #define g_ca IS_GAMETYPE(CA)
index 3a9931e431c6bda42a895c42603c92242cf7a573..cb2d20ec04b2c0286e976f348f2c5359d6507105 100644 (file)
@@ -29,22 +29,23 @@ bool ca_isEliminated(entity e);
 
 REGISTER_MUTATOR(ca, false)
 {
-    MUTATOR_STATIC();
+       MUTATOR_STATIC();
        MUTATOR_ONADD
        {
                GameRules_teams(true);
-        GameRules_spawning_teams(autocvar_g_ca_team_spawns);
-        GameRules_limit_score(autocvar_g_ca_point_limit);
-        GameRules_limit_lead(autocvar_g_ca_point_leadlimit);
+               GameRules_spawning_teams(autocvar_g_ca_team_spawns);
+               GameRules_limit_score(autocvar_g_ca_point_limit);
+               GameRules_limit_lead(autocvar_g_ca_point_leadlimit);
 
                ca_teams = autocvar_g_ca_teams_override;
                if (ca_teams < 2)
                        ca_teams = cvar("g_ca_teams"); // read the cvar directly as it gets written earlier in the same frame
 
                ca_teams = BITS(bound(2, ca_teams, 4));
-        GameRules_scoring(ca_teams, SFL_SORT_PRIO_PRIMARY, 0, {
-            field_team(ST_CA_ROUNDS, "rounds", SFL_SORT_PRIO_PRIMARY);
-        });
+               GameRules_scoring(ca_teams, SFL_SORT_PRIO_PRIMARY, 0,
+               {
+                       field_team(ST_CA_ROUNDS, "rounds", SFL_SORT_PRIO_PRIMARY);
+               });
 
                allowed_to_spawn = true;
                g_ca_spectate_enemies = autocvar_g_ca_spectate_enemies;
index c5d15fec947da960da4feca23bd1cb04d5009062..ae53b213e4000c6e81a89fb60f28930669f57b2e 100644 (file)
@@ -7,33 +7,33 @@ void HUD_Mod_CTF(vector pos, vector mySize);
 void HUD_Mod_CTF_Reset();
 #endif
 CLASS(CaptureTheFlag, Gametype)
-    INIT(CaptureTheFlag)
-    {
-        this.gametype_init(this, _("Capture the Flag"),"ctf","g_ctf",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_PRIORITY,"","timelimit=20 caplimit=10 leadlimit=6",_("Find and bring the enemy flag to your base to capture it, defend your base from the other team"));
-    }
-    METHOD(CaptureTheFlag, m_generate_mapinfo, void(Gametype this, string v))
-    {
-        if(v == "item_flag_team2" || v == "team_CTF_blueflag")
-            MapInfo_Map_supportedGametypes |= this.gametype_flags;
-    }
-    METHOD(CaptureTheFlag, m_isTwoBaseMode, bool())
-    {
-        return true;
-    }
-    METHOD(CaptureTheFlag, m_setTeams, void(string sa))
-    {
-        cvar_set("fraglimit", sa);
-    }
-    METHOD(CaptureTheFlag, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
-    {
-        TC(Gametype, this);
-        returns(menu, _("Capture limit:"),   1,   20,  1, "capturelimit_override",     string_null,                    _("The amount of captures needed before the match will end"));
-    }
+       INIT(CaptureTheFlag)
+       {
+               this.gametype_init(this, _("Capture the Flag"),"ctf","g_ctf",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_PRIORITY,"","timelimit=20 caplimit=10 leadlimit=6",_("Find and bring the enemy flag to your base to capture it, defend your base from the other team"));
+       }
+       METHOD(CaptureTheFlag, m_generate_mapinfo, void(Gametype this, string v))
+       {
+               if(v == "item_flag_team2" || v == "team_CTF_blueflag")
+                       MapInfo_Map_supportedGametypes |= this.gametype_flags;
+       }
+       METHOD(CaptureTheFlag, m_isTwoBaseMode, bool())
+       {
+               return true;
+       }
+       METHOD(CaptureTheFlag, m_setTeams, void(string sa))
+       {
+               cvar_set("fraglimit", sa);
+       }
+       METHOD(CaptureTheFlag, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
+       {
+               TC(Gametype, this);
+               returns(menu, _("Capture limit:"),   1,   20,  1, "capturelimit_override",     string_null,                    _("The amount of captures needed before the match will end"));
+       }
 #ifdef CSQC
-    ATTRIB(CaptureTheFlag, m_modicons, void(vector pos, vector mySize), HUD_Mod_CTF);
-    ATTRIB(CaptureTheFlag, m_modicons_reset, void(), HUD_Mod_CTF_Reset);
+       ATTRIB(CaptureTheFlag, m_modicons, void(vector pos, vector mySize), HUD_Mod_CTF);
+       ATTRIB(CaptureTheFlag, m_modicons_reset, void(), HUD_Mod_CTF_Reset);
 #endif
-    ATTRIB(CaptureTheFlag, m_legacydefaults, string, "300 20 10 0");
+       ATTRIB(CaptureTheFlag, m_legacydefaults, string, "300 20 10 0");
 ENDCLASS(CaptureTheFlag)
 REGISTER_GAMETYPE(CTF, NEW(CaptureTheFlag));
 #define g_ctf IS_GAMETYPE(CTF)
index adb061809fe053f56c36f763e31fb7195e0e3928..3787c8bfbfe4ba3f298c937f0e1384f4348e6e07 100644 (file)
@@ -6,8 +6,8 @@
 #include <common/gamemodes/sv_rules.qh>
 
 CLASS(Flag, Pickup)
-    ATTRIB(Flag, m_mins, vector, (PL_MIN_CONST + '0 0 -13') * 1.4); // scaling be damned
-    ATTRIB(Flag, m_maxs, vector, (PL_MAX_CONST + '0 0 -13') * 1.4);
+       ATTRIB(Flag, m_mins, vector, (PL_MIN_CONST + '0 0 -13') * 1.4); // scaling be damned
+       ATTRIB(Flag, m_maxs, vector, (PL_MAX_CONST + '0 0 -13') * 1.4);
 ENDCLASS(Flag)
 Flag CTF_FLAG;
 void ctf_Initialize();
@@ -17,16 +17,16 @@ int autocvar_capturelimit_override;
 
 REGISTER_MUTATOR(ctf, false)
 {
-    MUTATOR_STATIC();
-    MUTATOR_ONADD
-    {
-        GameRules_teams(true);
-        GameRules_limit_score(autocvar_capturelimit_override);
-        GameRules_limit_lead(autocvar_captureleadlimit_override);
-
-        ctf_Initialize();
-    }
-    return 0;
+       MUTATOR_STATIC();
+       MUTATOR_ONADD
+       {
+               GameRules_teams(true);
+               GameRules_limit_score(autocvar_capturelimit_override);
+               GameRules_limit_lead(autocvar_captureleadlimit_override);
+
+               ctf_Initialize();
+       }
+       return 0;
 }
 
 // used in cheats.qc
index c677ff6021b5369d09754acff3aec25e2912b485..87ecd23ac61773534ae9229c66d05890e291beca 100644 (file)
@@ -6,31 +6,31 @@
 #endif
 
 CLASS(RaceCTS, Gametype)
-    INIT(RaceCTS)
-    {
-        this.gametype_init(this, _("Race CTS"),"cts","g_cts",0,"cloaked","timelimit=20",_("Race for fastest time."));
-    }
-    METHOD(RaceCTS, m_generate_mapinfo, void(Gametype this, string v))
-    {
-        if(v == "target_startTimer")
-            MapInfo_Map_supportedGametypes |= this.gametype_flags;
-    }
-    METHOD(RaceCTS, m_setTeams, void(string sa))
-    {
-        // this is the skill of the map
-        // not parsed by anything yet
-        // for map databases
-        //  cvar_set("fraglimit", sa);
-    }
-    METHOD(RaceCTS, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
-    {
-        TC(Gametype, this);
-        returns(menu, _("Point limit:"),    50,  500, 10, string_null,                 string_null,                    string_null);
-    }
+       INIT(RaceCTS)
+       {
+               this.gametype_init(this, _("Race CTS"),"cts","g_cts",0,"cloaked","timelimit=20",_("Race for fastest time."));
+       }
+       METHOD(RaceCTS, m_generate_mapinfo, void(Gametype this, string v))
+       {
+               if(v == "target_startTimer")
+                       MapInfo_Map_supportedGametypes |= this.gametype_flags;
+       }
+       METHOD(RaceCTS, m_setTeams, void(string sa))
+       {
+               // this is the skill of the map
+               // not parsed by anything yet
+               // for map databases
+               //  cvar_set("fraglimit", sa);
+       }
+       METHOD(RaceCTS, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
+       {
+               TC(Gametype, this);
+               returns(menu, _("Point limit:"),    50,  500, 10, string_null,                 string_null,                    string_null);
+       }
 #ifdef CSQC
-    ATTRIB(RaceCTS, m_modicons, void(vector pos, vector mySize), HUD_Mod_Race);
+       ATTRIB(RaceCTS, m_modicons, void(vector pos, vector mySize), HUD_Mod_Race);
 #endif
-    ATTRIB(RaceCTS, m_legacydefaults, string, "20 0 0");
+       ATTRIB(RaceCTS, m_legacydefaults, string, "20 0 0");
 ENDCLASS(RaceCTS)
 REGISTER_GAMETYPE(CTS, NEW(RaceCTS));
 #define g_cts IS_GAMETYPE(CTS)
index 371f7a250efcbe0042d507bdae8eb3fcbf2bd52b..e4dce946762ea327af6ed804dceccb5be72da436 100644 (file)
@@ -7,13 +7,13 @@ void cts_Initialize();
 
 REGISTER_MUTATOR(cts, false)
 {
-    MUTATOR_STATIC();
+       MUTATOR_STATIC();
        MUTATOR_ONADD
        {
                g_race_qualifying = 1;
                independent_players = 1;
-        GameRules_limit_score(0);
-        GameRules_limit_lead(0);
+               GameRules_limit_score(0);
+               GameRules_limit_lead(0);
 
                cts_Initialize();
        }
index ca55a3b872beb806c170d81e7ce2adf807390407..88ee25d7b4d50e487c041f454a22608c8682b569 100644 (file)
@@ -3,14 +3,14 @@
 #include <common/mapinfo.qh>
 
 CLASS(Deathmatch, Gametype)
-    INIT(Deathmatch)
-    {
-        this.gametype_init(this, _("Deathmatch"),"dm","g_dm",GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_PREFERRED,"","timelimit=15 pointlimit=30 leadlimit=0",_("Score as many frags as you can"));
-    }
-    METHOD(Deathmatch, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
-    {
-        return true;
-    }
-    ATTRIB(Deathmatch, m_legacydefaults, string, "30 20 0");
+       INIT(Deathmatch)
+       {
+               this.gametype_init(this, _("Deathmatch"),"dm","g_dm",GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_PREFERRED,"","timelimit=15 pointlimit=30 leadlimit=0",_("Score as many frags as you can"));
+       }
+       METHOD(Deathmatch, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+       {
+               return true;
+       }
+       ATTRIB(Deathmatch, m_legacydefaults, string, "30 20 0");
 ENDCLASS(Deathmatch)
 REGISTER_GAMETYPE(DEATHMATCH, NEW(Deathmatch));
index c08d5f87a1f5844e27d397a79aa14067a934f2b2..d1219c652beb9357ffa75acd171cf50c66525ec1 100644 (file)
@@ -3,6 +3,6 @@
 #include <common/mutators/base.qh>
 REGISTER_MUTATOR(dm, false)
 {
-    MUTATOR_STATIC();
+       MUTATOR_STATIC();
        return 0;
 }
index 3117c2980e43c172da10d9de8d02fb15007183f5..d4ef60482f779619d84d29cef2b5294f7b982770 100644 (file)
@@ -7,37 +7,39 @@ void HUD_Mod_Dom(vector pos, vector mySize);
 void HUD_Mod_Dom_Export(int fh);
 #endif
 CLASS(Domination, Gametype)
-    INIT(Domination)
-    {
-        this.gametype_init(this, _("Domination"),"dom","g_domination",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=200 teams=2 leadlimit=0",_("Capture and defend all the control points to win"));
-    }
-    METHOD(Domination, m_parse_mapinfo, bool(string k, string v))
-    {
-        if (!k) {
-            cvar_set("g_domination_default_teams", cvar_defstring("g_domination_default_teams"));
-            return true;
-        }
-        switch (k) {
-            case "teams":
-                cvar_set("g_domination_default_teams", v);
-                return true;
-        }
-        return false;
-    }
-    METHOD(Domination, m_generate_mapinfo, void(Gametype this, string v))
-    {
-        if(v == "dom_controlpoint" || v == "team_dom_point")
-            MapInfo_Map_supportedGametypes |= this.gametype_flags;
-    }
-    METHOD(Domination, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
-    {
-        TC(Gametype, this);
-        returns(menu, _("Point limit:"),    50,  500, 10, "g_domination_point_limit",  "g_domination_teams_override",  _("The amount of points needed before the match will end"));
-    }
+       INIT(Domination)
+       {
+               this.gametype_init(this, _("Domination"),"dom","g_domination",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=200 teams=2 leadlimit=0",_("Capture and defend all the control points to win"));
+       }
+       METHOD(Domination, m_parse_mapinfo, bool(string k, string v))
+       {
+               if (!k)
+               {
+                       cvar_set("g_domination_default_teams", cvar_defstring("g_domination_default_teams"));
+                       return true;
+               }
+               switch (k)
+               {
+                       case "teams":
+                               cvar_set("g_domination_default_teams", v);
+                               return true;
+               }
+               return false;
+       }
+       METHOD(Domination, m_generate_mapinfo, void(Gametype this, string v))
+       {
+               if(v == "dom_controlpoint" || v == "team_dom_point")
+                       MapInfo_Map_supportedGametypes |= this.gametype_flags;
+       }
+       METHOD(Domination, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
+       {
+               TC(Gametype, this);
+               returns(menu, _("Point limit:"),    50,  500, 10, "g_domination_point_limit",  "g_domination_teams_override",  _("The amount of points needed before the match will end"));
+       }
 #ifdef CSQC
-    ATTRIB(Domination, m_modicons, void(vector pos, vector mySize), HUD_Mod_Dom);
-    ATTRIB(Domination, m_modicons_export, void(int fh), HUD_Mod_Dom_Export);
+       ATTRIB(Domination, m_modicons, void(vector pos, vector mySize), HUD_Mod_Dom);
+       ATTRIB(Domination, m_modicons_export, void(int fh), HUD_Mod_Dom_Export);
 #endif
-    ATTRIB(Domination, m_legacydefaults, string, "200 20 0");
+       ATTRIB(Domination, m_legacydefaults, string, "200 20 0");
 ENDCLASS(Domination)
 REGISTER_GAMETYPE(DOMINATION, NEW(Domination));
index 316b6c341ec1584466495724d2569c8fd39b0871..5435fe6169f416c9a446be0d0178db7853af5fac 100644 (file)
@@ -4,25 +4,25 @@
 #include <common/mapinfo.qh>
 
 CLASS(Duel, Gametype)
-    INIT(Duel)
-    {
-        this.gametype_init(this, _("Duel"),"duel","g_duel",GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_1V1,"","timelimit=10 pointlimit=0 leadlimit=0",_("Fight in a one versus one arena battle to decide the winner"));
-    }
-    METHOD(Duel, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
-    {
-        return (diameter < 3250);
-    }
-    METHOD(Duel, m_isForcedSupported, bool(Gametype this))
-    {
-        if(!cvar("g_duel_not_dm_maps"))
-        {
-            // if this is set, all DM maps support duel too
-            // TODO: we should really check the size of maps, some DM maps do not work for duel!
-            if(!(MapInfo_Map_supportedGametypes & this.gametype_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.gametype_flags))
-                return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
-        }
-        return false;
-    }
+       INIT(Duel)
+       {
+               this.gametype_init(this, _("Duel"),"duel","g_duel",GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_1V1,"","timelimit=10 pointlimit=0 leadlimit=0",_("Fight in a one versus one arena battle to decide the winner"));
+       }
+       METHOD(Duel, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+       {
+               return (diameter < 3250);
+       }
+       METHOD(Duel, m_isForcedSupported, bool(Gametype this))
+       {
+               if(!cvar("g_duel_not_dm_maps"))
+               {
+                       // if this is set, all DM maps support duel too
+                       // TODO: we should really check the size of maps, some DM maps do not work for duel!
+                       if(!(MapInfo_Map_supportedGametypes & this.gametype_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.gametype_flags))
+                               return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
+               }
+               return false;
+       }
 ENDCLASS(Duel)
 REGISTER_GAMETYPE(DUEL, NEW(Duel));
 #define g_duel IS_GAMETYPE(DUEL)
index d255c9b3532ebcd37db5c849abd668979a0bd7aa..2d7b16b365361da5feb2a87ae6d526d17645d477 100644 (file)
@@ -3,7 +3,7 @@
 #include <common/mutators/base.qh>
 REGISTER_MUTATOR(duel, false)
 {
-    MUTATOR_STATIC();
+       MUTATOR_STATIC();
        return 0;
 }
 
index f1723757a6024d1d0a92ed5dfbd16f26995dcd60..f8bfa25b7d57bfca02bd89c32cae3d4efca2f57b 100644 (file)
@@ -10,43 +10,45 @@ void HUD_Mod_FreezeTag(vector myPos, vector mySize);
 void HUD_Mod_FreezeTag_Export(int fh);
 #endif
 CLASS(FreezeTag, Gametype)
-    INIT(FreezeTag)
-    {
-        this.gametype_init(this, _("Freeze Tag"),"ft","g_freezetag",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=10 teams=2 leadlimit=6",_("Kill enemies to freeze them, stand next to frozen teammates to revive them; freeze all enemies to win"));
-    }
-    METHOD(FreezeTag, m_parse_mapinfo, bool(string k, string v))
-    {
-        if (!k) {
-            cvar_set("g_freezetag_teams", cvar_defstring("g_freezetag_teams"));
-            return true;
-        }
-        switch (k) {
-            case "teams":
-                cvar_set("g_freezetag_teams", v);
-                return true;
-        }
-        return false;
-    }
-    METHOD(FreezeTag, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
-    {
-        if(spawnpoints >= 8 && diameter > 3250)
-            return true;
-        return false;
-    }
-    METHOD(FreezeTag, m_setTeams, void(string sa))
-    {
-        cvar_set("g_freezetag_teams", sa);
-    }
-    METHOD(FreezeTag, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
-    {
-        TC(Gametype, this);
-        returns(menu, _("Round limit:"),     5,  100,  5, "fraglimit_override",        "g_freezetag_teams_override",   _("The amount of rounds won needed before the match will end"));
-    }
+       INIT(FreezeTag)
+       {
+               this.gametype_init(this, _("Freeze Tag"),"ft","g_freezetag",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=10 teams=2 leadlimit=6",_("Kill enemies to freeze them, stand next to frozen teammates to revive them; freeze all enemies to win"));
+       }
+       METHOD(FreezeTag, m_parse_mapinfo, bool(string k, string v))
+       {
+               if (!k)
+               {
+                       cvar_set("g_freezetag_teams", cvar_defstring("g_freezetag_teams"));
+                       return true;
+               }
+               switch (k)
+               {
+                       case "teams":
+                               cvar_set("g_freezetag_teams", v);
+                               return true;
+               }
+               return false;
+       }
+       METHOD(FreezeTag, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+       {
+               if(spawnpoints >= 8 && diameter > 3250)
+                       return true;
+               return false;
+       }
+       METHOD(FreezeTag, m_setTeams, void(string sa))
+       {
+               cvar_set("g_freezetag_teams", sa);
+       }
+       METHOD(FreezeTag, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
+       {
+               TC(Gametype, this);
+               returns(menu, _("Round limit:"),     5,  100,  5, "fraglimit_override",        "g_freezetag_teams_override",   _("The amount of rounds won needed before the match will end"));
+       }
 #ifdef CSQC
-    ATTRIB(FreezeTag, m_modicons, void(vector pos, vector mySize), HUD_Mod_FreezeTag);
-    ATTRIB(FreezeTag, m_modicons_export, void(int fh), HUD_Mod_FreezeTag_Export);
+       ATTRIB(FreezeTag, m_modicons, void(vector pos, vector mySize), HUD_Mod_FreezeTag);
+       ATTRIB(FreezeTag, m_modicons_export, void(int fh), HUD_Mod_FreezeTag_Export);
 #endif
-    ATTRIB(FreezeTag, m_legacydefaults, string, "10 20 0");
+       ATTRIB(FreezeTag, m_legacydefaults, string, "10 20 0");
 ENDCLASS(FreezeTag)
 REGISTER_GAMETYPE(FREEZETAG, NEW(FreezeTag));
 #define g_freezetag IS_GAMETYPE(FREEZETAG)
index f760331dfb94ed6eb75a5a2057e5d67c715b1647..b0f595d7e8749f102108583877fc0995b2f447d1 100644 (file)
@@ -14,13 +14,13 @@ void freezetag_Initialize();
 
 REGISTER_MUTATOR(ft, false)
 {
-    MUTATOR_STATIC();
+       MUTATOR_STATIC();
        MUTATOR_ONADD
        {
                GameRules_teams(true);
-        GameRules_spawning_teams(autocvar_g_freezetag_team_spawns);
-        GameRules_limit_score(autocvar_g_freezetag_point_limit);
-        GameRules_limit_lead(autocvar_g_freezetag_point_leadlimit);
+               GameRules_spawning_teams(autocvar_g_freezetag_team_spawns);
+               GameRules_limit_score(autocvar_g_freezetag_point_limit);
+               GameRules_limit_lead(autocvar_g_freezetag_point_leadlimit);
 
                freezetag_Initialize();
        }
index 71f6b7d143486643813969527f5c231359c971a8..6c2aad4698ac2ce431a34a0860fb8d58391e764f 100644 (file)
@@ -3,28 +3,29 @@
 #include <common/mapinfo.qh>
 
 CLASS(Invasion, Gametype)
-    INIT(Invasion)
-    {
-        this.gametype_init(this, _("Invasion"),"inv","g_invasion",GAMETYPE_FLAG_USEPOINTS,"","pointlimit=50 type=0",_("Survive against waves of monsters"));
-    }
-    METHOD(Invasion, m_parse_mapinfo, bool(string k, string v))
-    {
-        switch (k) {
-            case "type":
-                cvar_set("g_invasion_type", v);
-                return true;
-        }
-        return false;
-    }
-    METHOD(Invasion, m_generate_mapinfo, void(Gametype this, string v))
-    {
-        if(v == "invasion_spawnpoint")
-            MapInfo_Map_supportedGametypes |= this.gametype_flags;
-    }
-    METHOD(Invasion, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
-    {
-        TC(Gametype, this);
-        returns(menu, _("Point limit:"),    50,  500, 10, string_null,                 string_null,                    string_null);
-    }
+       INIT(Invasion)
+       {
+               this.gametype_init(this, _("Invasion"),"inv","g_invasion",GAMETYPE_FLAG_USEPOINTS,"","pointlimit=50 type=0",_("Survive against waves of monsters"));
+       }
+       METHOD(Invasion, m_parse_mapinfo, bool(string k, string v))
+       {
+               switch (k)
+               {
+                       case "type":
+                               cvar_set("g_invasion_type", v);
+                               return true;
+               }
+               return false;
+       }
+       METHOD(Invasion, m_generate_mapinfo, void(Gametype this, string v))
+       {
+               if(v == "invasion_spawnpoint")
+                       MapInfo_Map_supportedGametypes |= this.gametype_flags;
+       }
+       METHOD(Invasion, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
+       {
+               TC(Gametype, this);
+               returns(menu, _("Point limit:"),    50,  500, 10, string_null,                 string_null,                    string_null);
+       }
 ENDCLASS(Invasion)
 REGISTER_GAMETYPE(INVASION, NEW(Invasion));
index 9d01851a93bddce830da24f10994d66ced731d24..0134ed5d7fb5ccb12b7055e5622ecff61746e9e8 100644 (file)
@@ -11,13 +11,13 @@ void invasion_Initialize();
 
 REGISTER_MUTATOR(inv, false)
 {
-    MUTATOR_STATIC();
+       MUTATOR_STATIC();
        MUTATOR_ONADD
        {
                g_invasion_roundends = IL_NEW();
                g_invasion_waves = IL_NEW();
                g_invasion_spawns = IL_NEW();
-        GameRules_limit_score(autocvar_g_invasion_point_limit);
+               GameRules_limit_score(autocvar_g_invasion_point_limit);
 
                g_invasion = true;
                cvar_settemp("g_monsters", "1");
index 3aac451d1c0b2804f1109135483ab57085139684..00dfa3c8930de02bc2d51e51db46c0dd4fe65dbb 100644 (file)
@@ -6,16 +6,16 @@
 void HUD_Mod_Keepaway(vector pos, vector mySize);
 #endif
 CLASS(Keepaway, Gametype)
-    INIT(Keepaway)
-    {
-        this.gametype_init(this, _("Keepaway"),"ka","g_keepaway",GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=30",_("Hold the ball to get points for kills"));
-    }
-    METHOD(Keepaway, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
-    {
-        return true;
-    }
+       INIT(Keepaway)
+       {
+               this.gametype_init(this, _("Keepaway"),"ka","g_keepaway",GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=30",_("Hold the ball to get points for kills"));
+       }
+       METHOD(Keepaway, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+       {
+               return true;
+       }
 #ifdef CSQC
-    ATTRIB(Keepaway, m_modicons, void(vector pos, vector mySize), HUD_Mod_Keepaway);
+       ATTRIB(Keepaway, m_modicons, void(vector pos, vector mySize), HUD_Mod_Keepaway);
 #endif
 ENDCLASS(Keepaway)
 REGISTER_GAMETYPE(KEEPAWAY, NEW(Keepaway));
index 736a655392a2af4104c4eb9f5c642d8a85704f8b..ba64519faa642437a40cee6e2ef4b6d2afcc33bb 100644 (file)
@@ -11,7 +11,8 @@ REGISTER_MUTATOR(ka, false)
        MUTATOR_STATIC();
        MUTATOR_ONADD
        {
-               GameRules_scoring(0, SFL_SORT_PRIO_PRIMARY, 0, {
+               GameRules_scoring(0, SFL_SORT_PRIO_PRIMARY, 0,
+               {
                        field(SP_KEEPAWAY_PICKUPS, "pickups", 0);
                        field(SP_KEEPAWAY_CARRIERKILLS, "bckills", 0);
                        field(SP_KEEPAWAY_BCTIME, "bctime", SFL_SORT_PRIO_SECONDARY);
index cc9cecdaf2a19aaabf2281fcad12b4b7e104d22b..9cad64f7482261012b8d1d9b9090d679a2d2aaa6 100644 (file)
@@ -6,38 +6,40 @@
 void HUD_Mod_KH(vector pos, vector mySize);
 #endif
 CLASS(KeyHunt, Gametype)
-    INIT(KeyHunt)
-    {
-        this.gametype_init(this, _("Key Hunt"),"kh","g_keyhunt",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=1000 teams=3 leadlimit=0",_("Gather all the keys to win the round"));
-    }
-    METHOD(KeyHunt, m_parse_mapinfo, bool(string k, string v))
-    {
-        if (!k) {
-            cvar_set("g_keyhunt_teams", cvar_defstring("g_keyhunt_teams"));
-            return true;
-        }
-        switch (k) {
-            case "teams":
-                cvar_set("g_keyhunt_teams", v);
-                return true;
-        }
-        return false;
-    }
-    METHOD(KeyHunt, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
-    {
-        if(spawnpoints >= 12 && diameter > 5120)
-            return true;
-        return false;
-    }
-    METHOD(KeyHunt, m_setTeams, void(string sa))
-    {
-        cvar_set("g_keyhunt_teams", sa);
-    }
-    METHOD(KeyHunt, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
-    {
-        TC(Gametype, this);
-        returns(menu, _("Point limit:"),   200, 1500, 50, "g_keyhunt_point_limit",     "g_keyhunt_teams_override",     _("The amount of points needed before the match will end"));
-    }
+       INIT(KeyHunt)
+       {
+               this.gametype_init(this, _("Key Hunt"),"kh","g_keyhunt",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=1000 teams=3 leadlimit=0",_("Gather all the keys to win the round"));
+       }
+       METHOD(KeyHunt, m_parse_mapinfo, bool(string k, string v))
+       {
+               if (!k)
+               {
+                       cvar_set("g_keyhunt_teams", cvar_defstring("g_keyhunt_teams"));
+                       return true;
+               }
+               switch (k)
+               {
+                       case "teams":
+                               cvar_set("g_keyhunt_teams", v);
+                               return true;
+               }
+               return false;
+       }
+       METHOD(KeyHunt, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+       {
+               if(spawnpoints >= 12 && diameter > 5120)
+                       return true;
+               return false;
+       }
+       METHOD(KeyHunt, m_setTeams, void(string sa))
+       {
+               cvar_set("g_keyhunt_teams", sa);
+       }
+       METHOD(KeyHunt, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
+       {
+               TC(Gametype, this);
+               returns(menu, _("Point limit:"),   200, 1500, 50, "g_keyhunt_point_limit",     "g_keyhunt_teams_override",     _("The amount of points needed before the match will end"));
+       }
 #ifdef CSQC
     ATTRIB(KeyHunt, m_modicons, void(vector pos, vector mySize), HUD_Mod_KH);
 #endif
index 66321c3d9d17f81917d886ce51c8cb1feb749c7a..e2b83edbb1a09992ae8dfbeb00cb9380bcc96b6a 100644 (file)
@@ -8,13 +8,13 @@ void kh_Initialize();
 
 REGISTER_MUTATOR(kh, false)
 {
-    MUTATOR_STATIC();
+       MUTATOR_STATIC();
        MUTATOR_ONADD
        {
                GameRules_teams(true);
-        GameRules_spawning_teams(autocvar_g_keyhunt_team_spawns);
-        GameRules_limit_score(autocvar_g_keyhunt_point_limit);
-        GameRules_limit_lead(autocvar_g_keyhunt_point_leadlimit);
+               GameRules_spawning_teams(autocvar_g_keyhunt_team_spawns);
+               GameRules_limit_score(autocvar_g_keyhunt_point_limit);
+               GameRules_limit_lead(autocvar_g_keyhunt_point_leadlimit);
 
                kh_Initialize();
        }
index b90f6c6eb1db67dee498426eda422ce4680d14b9..258f8300729d7666a2f33131e32ddf278db1d69b 100644 (file)
@@ -6,22 +6,22 @@
 void HUD_Mod_LMS(vector myPos, vector mySize);
 #endif
 CLASS(LastManStanding, Gametype)
-    INIT(LastManStanding)
-    {
-        this.gametype_init(this, _("Last Man Standing"),"lms","g_lms",GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_HIDELIMITS,"","timelimit=20 lives=5 leadlimit=0",_("Survive and kill until the enemies have no lives left"));
-    }
-    METHOD(LastManStanding, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
-    {
-        return true;
-    }
-    METHOD(LastManStanding, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
-    {
-        TC(Gametype, this);
-        returns(menu, _("Lives:"),           3,   50,  1, "g_lms_lives_override",      string_null,                    string_null);
-    }
-    ATTRIB(LastManStanding, m_legacydefaults, string, "9 20 0");
+       INIT(LastManStanding)
+       {
+               this.gametype_init(this, _("Last Man Standing"),"lms","g_lms",GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_HIDELIMITS,"","timelimit=20 lives=5 leadlimit=0",_("Survive and kill until the enemies have no lives left"));
+       }
+       METHOD(LastManStanding, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+       {
+               return true;
+       }
+       METHOD(LastManStanding, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
+       {
+               TC(Gametype, this);
+               returns(menu, _("Lives:"),           3,   50,  1, "g_lms_lives_override",      string_null,                    string_null);
+       }
+       ATTRIB(LastManStanding, m_legacydefaults, string, "9 20 0");
 #ifdef CSQC
-    ATTRIB(LastManStanding, m_modicons, void(vector myPos, vector mySize), HUD_Mod_LMS);
+       ATTRIB(LastManStanding, m_modicons, void(vector myPos, vector mySize), HUD_Mod_LMS);
 #endif
 ENDCLASS(LastManStanding)
 REGISTER_GAMETYPE(LMS, NEW(LastManStanding));
index 8019c76ddb62c2ae5a002f4d61b58c03a53c2b4b..3705ab5054fbe4272fc5ee70f31047154dc67559 100644 (file)
@@ -14,16 +14,17 @@ void lms_Initialize();
 
 REGISTER_MUTATOR(lms, false)
 {
-    MUTATOR_STATIC();
+       MUTATOR_STATIC();
        MUTATOR_ONADD
        {
-        GameRules_limit_score(((!autocvar_g_lms_lives_override) ? -1 : autocvar_g_lms_lives_override));
-        GameRules_limit_lead(0);
-        GameRules_score_enabled(false);
-        GameRules_scoring(0, 0, 0, {
-            field(SP_LMS_LIVES, "lives", SFL_SORT_PRIO_SECONDARY);
-            field(SP_LMS_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
-        });
+               GameRules_limit_score(((!autocvar_g_lms_lives_override) ? -1 : autocvar_g_lms_lives_override));
+               GameRules_limit_lead(0);
+               GameRules_score_enabled(false);
+               GameRules_scoring(0, 0, 0,
+               {
+                       field(SP_LMS_LIVES, "lives", SFL_SORT_PRIO_SECONDARY);
+                       field(SP_LMS_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
+               });
 
                lms_Initialize();
        }
index 845fb2ec11161888a04e7d13d63a5ec44dbae3c0..d3d86912f1c8ab2c567ad8a528470ab59219f024 100644 (file)
@@ -6,28 +6,28 @@
 void HUD_Mod_NexBall(vector pos, vector mySize);
 #endif
 CLASS(NexBall, Gametype)
-    INIT(NexBall)
-    {
-        this.gametype_init(this, _("Nexball"),"nb","g_nexball",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_WEAPONARENA,"","timelimit=20 pointlimit=5 leadlimit=0",_("Shoot and kick the ball into the enemies goal, keep your goal clean"));
-    }
-    METHOD(NexBall, m_generate_mapinfo, void(Gametype this, string v))
-    {
-        if(substring(v, 0, 8) == "nexball_" || substring(v, 0, 4) == "ball")
-            MapInfo_Map_supportedGametypes |= this.gametype_flags;
-    }
-    METHOD(NexBall, m_isTwoBaseMode, bool())
-    {
-        return true;
-    }
-    METHOD(NexBall, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
-    {
-        TC(Gametype, this);
-        returns(menu, _("Goal limit:"),      1,   50,  1, "g_nexball_goallimit",       string_null,                    _("The amount of goals needed before the match will end"));
-    }
+       INIT(NexBall)
+       {
+               this.gametype_init(this, _("Nexball"),"nb","g_nexball",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_WEAPONARENA,"","timelimit=20 pointlimit=5 leadlimit=0",_("Shoot and kick the ball into the enemies goal, keep your goal clean"));
+       }
+       METHOD(NexBall, m_generate_mapinfo, void(Gametype this, string v))
+       {
+               if(substring(v, 0, 8) == "nexball_" || substring(v, 0, 4) == "ball")
+                       MapInfo_Map_supportedGametypes |= this.gametype_flags;
+       }
+       METHOD(NexBall, m_isTwoBaseMode, bool())
+       {
+               return true;
+       }
+       METHOD(NexBall, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
+       {
+               TC(Gametype, this);
+               returns(menu, _("Goal limit:"),      1,   50,  1, "g_nexball_goallimit",       string_null,                    _("The amount of goals needed before the match will end"));
+       }
 #ifdef CSQC
-    ATTRIB(NexBall, m_modicons, void(vector pos, vector mySize), HUD_Mod_NexBall);
+       ATTRIB(NexBall, m_modicons, void(vector pos, vector mySize), HUD_Mod_NexBall);
 #endif
-    ATTRIB(NexBall, m_legacydefaults, string, "5 20 0");
+       ATTRIB(NexBall, m_legacydefaults, string, "5 20 0");
 ENDCLASS(NexBall)
 REGISTER_GAMETYPE(NEXBALL, NEW(NexBall));
 #define g_nexball IS_GAMETYPE(NEXBALL)
index d1cd4c66807ea0754549b9ca41d16ebff252ab78..b98181de55f7017d1b82766e2f17633e5f417196 100644 (file)
@@ -6,7 +6,7 @@ void nb_Initialize();
 
 REGISTER_MUTATOR(nb, false)
 {
-    MUTATOR_STATIC();
+       MUTATOR_STATIC();
        MUTATOR_ONADD
        {
                nb_Initialize();
index fc3938b9240521c192c94c9ac90a9756e9d56705..cef742a5f41d1b9948d7a8b20e633a86b5e96454 100644 (file)
@@ -3,21 +3,21 @@
 #include <common/mapinfo.qh>
 
 CLASS(Onslaught, Gametype)
-    INIT(Onslaught)
-    {
-        this.gametype_init(this, _("Onslaught"),"ons","g_onslaught",GAMETYPE_FLAG_TEAMPLAY,"","pointlimit=1 timelimit=20",_("Capture control points to reach and destroy the enemy generator"));
-    }
-    METHOD(Onslaught, m_generate_mapinfo, void(Gametype this, string v))
-    {
-        if(v == "onslaught_generator")
-            MapInfo_Map_supportedGametypes |= this.gametype_flags;
-    }
-    METHOD(Onslaught, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
-    {
-        TC(Gametype, this);
-        returns(menu, _("Point limit:"),    50,  500, 10, string_null,                 string_null,                    string_null);
-    }
-    ATTRIB(Onslaught, m_legacydefaults, string, "20 0");
+       INIT(Onslaught)
+       {
+               this.gametype_init(this, _("Onslaught"),"ons","g_onslaught",GAMETYPE_FLAG_TEAMPLAY,"","pointlimit=1 timelimit=20",_("Capture control points to reach and destroy the enemy generator"));
+       }
+       METHOD(Onslaught, m_generate_mapinfo, void(Gametype this, string v))
+       {
+               if(v == "onslaught_generator")
+                       MapInfo_Map_supportedGametypes |= this.gametype_flags;
+       }
+       METHOD(Onslaught, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
+       {
+               TC(Gametype, this);
+               returns(menu, _("Point limit:"),    50,  500, 10, string_null,                 string_null,                    string_null);
+       }
+       ATTRIB(Onslaught, m_legacydefaults, string, "20 0");
 ENDCLASS(Onslaught)
 REGISTER_GAMETYPE(ONSLAUGHT, NEW(Onslaught));
 
index ddc11089c12116cfc1d142affbdd964aedc49fd3..2e921893eb1537e13a3c3fcba37a2c103db23af5 100644 (file)
@@ -6,41 +6,43 @@
 void HUD_Mod_Race(vector pos, vector mySize);
 #endif
 CLASS(Race, Gametype)
-    INIT(Race)
-    {
-        this.gametype_init(this, _("Race"),"rc","g_race",GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 qualifying_timelimit=5 laplimit=7 teamlaplimit=15 leadlimit=0",_("Race against other players to the finish line"));
-    }
-    METHOD(Race, m_parse_mapinfo, bool(string k, string v))
-    {
-        if (!k) {
-            cvar_set("g_race_qualifying_timelimit", cvar_defstring("g_race_qualifying_timelimit"));
-            return true;
-        }
-        switch (k) {
-            case "qualifying_timelimit":
-                cvar_set("g_race_qualifying_timelimit", v);
-                return true;
-        }
-        return false;
-    }
-    METHOD(Race, m_generate_mapinfo, void(Gametype this, string v))
-    {
-        if(v == "trigger_race_checkpoint")
-            MapInfo_Map_supportedGametypes |= this.gametype_flags;
-    }
-    METHOD(Race, m_isTwoBaseMode, bool())
-    {
-        return true;
-    }
-    METHOD(Race, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
-    {
-        TC(Gametype, this);
-        returns(menu, _("Laps:"),            1,   25,  1, "g_race_laps_limit",         string_null,                    string_null);
-    }
+       INIT(Race)
+       {
+               this.gametype_init(this, _("Race"),"rc","g_race",GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 qualifying_timelimit=5 laplimit=7 teamlaplimit=15 leadlimit=0",_("Race against other players to the finish line"));
+       }
+       METHOD(Race, m_parse_mapinfo, bool(string k, string v))
+       {
+               if (!k)
+               {
+                       cvar_set("g_race_qualifying_timelimit", cvar_defstring("g_race_qualifying_timelimit"));
+                       return true;
+               }
+               switch (k)
+               {
+                       case "qualifying_timelimit":
+                               cvar_set("g_race_qualifying_timelimit", v);
+                               return true;
+               }
+               return false;
+       }
+       METHOD(Race, m_generate_mapinfo, void(Gametype this, string v))
+       {
+               if(v == "trigger_race_checkpoint")
+                       MapInfo_Map_supportedGametypes |= this.gametype_flags;
+       }
+       METHOD(Race, m_isTwoBaseMode, bool())
+       {
+               return true;
+       }
+       METHOD(Race, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
+       {
+               TC(Gametype, this);
+               returns(menu, _("Laps:"),            1,   25,  1, "g_race_laps_limit",         string_null,                    string_null);
+       }
 #ifdef CSQC
-    ATTRIB(Race, m_modicons, void(vector pos, vector mySize), HUD_Mod_Race);
+       ATTRIB(Race, m_modicons, void(vector pos, vector mySize), HUD_Mod_Race);
 #endif
-    ATTRIB(Race, m_legacydefaults, string, "20 5 7 15 0");
+       ATTRIB(Race, m_legacydefaults, string, "20 5 7 15 0");
 ENDCLASS(Race)
 REGISTER_GAMETYPE(RACE, NEW(Race));
 #define g_race IS_GAMETYPE(RACE)
index 9928b8cb758c4e9b0e7840522e2bf91df2f56492..92a9431b057524422f70f334d3cb66a2f6b0ed10 100644 (file)
@@ -6,7 +6,7 @@ void race_Initialize();
 
 REGISTER_MUTATOR(rc, false)
 {
-    MUTATOR_STATIC();
+       MUTATOR_STATIC();
        MUTATOR_ONADD
        {
                rc_SetLimits();
index 7c5d8c7c40263af6403529534e9b396768b196f1..4b5e1a39ed747db9ddc32b85bbb97da5be3fe28d 100644 (file)
@@ -7,26 +7,26 @@
 void HUD_Mod_Survival(vector pos, vector mySize);
 #endif
 CLASS(Survival, Gametype)
-    INIT(Survival)
-    {
-        this.gametype_init(this, _("Survival"), "surv", "g_survival", GAMETYPE_FLAG_USEPOINTS, "", "timelimit=20 pointlimit=12", _("Identify and eliminate all the hunters before all your allies are gone"));
-    }
-    METHOD(Survival, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
-    {
-        return true;
-    }
-    METHOD(Survival, m_isForcedSupported, bool(Gametype this))
-    {
-        if(!cvar("g_survival_not_lms_maps"))
-        {
-            // if this is unset, all LMS maps support Survival too
-            if(!(MapInfo_Map_supportedGametypes & this.gametype_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_LMS.gametype_flags))
-                return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
-        }
-        return false;
-    }
+       INIT(Survival)
+       {
+               this.gametype_init(this, _("Survival"), "surv", "g_survival", GAMETYPE_FLAG_USEPOINTS, "", "timelimit=20 pointlimit=12", _("Identify and eliminate all the hunters before all your allies are gone"));
+       }
+       METHOD(Survival, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+       {
+               return true;
+       }
+       METHOD(Survival, m_isForcedSupported, bool(Gametype this))
+       {
+               if(!cvar("g_survival_not_lms_maps"))
+               {
+                       // if this is unset, all LMS maps support Survival too
+                       if(!(MapInfo_Map_supportedGametypes & this.gametype_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_LMS.gametype_flags))
+                       return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
+               }
+               return false;
+       }
 #ifdef CSQC
-    ATTRIB(Survival, m_modicons, void(vector pos, vector mySize), HUD_Mod_Survival);
+       ATTRIB(Survival, m_modicons, void(vector pos, vector mySize), HUD_Mod_Survival);
 #endif
 ENDCLASS(Survival)
 REGISTER_GAMETYPE(SURVIVAL, NEW(Survival));
index 129410a5af77345887bad7d769d740c8b136f44b..c7f2fc556d8397784b49880393981cfb23cbd150 100644 (file)
@@ -6,7 +6,7 @@ void surv_Initialize();
 
 REGISTER_MUTATOR(surv, false)
 {
-    MUTATOR_STATIC();
+       MUTATOR_STATIC();
        MUTATOR_ONADD
        {
                surv_Initialize();
index 783655bba517eef177c965a3d607571c0d59b1f1..42bc4ed87207588ca3824dabe8886ba18c2c6972 100644 (file)
@@ -8,7 +8,7 @@ void tdm_Initialize();
 
 REGISTER_MUTATOR(tdm, false)
 {
-    MUTATOR_STATIC();
+       MUTATOR_STATIC();
        MUTATOR_ONADD
        {
                tdm_Initialize();
index ab7a16427c5a954d9b76dd0a9b5f3e0107da213f..386c9e4cfe6566c6972e4c7223bd6626ec52aa74 100644 (file)
@@ -4,49 +4,51 @@
 #include <common/mapinfo.qh>
 
 CLASS(TeamDeathmatch, Gametype)
-    INIT(TeamDeathmatch)
-    {
-        this.gametype_init(this, _("Team Deathmatch"),"tdm","g_tdm",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_PRIORITY,"","timelimit=15 pointlimit=50 teams=2 leadlimit=0",_("Help your team score the most frags against the enemy team"));
-    }
-    METHOD(TeamDeathmatch, m_parse_mapinfo, bool(string k, string v))
-    {
-        if (!k) {
-            cvar_set("g_tdm_teams", cvar_defstring("g_tdm_teams"));
-            return true;
-        }
-        switch (k) {
-            case "teams":
-                cvar_set("g_tdm_teams", v);
-                return true;
-        }
-        return false;
-    }
-    METHOD(TeamDeathmatch, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
-    {
-        if(spawnpoints >= 8 && diameter > 3250)
-            return true;
-        return false;
-    }
-    METHOD(TeamDeathmatch, m_isForcedSupported, bool(Gametype this))
-    {
-        if(cvar("g_tdm_on_dm_maps"))
-        {
-            // if this is set, all DM maps support TDM too
-            if(!(MapInfo_Map_supportedGametypes & this.gametype_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.gametype_flags))
-                return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
-        }
-        return false;
-    }
-    METHOD(TeamDeathmatch, m_setTeams, void(string sa))
-    {
-        cvar_set("g_tdm_teams", sa);
-    }
-    METHOD(TeamDeathmatch, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
-    {
-        TC(Gametype, this);
-        returns(menu, _("Point limit:"),     5,  100,  5, "g_tdm_point_limit",         "g_tdm_teams_override",         _("The amount of points needed before the match will end"));
-    }
-    ATTRIB(TeamDeathmatch, m_legacydefaults, string, "50 20 2 0");
+       INIT(TeamDeathmatch)
+       {
+               this.gametype_init(this, _("Team Deathmatch"),"tdm","g_tdm",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_PRIORITY,"","timelimit=15 pointlimit=50 teams=2 leadlimit=0",_("Help your team score the most frags against the enemy team"));
+       }
+       METHOD(TeamDeathmatch, m_parse_mapinfo, bool(string k, string v))
+       {
+               if (!k)
+               {
+                       cvar_set("g_tdm_teams", cvar_defstring("g_tdm_teams"));
+                       return true;
+               }
+               switch (k)
+               {
+                       case "teams":
+                               cvar_set("g_tdm_teams", v);
+                               return true;
+               }
+               return false;
+       }
+       METHOD(TeamDeathmatch, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+       {
+               if(spawnpoints >= 8 && diameter > 3250)
+                       return true;
+               return false;
+       }
+       METHOD(TeamDeathmatch, m_isForcedSupported, bool(Gametype this))
+       {
+               if(cvar("g_tdm_on_dm_maps"))
+               {
+                       // if this is set, all DM maps support TDM too
+                       if(!(MapInfo_Map_supportedGametypes & this.gametype_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.gametype_flags))
+                       return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
+               }
+               return false;
+       }
+       METHOD(TeamDeathmatch, m_setTeams, void(string sa))
+       {
+               cvar_set("g_tdm_teams", sa);
+       }
+       METHOD(TeamDeathmatch, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
+       {
+               TC(Gametype, this);
+               returns(menu, _("Point limit:"),     5,  100,  5, "g_tdm_point_limit",         "g_tdm_teams_override",         _("The amount of points needed before the match will end"));
+       }
+       ATTRIB(TeamDeathmatch, m_legacydefaults, string, "50 20 2 0");
 ENDCLASS(TeamDeathmatch)
 REGISTER_GAMETYPE(TEAM_DEATHMATCH, NEW(TeamDeathmatch));
 #define g_tdm IS_GAMETYPE(TEAM_DEATHMATCH)
index af9d60db3af7dc3aa908b97d715a4dcb161a2d09..8dc03b1185837456886e7109d9d874a662315cd7 100644 (file)
@@ -8,51 +8,53 @@
 #endif
 
 CLASS(TeamKeepaway, Gametype)
-    INIT(TeamKeepaway)
-    {
-        this.gametype_init(this, _("Team Keepaway"),"tka","g_tka",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=15 pointlimit=50 teams=2 leadlimit=0",_("Keep the ball in your team's possession to get points for kills"));
-    }
-    METHOD(TeamKeepaway, m_parse_mapinfo, bool(string k, string v))
-    {
-        if (!k) {
-            cvar_set("g_tka_teams", cvar_defstring("g_tka_teams"));
-            return true;
-        }
-        switch (k) {
-            case "teams":
-                cvar_set("g_tka_teams", v);
-                return true;
-        }
-        return false;
-    }
-    METHOD(TeamKeepaway, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
-    {
-        if(spawnpoints >= 8 && diameter > 4096)
-            return true;
-        return false;
-    }
-    METHOD(TeamKeepaway, m_isForcedSupported, bool(Gametype this))
-    {
-        if(cvar("g_tka_on_ka_maps"))
-        {
-            // if this is set, all KA maps support TKA too
-            if(!(MapInfo_Map_supportedGametypes & this.gametype_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_KEEPAWAY.gametype_flags))
-                return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
-        }
-        if(cvar("g_tka_on_tdm_maps"))
-        {
-            // if this is set, all TDM maps support TKA too
-            if(!(MapInfo_Map_supportedGametypes & this.gametype_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH.gametype_flags))
-                return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
-        }
-        return false;
-    }
-    METHOD(TeamKeepaway, m_setTeams, void(string sa))
-    {
-        cvar_set("g_tka_teams", sa);
-    }
+       INIT(TeamKeepaway)
+       {
+               this.gametype_init(this, _("Team Keepaway"),"tka","g_tka",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=15 pointlimit=50 teams=2 leadlimit=0",_("Keep the ball in your team's possession to get points for kills"));
+       }
+       METHOD(TeamKeepaway, m_parse_mapinfo, bool(string k, string v))
+       {
+               if (!k)
+               {
+                       cvar_set("g_tka_teams", cvar_defstring("g_tka_teams"));
+                       return true;
+               }
+               switch (k)
+               {
+                       case "teams":
+                               cvar_set("g_tka_teams", v);
+                               return true;
+               }
+               return false;
+       }
+       METHOD(TeamKeepaway, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+       {
+               if(spawnpoints >= 8 && diameter > 4096)
+                       return true;
+               return false;
+       }
+       METHOD(TeamKeepaway, m_isForcedSupported, bool(Gametype this))
+       {
+               if(cvar("g_tka_on_ka_maps"))
+               {
+                       // if this is set, all KA maps support TKA too
+                       if(!(MapInfo_Map_supportedGametypes & this.gametype_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_KEEPAWAY.gametype_flags))
+                       return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
+               }
+               if(cvar("g_tka_on_tdm_maps"))
+               {
+                       // if this is set, all TDM maps support TKA too
+                       if(!(MapInfo_Map_supportedGametypes & this.gametype_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH.gametype_flags))
+                       return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
+               }
+               return false;
+       }
+       METHOD(TeamKeepaway, m_setTeams, void(string sa))
+       {
+               cvar_set("g_tka_teams", sa);
+       }
 #ifdef CSQC
-    ATTRIB(TeamKeepaway, m_modicons, void(vector pos, vector mySize), HUD_Mod_TeamKeepaway);
+       ATTRIB(TeamKeepaway, m_modicons, void(vector pos, vector mySize), HUD_Mod_TeamKeepaway);
 #endif
 ENDCLASS(TeamKeepaway)
 REGISTER_GAMETYPE(TEAM_KEEPAWAY, NEW(TeamKeepaway));
index 5280e79fc8a8c69b26597eecb91a9d98fcc15089..6372cc5369d0cf83f1764bf27f754ddd84d2970d 100644 (file)
@@ -11,14 +11,16 @@ CLASS(tmayhem, Gametype)
        }
        METHOD(tmayhem, m_parse_mapinfo, bool(string k, string v))
        {
-               if (!k) {
+               if (!k)
+               {
                        cvar_set("g_tmayhem_teams", cvar_defstring("g_tmayhem_teams"));
                        return true;
                }
-               switch (k) {
+               switch (k)
+               {
                        case "teams":
-                       cvar_set("g_tmayhem_teams", v);
-                       return true;
+                               cvar_set("g_tmayhem_teams", v);
+                               return true;
                }
                return false;
        }
index da2000c21296c4e98902449a87687303afc096d2..5e3d4cc7658772845cef294cc810910c7331b806 100644 (file)
@@ -10,7 +10,8 @@ void sys_phys_postupdate(entity this);
 
 void sys_phys_update(entity this, float dt)
 {
-       if (!IS_CLIENT(this)) {
+       if (!IS_CLIENT(this))
+       {
                sys_phys_simulate_simple(this, dt);
                return;
        }
@@ -30,8 +31,10 @@ void sys_phys_update(entity this, float dt)
 
        sys_phys_pregame_hold(this);
 
-       if (IS_SVQC) {
-               if (this.move_movetype == MOVETYPE_NONE) { return; }
+       if (IS_SVQC)
+       {
+               if (this.move_movetype == MOVETYPE_NONE)
+                       return;
                // when we get here, disableclientprediction cannot be 2
                if(this.move_movetype == MOVETYPE_FOLLOW) // not compatible with prediction
                        this.disableclientprediction = 1;
@@ -50,20 +53,24 @@ void sys_phys_update(entity this, float dt)
        float maxspeed_mod = 1;
 
        // conveyors: first fix velocity
-       if (this.conveyor.active) { this.velocity -= this.conveyor.movedir; }
+       if (this.conveyor.active)
+               this.velocity -= this.conveyor.movedir;
        MUTATOR_CALLHOOK(PlayerPhysics, this, dt);
 
-       if (!IS_PLAYER(this)) {
+       if (!IS_PLAYER(this))
+       {
                sys_phys_spectator_control(this);
                maxspeed_mod = STAT(SPECTATORSPEED, this);
        }
        sys_phys_fixspeed(this, maxspeed_mod);
 
-       if (IS_DEAD(this)) {
+       if (IS_DEAD(this))
+       {
                // handle water here
                vector midpoint = ((this.absmin + this.absmax) * 0.5);
                int cont = pointcontents(midpoint);
-               if (cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME) {
+               if (cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
+               {
                        this.velocity = this.velocity * 0.5;
 
                        // do we want this?
@@ -76,30 +83,36 @@ void sys_phys_update(entity this, float dt)
 
        PM_check_slick(this);
 
-       if (IS_SVQC && !PHYS_FIXANGLE(this)) { this.angles = eY * this.v_angle.y; }
-       if (IS_PLAYER(this)) {
-               if (IS_ONGROUND(this)) {
+       if (IS_SVQC && !PHYS_FIXANGLE(this))
+               this.angles = eY * this.v_angle.y;
+       if (IS_PLAYER(this))
+       {
+               if (IS_ONGROUND(this))
+               {
                        PM_check_hitground(this);
                        PM_Footsteps(this);
-               } else if (IsFlying(this)) {
-                       this.wasFlying = true;
                }
+               else if (IsFlying(this))
+                       this.wasFlying = true;
                CheckPlayerJump(this);
        }
 
-       if (this.flags & FL_WATERJUMP) {
+       if (this.flags & FL_WATERJUMP)
+       {
                this.velocity_x = this.movedir.x;
                this.velocity_y = this.movedir.y;
-               if (time > this.teleport_time || this.waterlevel == WATERLEVEL_NONE) {
+               if (time > this.teleport_time || this.waterlevel == WATERLEVEL_NONE)
+               {
                        this.flags &= ~FL_WATERJUMP;
                        this.teleport_time = 0;
                }
-       } else if (MUTATOR_CALLHOOK(PM_Physics, this, maxspeed_mod, dt)) {
-               // handled
-       } else if (this.move_movetype == MOVETYPE_NOCLIP
-               || this.move_movetype == MOVETYPE_FLY
-               || this.move_movetype == MOVETYPE_FLY_WORLDONLY
-               || MUTATOR_CALLHOOK(IsFlying, this))
+       }
+       else if (MUTATOR_CALLHOOK(PM_Physics, this, maxspeed_mod, dt))
+               { /* handled */ }
+       else if (this.move_movetype == MOVETYPE_NOCLIP
+             || this.move_movetype == MOVETYPE_FLY
+             || this.move_movetype == MOVETYPE_FLY_WORLDONLY
+             || MUTATOR_CALLHOOK(IsFlying, this))
        {
                this.com_phys_friction = PHYS_FRICTION(this);
                this.com_phys_vel_max = PHYS_MAXSPEED(this) * maxspeed_mod;
@@ -107,44 +120,54 @@ void sys_phys_update(entity this, float dt)
                this.com_phys_friction_air = true;
                sys_phys_simulate(this, dt);
                this.com_phys_friction_air = false;
-       } else if (this.waterlevel >= WATERLEVEL_SWIMMING) {
+       }
+       else if (this.waterlevel >= WATERLEVEL_SWIMMING)
+       {
                this.com_phys_vel_max = PHYS_MAXSPEED(this) * maxspeed_mod;
                this.com_phys_acc_rate = PHYS_ACCELERATE(this) * maxspeed_mod;
                this.com_phys_water = true;
                sys_phys_simulate(this, dt);
                this.com_phys_water = false;
                this.jumppadcount = 0;
-       } else if (this.ladder_entity) {
+       }
+       else if (this.ladder_entity)
+       {
                this.com_phys_friction = PHYS_FRICTION(this);
                this.com_phys_vel_max = PHYS_MAXSPEED(this) * maxspeed_mod;
                this.com_phys_acc_rate = PHYS_ACCELERATE(this) * maxspeed_mod;
                this.com_phys_gravity = -PHYS_GRAVITY(this) * dt;
-               if (PHYS_ENTGRAVITY(this)) { this.com_phys_gravity *= PHYS_ENTGRAVITY(this); }
+               if (PHYS_ENTGRAVITY(this))
+                       this.com_phys_gravity *= PHYS_ENTGRAVITY(this);
                this.com_phys_ladder = true;
                this.com_phys_friction_air = true;
                sys_phys_simulate(this, dt);
                this.com_phys_friction_air = false;
                this.com_phys_ladder = false;
                this.com_phys_gravity = 0;
-       } else if (ITEMS_STAT(this) & IT_USING_JETPACK) {
+       }
+       else if (ITEMS_STAT(this) & IT_USING_JETPACK)
                PM_jetpack(this, maxspeed_mod, dt);
-       } else if (IS_ONGROUND(this) && (!IS_ONSLICK(this) || !PHYS_SLICK_APPLYGRAVITY(this))) {
-               if (!WAS_ONGROUND(this)) {
+       else if (IS_ONGROUND(this) && (!IS_ONSLICK(this) || !PHYS_SLICK_APPLYGRAVITY(this)))
+       {
+               if (!WAS_ONGROUND(this))
+               {
                        emit(phys_land, this);
-                       if (this.lastground < time - 0.3) {
+                       if (this.lastground < time - 0.3)
                                this.velocity *= (1 - PHYS_FRICTION_ONLAND(this));
-                       }
                }
                this.com_phys_vel_max = PHYS_MAXSPEED(this) * maxspeed_mod;
                this.com_phys_gravity = -PHYS_GRAVITY(this) * dt;
-               if (PHYS_ENTGRAVITY(this)) { this.com_phys_gravity *= PHYS_ENTGRAVITY(this); }
+               if (PHYS_ENTGRAVITY(this))
+                       this.com_phys_gravity *= PHYS_ENTGRAVITY(this);
                this.com_phys_ground = true;
                this.com_phys_vel_2d = true;
                sys_phys_simulate(this, dt);
                this.com_phys_vel_2d = false;
                this.com_phys_ground = false;
                this.com_phys_gravity = 0;
-       } else {
+       }
+       else
+       {
                this.com_phys_acc_rate_air = PHYS_AIRACCELERATE(this) * min(maxspeed_mod, 1);
                this.com_phys_acc_rate_air_stop = PHYS_AIRSTOPACCELERATE(this) * maxspeed_mod;
                this.com_phys_acc_rate_air_strafe = PHYS_AIRSTRAFEACCELERATE(this) * maxspeed_mod;
@@ -163,9 +186,11 @@ void sys_phys_update(entity this, float dt)
 
 void sys_phys_postupdate(entity this)
 {
-       if (IS_ONGROUND(this)) { this.lastground = time; }
+       if (IS_ONGROUND(this))
+               this.lastground = time;
        // conveyors: then break velocity again
-       if (this.conveyor.active) { this.velocity += this.conveyor.movedir; }
+       if (this.conveyor.active)
+               this.velocity += this.conveyor.movedir;
        this.lastflags = this.flags;
 
        this.lastclassname = this.classname;
@@ -174,7 +199,8 @@ void sys_phys_postupdate(entity this)
 /** for players */
 void sys_phys_simulate(entity this, float dt)
 {
-       if (!this.com_phys_ground && !this.com_phys_air) {
+       if (!this.com_phys_ground && !this.com_phys_air)
+       {
                // noclipping
                // flying
                // on a spawnfunc_func_ladder
@@ -182,7 +208,8 @@ void sys_phys_simulate(entity this, float dt)
                // swimming
                UNSET_ONGROUND(this);
 
-               if (this.com_phys_friction_air) {
+               if (this.com_phys_friction_air)
+               {
                        const float grav = -this.com_phys_gravity;
                        this.velocity_z += grav / 2;
                        this.velocity = this.velocity * (1 - dt * this.com_phys_friction);
@@ -190,20 +217,28 @@ void sys_phys_simulate(entity this, float dt)
                }
        }
 
-       if (this.com_phys_water) {
+       if (this.com_phys_water)
+       {
                // water jump only in certain situations
                // this mimics quakeworld code
-               if (this.com_in_jump && this.waterlevel == WATERLEVEL_SWIMMING && this.velocity_z >= -180 && !this.viewloc && !PHYS_FROZEN(this)) {
+               if (this.com_in_jump
+               &&  this.waterlevel == WATERLEVEL_SWIMMING
+               &&  this.velocity_z >= -180
+               && !this.viewloc
+               && !PHYS_FROZEN(this))
+               {
                        vector yawangles = eY * this.v_angle.y;
                        vector forward, right, up;
                        MAKE_VECTORS(yawangles, forward, right, up);
                        vector spot = this.origin + 24 * forward;
                        spot_z += 8;
                        traceline(spot, spot, MOVE_NOMONSTERS, this);
-                       if (trace_startsolid) {
+                       if (trace_startsolid)
+                       {
                                spot_z += 24;
                                traceline(spot, spot, MOVE_NOMONSTERS, this);
-                               if (!trace_startsolid) {
+                               if (!trace_startsolid)
+                               {
                                        this.velocity = forward * 50;
                                        this.velocity_z = 310;
                                        UNSET_ONGROUND(this);
@@ -220,7 +255,8 @@ void sys_phys_simulate(entity this, float dt)
        vector wishvel = forward * PHYS_CS(this).movement.x
                + right * PHYS_CS(this).movement.y
                + eZ * (this.com_phys_vel_2d ? 0 : PHYS_CS(this).movement.z);
-       if (this.com_phys_water) {
+       if (this.com_phys_water)
+       {
                if (PHYS_FROZEN(this))
                {
                        if(this.waterlevel >= WATERLEVEL_SUBMERGED && this.velocity.z >= -70) // don't change the speed too abruptally
@@ -230,35 +266,35 @@ void sys_phys_simulate(entity this, float dt)
                }
                else
                {
-                       if (PHYS_INPUT_BUTTON_CROUCH(this)) {
+                       if (PHYS_INPUT_BUTTON_CROUCH(this))
                                wishvel.z = -PHYS_MAXSPEED(this);
-                       }
-                       if (this.viewloc) {
+                       if (this.viewloc)
                                wishvel.z = -160;    // drift anyway
-                       } else if (wishvel == '0 0 0') {
+                       else if (wishvel == '0 0 0')
                                wishvel.z = -60; // drift towards bottom
-                       }
                }
        }
-       if (this.com_phys_ladder) {
-               if (this.viewloc) {
+       if (this.com_phys_ladder)
+       {
+               if (this.viewloc)
                        wishvel.z = PHYS_CS(this).movement_old.x;
-               }
-               if (this.ladder_entity.classname == "func_water") {
+
+               if (this.ladder_entity.classname == "func_water")
+               {
                        float f = vlen(wishvel);
-                       if (f > this.ladder_entity.speed) {
+                       if (f > this.ladder_entity.speed)
                                wishvel *= (this.ladder_entity.speed / f);
-                       }
 
                        this.watertype = this.ladder_entity.skin;
                        f = this.ladder_entity.origin_z + this.ladder_entity.maxs_z;
-                       if ((this.origin_z + this.view_ofs_z) < f) {
+                       if ((this.origin_z + this.view_ofs_z) < f)
                                this.waterlevel = WATERLEVEL_SUBMERGED;
-                       } else if ((this.origin_z + (this.mins_z + this.maxs_z) * 0.5) < f) {
+                       else if ((this.origin_z + (this.mins_z + this.maxs_z) * 0.5) < f)
                                this.waterlevel = WATERLEVEL_SWIMMING;
-                       } else if ((this.origin_z + this.mins_z + 1) < f) {
+                       else if ((this.origin_z + this.mins_z + 1) < f)
                                this.waterlevel = WATERLEVEL_WETFEET;
-                       } else {
+                       else
+                       {
                                this.waterlevel = WATERLEVEL_NONE;
                                this.watertype = CONTENT_EMPTY;
                        }
@@ -272,23 +308,26 @@ void sys_phys_simulate(entity this, float dt)
        const vector wishdir = wishspeed ? wishvel * (1 / wishspeed) : '0 0 0';
        wishspeed = min(wishspeed, this.com_phys_vel_max);
 
-       if (this.com_phys_air) {
-               if (!(this.flags & FL_WATERJUMP)) {
+       if (this.com_phys_air)
+       {
+               if (!(this.flags & FL_WATERJUMP))
+               {
                        // apply air speed limit
                        float airaccelqw = PHYS_AIRACCEL_QW(this);
                        float wishspeed0 = wishspeed;
                        const float maxairspd = this.com_phys_vel_max;
                        wishspeed = min(wishspeed, maxairspd);
-                       if (IS_DUCKED(this)) {
+                       if (IS_DUCKED(this))
                                wishspeed *= 0.5;
-                       }
+
                        float airaccel = this.com_phys_acc_rate_air;
 
                        float accelerating = (this.velocity * wishdir > 0);
                        float wishspeed2 = wishspeed;
 
                        // CPM: air control
-                       if (PHYS_AIRSTOPACCELERATE(this)) {
+                       if (PHYS_AIRSTOPACCELERATE(this))
+                       {
                                vector curdir = normalize(vec2(this.velocity));
                                airaccel += (this.com_phys_acc_rate_air_stop - airaccel) * max(0, -(curdir * wishdir));
                        }
@@ -301,36 +340,41 @@ void sys_phys_simulate(entity this, float dt)
                        // log dv/dt = logaccel + logmaxspeed (when slow)
                        // log dv/dt = logaccel + logmaxspeed + log(1 - accelqw) (when fast)
                        float strafity = IsMoveInDirection(PHYS_CS(this).movement, -90) + IsMoveInDirection(PHYS_CS(this).movement, +90);  // if one is nonzero, other is always zero
-                       if (PHYS_MAXAIRSTRAFESPEED(this)) {
-                               wishspeed = min(wishspeed,
-                                       GeomLerp(this.com_phys_vel_max_air, strafity, this.com_phys_vel_max_air_strafe));
-                       }
-                       if (PHYS_AIRSTRAFEACCELERATE(this)) {
+                       if (PHYS_MAXAIRSTRAFESPEED(this))
+                               wishspeed = min(wishspeed, GeomLerp(this.com_phys_vel_max_air,
+                                                                   strafity,
+                                                                   this.com_phys_vel_max_air_strafe));
+
+                       if (PHYS_AIRSTRAFEACCELERATE(this))
                                airaccel = GeomLerp(airaccel, strafity, this.com_phys_acc_rate_air_strafe);
-                       }
-                       if (PHYS_AIRSTRAFEACCEL_QW(this)) {
+
+                       if (PHYS_AIRSTRAFEACCEL_QW(this))
                                airaccelqw =
                                        (((strafity > 0.5 ? PHYS_AIRSTRAFEACCEL_QW(this) : PHYS_AIRACCEL_QW(this)) >= 0) ? +1 : -1)
                                        *
                                        (1 - GeomLerp(1 - fabs(PHYS_AIRACCEL_QW(this)), strafity, 1 - fabs(PHYS_AIRSTRAFEACCEL_QW(this))));
-                       }
                        // !CPM
 
-                       if (PHYS_WARSOWBUNNY_TURNACCEL(this) && accelerating && PHYS_CS(this).movement.y == 0 && PHYS_CS(this).movement.x != 0) {
+                       if (PHYS_WARSOWBUNNY_TURNACCEL(this) && accelerating && PHYS_CS(this).movement.y == 0 && PHYS_CS(this).movement.x != 0)
                                PM_AirAccelerate(this, dt, wishdir, wishspeed2);
-                       } else {
+                       else
+                       {
                                float sidefric = maxairspd ? (PHYS_AIRACCEL_SIDEWAYS_FRICTION(this) / maxairspd) : 0;
                                PM_Accelerate(this, dt, wishdir, wishspeed, wishspeed0, airaccel, airaccelqw,
                                        PHYS_AIRACCEL_QW_STRETCHFACTOR(this), sidefric, PHYS_AIRSPEEDLIMIT_NONQW(this));
                        }
 
-                       if (PHYS_AIRCONTROL(this)) {
+                       if (PHYS_AIRCONTROL(this))
                                CPM_PM_Aircontrol(this, dt, wishdir, wishspeed2);
-                       }
                }
-       } else {
-               if (this.com_phys_ground && IS_DUCKED(this)) { wishspeed *= 0.5; }
-               if (this.com_phys_water) {
+       }
+       else
+       {
+               if (this.com_phys_ground && IS_DUCKED(this))
+                       wishspeed *= 0.5;
+
+               if (this.com_phys_water)
+               {
                        wishspeed *= 0.7;
 
                        //      if (!(this.flags & FL_WATERJUMP)) // TODO: use
@@ -341,41 +385,48 @@ void sys_phys_simulate(entity this, float dt)
                                this.velocity *= f;
 
                                f = wishspeed - this.velocity * wishdir;
-                               if (f > 0) {
+                               if (f > 0)
+                               {
                                        float accelspeed = min(PHYS_ACCELERATE(this) * dt * wishspeed, f);
                                        this.velocity += accelspeed * wishdir;
                                }
 
                                // holding jump button swims upward slowly
-                               if (this.com_in_jump && !this.viewloc && !PHYS_FROZEN(this)) {
+                               if (this.com_in_jump && !this.viewloc && !PHYS_FROZEN(this))
+                               {
                                        // was:
                                        // lava: 50
                                        // slime: 80
                                        // water: 100
                                        // idea: double those
-                                       if (this.waterlevel >= WATERLEVEL_SUBMERGED) {
+                                       if (this.waterlevel >= WATERLEVEL_SUBMERGED)
                                                this.velocity_z = PHYS_MAXSPEED(this) * 0.7;
-                                       } else {
+                                       else
                                                this.velocity_z = 200;
-                                       }
                                }
                        }
-                       if (this.viewloc) {
+                       if (this.viewloc)
+                       {
                                const float addspeed = wishspeed - this.velocity * wishdir;
-                               if (addspeed > 0) {
+                               if (addspeed > 0)
+                               {
                                        const float accelspeed = min(PHYS_ACCELERATE(this) * dt * wishspeed, addspeed);
                                        this.velocity += accelspeed * wishdir;
                                }
-                       } else {
+                       }
+                       else
+                       {
                                // water acceleration
                                PM_Accelerate(this, dt, wishdir, wishspeed, wishspeed, this.com_phys_acc_rate, 1, 0, 0, 0);
                        }
                        return;
                }
-               if (this.com_phys_ground) {
+               if (this.com_phys_ground)
+               {
                        // apply edge friction
                        const float f2 = vlen2(vec2(this.velocity));
-                       if (f2 > 0) {
+                       if (f2 > 0)
+                       {
                                // TODO: apply edge friction
                                // apply ground friction
                                const int realfriction = (IS_ONSLICK(this))
@@ -411,16 +462,16 @@ void sys_phys_simulate(entity this, float dt)
                                 */
                        }
                        const float addspeed = wishspeed - this.velocity * wishdir;
-                       if (addspeed > 0) {
+                       if (addspeed > 0)
+                       {
                                const float accelspeed = min(PHYS_ACCELERATE(this) * dt * wishspeed, addspeed);
                                this.velocity += accelspeed * wishdir;
                        }
                        return;
                }
 
-               if (!(this.flags & FL_WATERJUMP)) {
+               if (!(this.flags & FL_WATERJUMP))
                        PM_Accelerate(this, dt, wishdir, wishspeed, wishspeed, this.com_phys_acc_rate, 1, 0, 0, 0);
-               }
        }
 }
 
@@ -432,7 +483,8 @@ void sys_phys_simulate_simple(entity this, float dt)
        vector mx = this.maxs;
 
        vector g = '0 0 0';
-       if (this.com_phys_gravity_factor && !g) g = '0 0 -1' * PHYS_GRAVITY(NULL);
+       if (this.com_phys_gravity_factor && !g)
+               g = '0 0 -1' * PHYS_GRAVITY(NULL);
 
        vector vel = this.com_phys_vel;
        vector pos = this.com_phys_pos;
@@ -443,21 +495,27 @@ void sys_phys_simulate_simple(entity this, float dt)
 
        this.angles += dt * this.avelocity;
        float movetime = dt;
-       for (int i = 0; i < MAX_CLIP_PLANES && movetime > 0; ++i) {
+       for (int i = 0; i < MAX_CLIP_PLANES && movetime > 0; ++i)
+       {
                vector push = vel * movetime;
                vector p0 = pos;
                vector p1 = p0 + push;
                // SV_PushEntity
                tracebox(p0, mn, mx, p1, MOVE_NORMAL, this);
-               if (!trace_startsolid) {
+               if (!trace_startsolid)
+               {
                        bool hit = trace_fraction < 1;
                        pos = trace_endpos;
                        entity ent = trace_ent;
                        // SV_LinkEdict_TouchAreaGrid
-                       if (this.solid != SOLID_NOT) {
-                               FOREACH_ENTITY_RADIUS_ORDERED(0.5 * (this.absmin + this.absmax), 0.5 * vlen(this.absmax - this.absmin), true, {
-                                       if (it.solid != SOLID_TRIGGER || it == this) continue;
-                                       if (gettouch(it) && boxesoverlap(it.absmin, it.absmax, this.absmin, this.absmax)) {
+                       if (this.solid != SOLID_NOT)
+                       {
+                               FOREACH_ENTITY_RADIUS_ORDERED(0.5 * (this.absmin + this.absmax), 0.5 * vlen(this.absmax - this.absmin), true,
+                               {
+                                       if (it.solid != SOLID_TRIGGER || it == this)
+                                               continue;
+                                       if (gettouch(it) && boxesoverlap(it.absmin, it.absmax, this.absmin, this.absmax))
+                                       {
                                                // SV_LinkEdict_TouchAreaGrid_Call
                                                trace_allsolid = false;
                                                trace_startsolid = false;
@@ -477,15 +535,17 @@ void sys_phys_simulate_simple(entity this, float dt)
                                        }
                                });
                        }
-                       if (hit && this.solid >= SOLID_TRIGGER && (!IS_ONGROUND(this) || this.groundentity != ent)) {
+                       if (hit && this.solid >= SOLID_TRIGGER && (!IS_ONGROUND(this) || this.groundentity != ent))
+                       {
                                // SV_Impact (ent, trace);
                                tracebox(p0, mn, mx, p1, MOVE_NORMAL, this);
                                void(entity, entity) touched = gettouch(this);
-                               if (touched && this.solid != SOLID_NOT) {
+                               if (touched && this.solid != SOLID_NOT)
                                        touched(ent, this);
-                               }
+
                                void(entity, entity) touched2 = gettouch(ent);
-                               if (this && ent && touched2 && ent.solid != SOLID_NOT) {
+                               if (this && ent && touched2 && ent.solid != SOLID_NOT)
+                               {
                                        trace_endpos = ent.origin;
                                        trace_plane_normal *= -1;
                                        trace_plane_dist *= -1;
@@ -499,9 +559,11 @@ void sys_phys_simulate_simple(entity this, float dt)
                        }
                }
                // end SV_PushEntity
-               if (wasfreed(this)) { return; }
+               if (wasfreed(this))
+                       return;
                tracebox(p0, mn, mx, p1, MOVE_NORMAL, this);
-               if (trace_fraction == 1) { break; }
+               if (trace_fraction == 1)
+                       break;
                movetime *= 1 - min(1, trace_fraction);
                ClipVelocity(vel, trace_plane_normal, vel, 1);
        }
index 8b39cfee11252f1f5ea28c3e870d8d80ca9ef5a7..14b0fcd70db3a336c71a6604314e4edfc4787aae 100644 (file)
@@ -16,8 +16,10 @@ bool sys_phys_override(entity this, float dt)
        int buttons = PHYS_INPUT_BUTTON_MASK(this);
        float idlesince = CS(this).parm_idlesince;
        CS(this).parm_idlesince = time; // in the case that physics are overridden
-       if (PM_check_specialcommand(this, buttons)) { return true; }
-       if (this.PlayerPhysplug && this.PlayerPhysplug(this, dt)) { return true; }
+       if (PM_check_specialcommand(this, buttons))
+               return true;
+       if (this.PlayerPhysplug && this.PlayerPhysplug(this, dt))
+               return true;
        CS(this).parm_idlesince = idlesince;
        return false;
 }
@@ -39,20 +41,26 @@ void sys_phys_monitor(entity this, float dt)
 
 void sys_phys_ai(entity this)
 {
-       if (!IS_BOT_CLIENT(this)) { return; }
+       if (!IS_BOT_CLIENT(this))
+               return;
        bot_think(this);
 }
 
 void sys_phys_pregame_hold(entity this)
 {
-       if (!IS_PLAYER(this)) { return; }
+       if (!IS_PLAYER(this))
+               return;
        const bool allowed_to_move = (time >= game_starttime && !game_stopped);
-       if (!allowed_to_move) {
+       if (!allowed_to_move)
+       {
                this.velocity = '0 0 0';
                set_movetype(this, MOVETYPE_NONE);
                this.disableclientprediction = 2;
-       } else if (this.disableclientprediction == 2) {
-               if (this.move_movetype == MOVETYPE_NONE) { set_movetype(this, MOVETYPE_WALK); }
+       }
+       else if (this.disableclientprediction == 2)
+       {
+               if (this.move_movetype == MOVETYPE_NONE)
+                       set_movetype(this, MOVETYPE_WALK);
                this.disableclientprediction = 0;
        }
 }
@@ -60,29 +68,36 @@ void sys_phys_pregame_hold(entity this)
 void sys_phys_spectator_control(entity this)
 {
        float maxspeed_mod = autocvar_sv_spectator_speed_multiplier;
-       if (!STAT(SPECTATORSPEED, this)) { STAT(SPECTATORSPEED, this) = maxspeed_mod; }
-       if ((CS(this).impulse >= 1 && CS(this).impulse <= 19)
-           || (CS(this).impulse >= 200 && CS(this).impulse <= 209)
-           || (CS(this).impulse >= 220 && CS(this).impulse <= 229)
-          ) {
-               if (this.lastclassname != STR_PLAYER) {
+       if (!STAT(SPECTATORSPEED, this))
+               STAT(SPECTATORSPEED, this) = maxspeed_mod;
+       if ((CS(this).impulse >= 1   && CS(this).impulse <= 19)
+       ||  (CS(this).impulse >= 200 && CS(this).impulse <= 209)
+       ||  (CS(this).impulse >= 220 && CS(this).impulse <= 229))
+       {
+               if (this.lastclassname != STR_PLAYER)
+               {
                        if (CS(this).impulse == 10
-                           || CS(this).impulse == 15
-                           || CS(this).impulse == 18
-                           || (CS(this).impulse >= 200 && CS(this).impulse <= 209)
-                          ) {
-                               STAT(SPECTATORSPEED, this) = bound(autocvar_sv_spectator_speed_multiplier_min, STAT(SPECTATORSPEED, this) + 0.5, autocvar_sv_spectator_speed_multiplier_max);
-                       } else if (CS(this).impulse == 11) {
+                       ||  CS(this).impulse == 15
+                       ||  CS(this).impulse == 18
+                       || (CS(this).impulse >= 200 && CS(this).impulse <= 209))
+                       {
+                               STAT(SPECTATORSPEED, this) = bound(autocvar_sv_spectator_speed_multiplier_min,
+                                                                  STAT(SPECTATORSPEED, this) + 0.5,
+                                                                  autocvar_sv_spectator_speed_multiplier_max);
+                       }
+                       else if (CS(this).impulse == 11)
                                STAT(SPECTATORSPEED, this) = maxspeed_mod;
-                       else if (CS(this).impulse == 12
-                           || CS(this).impulse == 16
-                           || CS(this).impulse == 19
-                           || (CS(this).impulse >= 220 && CS(this).impulse <= 229)
-                                 ) {
-                               STAT(SPECTATORSPEED, this) = bound(autocvar_sv_spectator_speed_multiplier_min, STAT(SPECTATORSPEED, this) - 0.5, autocvar_sv_spectator_speed_multiplier_max);
-                       } else if (CS(this).impulse >= 1 && CS(this).impulse <= 9) {
-                               STAT(SPECTATORSPEED, this) = 1 + 0.5 * (CS(this).impulse - 1);
+                       else if (CS(this).impulse == 12
+                            ||  CS(this).impulse == 16
+                            ||  CS(this).impulse == 19
+                            || (CS(this).impulse >= 220 && CS(this).impulse <= 229))
+                       {
+                               STAT(SPECTATORSPEED, this) = bound(autocvar_sv_spectator_speed_multiplier_min,
+                                                                  STAT(SPECTATORSPEED, this) - 0.5,
+                                                                  autocvar_sv_spectator_speed_multiplier_max);
                        }
+                       else if (CS(this).impulse >= 1 && CS(this).impulse <= 9)
+                               STAT(SPECTATORSPEED, this) = 1 + 0.5 * (CS(this).impulse - 1);
                }  // otherwise just clear
                CS(this).impulse = 0;
        }
@@ -91,7 +106,8 @@ void sys_phys_spectator_control(entity this)
 void sys_phys_fixspeed(entity this, float maxspeed_mod)
 {
        float spd = max(PHYS_MAXSPEED(this), PHYS_MAXAIRSPEED(this)) * maxspeed_mod;
-       if (this.speed != spd) {
+       if (this.speed != spd)
+       {
                this.speed = spd; // TODO: send this as a stat and set the below cvars on the client?
                string temps = ftos(spd);
                stuffcmd(this, strcat("cl_forwardspeed ", temps, "\n"));
@@ -100,11 +116,13 @@ void sys_phys_fixspeed(entity this, float maxspeed_mod)
                stuffcmd(this, strcat("cl_upspeed ", temps, "\n"));
        }
 
-       if (this.jumpspeedcap_min != autocvar_sv_jumpspeedcap_min) {
+       if (this.jumpspeedcap_min != autocvar_sv_jumpspeedcap_min)
+       {
                this.jumpspeedcap_min = autocvar_sv_jumpspeedcap_min;
                stuffcmd(this, sprintf("\ncl_jumpspeedcap_min \"%s\"\n", autocvar_sv_jumpspeedcap_min));
        }
-       if (this.jumpspeedcap_max != autocvar_sv_jumpspeedcap_max) {
+       if (this.jumpspeedcap_max != autocvar_sv_jumpspeedcap_max)
+       {
                this.jumpspeedcap_max = autocvar_sv_jumpspeedcap_max;
                stuffcmd(this, sprintf("\ncl_jumpspeedcap_max \"%s\"\n", autocvar_sv_jumpspeedcap_max));
        }
@@ -112,12 +130,12 @@ void sys_phys_fixspeed(entity this, float maxspeed_mod)
 
 void sys_phys_land(entity this)
 {
-       if (autocvar_speedmeter) {
+       if (autocvar_speedmeter)
                LOG_TRACEF("landing velocity: %v (abs: %f)", this.velocity, vlen(this.velocity));
-       }
-       if (this.jumppadcount > 1) {
+
+       if (this.jumppadcount > 1)
                LOG_TRACEF("%dx jumppad combo", this.jumppadcount);
-       }
+
        this.jumppadcount = 0;
 }