From: terencehill Date: Fri, 1 Apr 2022 13:04:10 +0000 (+0200) Subject: Add some comments, fix wrong name of a constant X-Git-Tag: xonotic-v0.8.5~81^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a4ceea1e017f64a8111ce5bff41da42378fca174;p=xonotic%2Fxonotic-data.pk3dir.git Add some comments, fix wrong name of a constant --- diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 1b3dce4b8..1dc444b3e 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -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 diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 4b53b8d7e..3ca09994a 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -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; diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 6422f0dd5..097cafda0 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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));