]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add some comments, fix wrong name of a constant
authorterencehill <piuntn@gmail.com>
Fri, 1 Apr 2022 13:04:10 +0000 (15:04 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 7 Apr 2022 10:24:40 +0000 (12:24 +0200)
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/server/client.qc

index 1b3dce4b88f4c5835a313af830bbe6a15a554340..1dc444b3ec3181e8012bfcb9182416d996cd7512 100644 (file)
@@ -242,6 +242,7 @@ string build_mutator_list(string s)
        for (string arg = ""; i < n; i++)
        {
                if (i >= 0) arg = argv(i);
+               // cond is the condition for showing the mutator enabled in the menu
                #define X(name, translated_name, mut, cond) \
                        if(arg == name || (!n && (cond))) { s2 = cons_mid(s2, ", ", translated_name); mut_set_active(mut); }
                X("Dodging"                   , _("Dodging")                   , MUT_DODGING                   , cvar("g_dodging"))
@@ -266,7 +267,7 @@ string build_mutator_list(string s)
                X("Powerups"                  , _("Powerups")                  , MUT_POWERUPS                  , cvar("g_powerups") > 0)
                X("Touch explode"             , _("Touch explode")             , MUT_TOUCHEXPLODE              , cvar("g_touchexplode") > 0)
                X("Wall jumping"              , _("Wall jumping")              , MUT_WALLJUMP                  , cvar("g_walljump"))
-               X("No start weapons"          , _("No start weapons")          , MUT_WEAPONARENA               , cvar_string("g_weaponarena") == "0" && cvar("g_balance_blaster_weaponstartoverride") == 0)
+               X("No start weapons"          , _("No start weapons")          , MUT_NO_START_WEAPONS          , cvar_string("g_weaponarena") == "0" && cvar("g_balance_blaster_weaponstartoverride") == 0)
                X("Nades"                     , _("Nades")                     , MUT_NADES                     , cvar("g_nades"))
                X("Offhand blaster"           , _("Offhand blaster")           , MUT_OFFHAND_BLASTER           , cvar("g_offhand_blaster"))
                #undef X
index 4b53b8d7e12cadc396347d3a6068bf71210176d9..3ca09994ac3be97da0b957c4c512138255b832bd 100644 (file)
@@ -45,7 +45,8 @@ void wordwrap_cb(string s, float l, void(string) callback);
 string draw_currentSkin;
 string draw_UseSkinFor(string pic);
 
-// some of these aren't proper mutators, e.g. jetpack
+// NOTE they aren't all registered mutators, e.g. jetpack, low gravity
+// TODO add missing "mutators"
 const int MUT_DODGING = 0;
 const int MUT_INSTAGIB = 1;
 const int MUT_NEW_TOYS = 2;
@@ -68,7 +69,7 @@ const int MUT_NO_POWERUPS = 18;
 const int MUT_POWERUPS = 19;
 const int MUT_TOUCHEXPLODE = 20;
 const int MUT_WALLJUMP = 21;
-const int MUT_WEAPONARENA = 22;
+const int MUT_NO_START_WEAPONS = 22;
 const int MUT_NADES = 23;
 const int MUT_OFFHAND_BLASTER = 24;
 
index 6422f0dd56a9abdfe25407b59323579be1502218..097cafda03813137afac5c0c28f57fe0c6841c8d 100644 (file)
@@ -1025,6 +1025,9 @@ void SendWelcomemessage(entity this, bool force_centerprint)
        SendWelcomemessage_msg_type(this, force_centerprint, MSG_ONE);
 }
 
+// NOTE csqc uses the active mutators list sent by this function
+// to understand which mutators are enabled
+// also note that they aren't all registered mutators, e.g. jetpack, low gravity
 void SendWelcomemessage_msg_type(entity this, bool force_centerprint, int msg_type)
 {
        WriteByte(msg_type, boolean(autocvar_g_campaign));