From: Dr. Jaska Date: Mon, 27 May 2024 17:05:56 +0000 (+0000) Subject: Fix g_warmup_allguns to work as its description says X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ecc95f341a59c336acb63e228d2d6e63e77e6aea;p=xonotic%2Fxonotic-data.pk3dir.git Fix g_warmup_allguns to work as its description says --- diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index f020ebad8..6dff49f8b 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -995,8 +995,8 @@ MUTATOR_HOOKABLE(CheckRules_World, EV_CheckRules_World); /** weapon info entity */ i(entity, MUTATOR_ARGV_0_entity) \ /** do want? */ i(float, MUTATOR_ARGV_1_float) \ /**/ o(float, MUTATOR_ARGV_1_float) \ - /** want all guns */ i(bool, MUTATOR_ARGV_2_bool) \ - /**/ o(bool, MUTATOR_ARGV_2_bool) \ + /** want all guns */ i(int, MUTATOR_ARGV_2_int) \ + /**/ o(int, MUTATOR_ARGV_2_int) \ /** want mutator blocked */ i(bool, MUTATOR_ARGV_3_bool) \ /**/ o(bool, MUTATOR_ARGV_3_bool) \ /**/ diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index cecef015a..8eae8685b 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -1817,7 +1817,7 @@ void CheckRules_World() } } -float want_weapon(entity weaponinfo, float allguns) +int want_weapon(entity weaponinfo, int allguns) { int d = 0; bool allow_mutatorblocked = false; @@ -1827,10 +1827,12 @@ float want_weapon(entity weaponinfo, float allguns) bool mutator_returnvalue = MUTATOR_CALLHOOK(WantWeapon, weaponinfo, d, allguns, allow_mutatorblocked); d = M_ARGV(1, float); - allguns = M_ARGV(2, bool); + allguns = M_ARGV(2, int); allow_mutatorblocked = M_ARGV(3, bool); - if(allguns) + if(allguns == 1) + d = boolean(!(weaponinfo.spawnflags & (WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK))); + else if(allguns == 2) d = boolean((weaponinfo.spawnflags & WEP_FLAG_NORMAL) && !(weaponinfo.spawnflags & (WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK))); else if(!mutator_returnvalue) d = !(!weaponinfo.weaponstart); diff --git a/qcsrc/server/world.qh b/qcsrc/server/world.qh index 93626429b..024a36da9 100644 --- a/qcsrc/server/world.qh +++ b/qcsrc/server/world.qh @@ -7,7 +7,7 @@ bool autocvar__endmatch; bool autocvar_g_use_ammunition; bool autocvar_g_jetpack; int autocvar_g_warmup; -bool autocvar_g_warmup_allguns; +int autocvar_g_warmup_allguns; bool autocvar_g_warmup_allow_timeout; #define autocvar_g_weaponarena cvar_string("g_weaponarena") string autocvar_quit_and_redirect; @@ -117,7 +117,7 @@ float warmup_start_health; float warmup_start_armorvalue; float g_weapon_stay; -float want_weapon(entity weaponinfo, float allguns); // WEAPONTODO: what still needs done? +int want_weapon(entity weaponinfo, int allguns); // WEAPONTODO: what still needs done? float g_grappling_hook; int warmup_stage;