]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a temporary flag for weapons that penetrate walls (rifle), to avoid a direct...
authorMario <mario@smbclan.net>
Sun, 20 Aug 2017 11:49:54 +0000 (21:49 +1000)
committerMario <mario@smbclan.net>
Sun, 20 Aug 2017 11:49:54 +0000 (21:49 +1000)
qcsrc/common/weapons/weapon.qh
qcsrc/common/weapons/weapon/rifle.qh
qcsrc/server/weapons/tracing.qc

index ea2e2e1730546bc7686b65b55172063a04b00f1a..4be22446bf9dae2f8a314138be4e4b4fd4909426 100644 (file)
@@ -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;
index 29520f5455bcbdb36d69b6dc8586fba85dfd3ffc..ed5496f050f28cb841949a0937ebd4a279c589d6 100644 (file)
@@ -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");
index f657789f8cc5f8a920f2fb096b89b7476405dcf7..8eaa0280a7588fcee50c53a49e73fb23de79c2cc 100644 (file)
@@ -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;