From: bones_was_here Date: Sun, 1 Sep 2024 04:35:28 +0000 (+1000) Subject: Classify arc and shockwave as "new toys" X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b55c0cc9a6ec078977d27da911dea150bc13169b;p=xonotic%2Fxonotic-data.pk3dir.git 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 shockwave being listed in nt_IsNewToy() but not having WEP_FLAG_MUTATORBLOCKED. 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 WEP_FLAG_HIDDEN weapon due to g_weaponarena all in serverbench.cfg. Signed-off-by: bones_was_here --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c0057d597..e2a97d8d4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,7 +36,7 @@ test_compilation_units: test_sv_game: stage: test script: - - export EXPECT=13aa630f559c7683195b8c8d5e0a1522 + - export EXPECT=32efa2daf5e8198a880fd228a46d540c - 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 993f392bb..3cdc8f163 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 674fd8427..fede776cb 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 0fd0747da..175f8d683 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -1872,7 +1872,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;