From 7ff275bf7543ec606920a5628775fcf32f952adc Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Sun, 1 Sep 2024 14:35:28 +1000 Subject: [PATCH] Classify arc and shockwave as "new toys" These are very unfinished, some of the other "new toys" weapons are far more polished. As with the others, they can be allowed to spawn as placed with g_new_toys 1; g_new_toys_autoreplace 0. Fixes item spawning and g_weaponarena all and all_available not respecting WEP_FLAG_HIDDEN (g_warmup_allguns 1 did respect it). Changes the pipeline hash because apparently bots have been using a HIDDEN weapon due to g_weaponarena all in serverbench.cfg. --- .gitlab-ci.yml | 2 +- qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc | 1 + qcsrc/common/weapons/weapon/arc.qh | 2 +- qcsrc/common/weapons/weapon/shockwave.qh | 2 +- qcsrc/server/items/items.qc | 2 +- qcsrc/server/weapons/spawning.qc | 2 +- qcsrc/server/world.qc | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d96b58c55..95476a8cc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,7 +36,7 @@ test_compilation_units: test_sv_game: stage: test script: - - export EXPECT=28a49dd762a7a794f210eeadbbc37a8e + - export EXPECT=bbf98c6d16f911caaaa8a9db6bc2a779 - qcsrc/tools/sv_game-hashtest.sh - exit $? diff --git a/qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc b/qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc index c3e008378..e2a5ea41a 100644 --- a/qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc +++ b/qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc @@ -123,6 +123,7 @@ bool nt_IsNewToy(int w) case WEP_HLAC.m_id: case WEP_RIFLE.m_id: case WEP_SHOCKWAVE.m_id: + case WEP_ARC.m_id: return true; default: return false; diff --git a/qcsrc/common/weapons/weapon/arc.qh b/qcsrc/common/weapons/weapon/arc.qh index a7d289c07..7932fd7d7 100644 --- a/qcsrc/common/weapons/weapon/arc.qh +++ b/qcsrc/common/weapons/weapon/arc.qh @@ -4,7 +4,7 @@ CLASS(Arc, Weapon) /* spawnfunc */ ATTRIB(Arc, m_canonical_spawnfunc, string, "weapon_arc"); /* ammotype */ ATTRIB(Arc, ammo_type, Resource, RES_CELLS); /* impulse */ ATTRIB(Arc, impulse, int, 3); -/* flags */ ATTRIB(Arc, spawnflags, int, WEP_TYPE_HITSCAN); +/* flags */ ATTRIB(Arc, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_TYPE_HITSCAN); /* rating */ ATTRIB(Arc, bot_pickupbasevalue, float, 8000); /* color */ ATTRIB(Arc, wpcolor, vector, '1 1 1'); /* modelname */ ATTRIB(Arc, mdl, string, "arc"); diff --git a/qcsrc/common/weapons/weapon/shockwave.qh b/qcsrc/common/weapons/weapon/shockwave.qh index 76d3c3ef2..241187abc 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qh +++ b/qcsrc/common/weapons/weapon/shockwave.qh @@ -4,7 +4,7 @@ CLASS(Shockwave, Weapon) /* spawnfunc */ ATTRIB(Shockwave, m_canonical_spawnfunc, string, "weapon_shockwave"); /* ammotype */ //ATTRIB(Shockwave, ammo_type, Resource, RES_NONE); /* impulse */ ATTRIB(Shockwave, impulse, int, 2); -/* flags */ ATTRIB(Shockwave, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_HITSCAN | WEP_FLAG_CANCLIMB | WEP_TYPE_MELEE_SEC); +/* flags */ ATTRIB(Shockwave, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_TYPE_HITSCAN | WEP_FLAG_CANCLIMB | WEP_TYPE_MELEE_SEC); /* rating */ ATTRIB(Shockwave, bot_pickupbasevalue, float, 3000); /* color */ ATTRIB(Shockwave, wpcolor, vector, '0.5 0.25 0'); /* modelname */ ATTRIB(Shockwave, mdl, string, "shotgun"); diff --git a/qcsrc/server/items/items.qc b/qcsrc/server/items/items.qc index 839f3ecc9..62d13fb27 100644 --- a/qcsrc/server/items/items.qc +++ b/qcsrc/server/items/items.qc @@ -1648,7 +1648,7 @@ float GiveItems(entity e, float beginarg, float endarg) got += GiveResourceValue(e, RES_HEALTH, op, val); got += GiveResourceValue(e, RES_ARMOR, op, val); case "allweapons": - FOREACH(Weapons, it != WEP_Null && !(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_SPECIALATTACK)), got += GiveWeapon(e, it.m_id, op, val)); + FOREACH(Weapons, it != WEP_Null && !(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK)), got += GiveWeapon(e, it.m_id, op, val)); //case "allbuffs": // all buffs makes a player god, do not want! //FOREACH(StatusEffect, it.instanceOfBuff, got += GiveBuff(e, it, op, val)); case "allammo": diff --git a/qcsrc/server/weapons/spawning.qc b/qcsrc/server/weapons/spawning.qc index e2a28f254..914b91966 100644 --- a/qcsrc/server/weapons/spawning.qc +++ b/qcsrc/server/weapons/spawning.qc @@ -33,7 +33,7 @@ void weapon_defaultspawnfunc(entity this, Weapon wpn) this.classname = wpn.m_canonical_spawnfunc; if (!ITEM_IS_LOOT(this) && !this.m_isreplaced) { - if (wpn.spawnflags & WEP_FLAG_MUTATORBLOCKED) + if (wpn.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN)) { //LOG_WARNF("Attempted to spawn a mutator-blocked weapon rejected: prvm_edict server %i", this); startitem_failed = true; diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index 930a3040c..7f55d7760 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -1875,7 +1875,7 @@ WepSet weapons_all() { WepSet ret = '0 0 0'; FOREACH(Weapons, it != WEP_Null, { - if (!(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_SPECIALATTACK))) + if (!(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK))) ret |= it.m_wepset; }); return ret; -- 2.39.2