From: Mario Date: Sun, 20 Aug 2017 11:49:54 +0000 (+1000) Subject: Add a temporary flag for weapons that penetrate walls (rifle), to avoid a direct... X-Git-Tag: xonotic-v0.8.5~2518 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fd1993807d7ada76969f782bd831a2dbc206bca0;p=xonotic%2Fxonotic-data.pk3dir.git Add a temporary flag for weapons that penetrate walls (rifle), to avoid a direct weapon reference --- diff --git a/qcsrc/common/weapons/weapon.qh b/qcsrc/common/weapons/weapon.qh index ea2e2e173..4be22446b 100644 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@ -198,6 +198,7 @@ const int WEP_TYPE_MELEE_PRI = 0x400; // primary attack is melee swing (for const int WEP_TYPE_MELEE_SEC = 0x800; // secondary attack is melee swing (for animation) const int WEP_FLAG_DUALWIELD = 0x1000; // weapon can be dual wielded const int WEP_FLAG_NODUAL = 0x2000; // weapon doesn't work well with dual wielding (fireball etc just explode on fire), doesn't currently prevent anything +const int WEP_FLAG_PENETRATEWALLS = 0x4000; // weapon has high calibur bullets that can penetrate thick walls (WEAPONTODO) // variables: string weaponorder_byid; diff --git a/qcsrc/common/weapons/weapon/rifle.qh b/qcsrc/common/weapons/weapon/rifle.qh index 29520f545..ed5496f05 100644 --- a/qcsrc/common/weapons/weapon/rifle.qh +++ b/qcsrc/common/weapons/weapon/rifle.qh @@ -3,7 +3,7 @@ CLASS(Rifle, Weapon) /* ammotype */ ATTRIB(Rifle, ammo_field, .int, ammo_nails); /* impulse */ ATTRIB(Rifle, impulse, int, 7); -/* flags */ ATTRIB(Rifle, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN); +/* flags */ ATTRIB(Rifle, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS); /* rating */ ATTRIB(Rifle, bot_pickupbasevalue, float, 7000); /* color */ ATTRIB(Rifle, wpcolor, vector, '0.5 1 0'); /* modelname */ ATTRIB(Rifle, mdl, string, "campingrifle"); diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index f657789f8..8eaa0280a 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -30,7 +30,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, .entity weaponentity, vect float oldsolid = ent.dphitcontentsmask; if(!IS_CLIENT(ent)) antilag = false; // no antilag for non-clients! - if (IS_PLAYER(ent) && ent.(weaponentity).m_weapon == WEP_RIFLE) + if (IS_PLAYER(ent) && (ent.(weaponentity).m_weapon.spawnflags & WEP_FLAG_PENETRATEWALLS)) ent.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_CORPSE; else ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;