]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove legacy Quake bbox expansion: projectiles
authorbones_was_here <bones_was_here@xonotic.au>
Thu, 18 May 2023 13:25:23 +0000 (23:25 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Sun, 21 May 2023 14:35:23 +0000 (00:35 +1000)
All the "zero size" projectiles now need a size so they can
trigger a warpzone's touch func. Prevously DP gave most of them
mins '-1 -1 -1' maxs '1 1 1' for the purpose of those tests
(but not all tests).

Because of that these projectiles now need a different way to avoid
colliding with each other. Comparison of the `clipgroup` field is used
as DP_RM_CLIPGROUP will make this more optimal for performance and is
also implemented in QC here for compatibility with old DP versions.

27 files changed:
.gitlab-ci.yml
qcsrc/common/gamemodes/gamemode/nexball/sv_weapon.qc
qcsrc/common/mutators/mutator/overkill/okrpc.qc
qcsrc/common/mutators/mutator/overkill/okrpc.qh
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/devastator.qh
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/electro.qh
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/common/weapons/weapon/hlac.qc
qcsrc/common/weapons/weapon/hook.qc
qcsrc/common/weapons/weapon/minelayer.qc
qcsrc/common/weapons/weapon/minelayer.qh
qcsrc/common/weapons/weapon/mortar.qc
qcsrc/common/weapons/weapon/mortar.qh
qcsrc/common/weapons/weapon/porto.qc
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/common/weapons/weapon/seeker.qh
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/common/weapons/weapon/vaporizer.qh
qcsrc/server/hook.qc
qcsrc/server/hook.qh
qcsrc/server/weapons/common.qh
qcsrc/server/weapons/tracing.qh

index b56f2b44d1b4b126e5b11f3be048aa75e21feaca..26248155fbd55a04f2d3cb30187015a3a26798d8 100644 (file)
@@ -75,7 +75,7 @@ test_sv_game:
     - wget -nv -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints\r
     - wget -nv -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache\r
 \r
-    - EXPECT=f2226bf353b6ff3dd3c489a742ce4e6a\r
+    - EXPECT=2a66d8d70fb6aa726f8b5edf453afea3\r
     - HASH=$(${ENGINE} +exec serverbench.cfg\r
       | tee /dev/stderr\r
       | grep '^:'\r
index d3d3a6a9dcb30ae59eb103760e1f8cb5ca00c952..7ed7a4d197ea389961e1367211ed70980a2e545a 100644 (file)
@@ -165,7 +165,7 @@ void W_Nexball_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
        PROJECTILE_MAKETRIGGER(missile);
 
        //setmodel(missile, "models/elaser.mdl");  // precision set below
-       setsize(missile, '0 0 0', '0 0 0');
+       setsize(missile, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS);
        setorigin(missile, w_shotorg);
 
        W_SetupProjVelocity_Basic(missile, autocvar_g_balance_nexball_secondary_speed, 0);
index d84a6766a3bbafe5fe27fab2ecafbbdf4e433818..9a3ba973f530068ed36d6a6e846c6397f7473147 100644 (file)
@@ -89,7 +89,7 @@ void W_OverkillRocketPropelledChainsaw_Attack(Weapon thiswep, entity actor, .ent
        entity missile = spawn(); //WarpZone_RefSys_SpawnSameRefSys(actor);
 
        W_DecreaseAmmo(thiswep, actor, WEP_CVAR_PRI(okrpc, ammo), weaponentity);
-       W_SetupShot_ProjectileSize(actor, weaponentity, '-3 -3 -3', '3 3 3', false, 5, SND_ROCKET_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(okrpc, damage), thiswep.m_id);
+       W_SetupShot_ProjectileSize(actor, weaponentity, RPC_MINS, RPC_MAXS, false, 5, SND_ROCKET_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(okrpc, damage), thiswep.m_id);
        W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
        PROJECTILE_MAKETRIGGER(missile);
 
@@ -107,7 +107,7 @@ void W_OverkillRocketPropelledChainsaw_Attack(Weapon thiswep, entity actor, .ent
 
        missile.projectiledeathtype = thiswep.m_id;
        missile.weaponentity_fld = weaponentity;
-       setsize (missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
+       setsize (missile, RPC_MINS, RPC_MAXS); // give it some size so it can be shot
 
        setorigin(missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
        W_SetupProjVelocity_Basic(missile, WEP_CVAR_PRI(okrpc, speed), 0);
index 23421d2f542dfd4f467994ec04d34ab605c2b89e..ffa489f9581b8aae65b198d0286272c947b80f5b 100644 (file)
@@ -22,6 +22,9 @@ CLASS(OverkillRocketPropelledChainsaw, Weapon)
 /* wepname   */ ATTRIB(OverkillRocketPropelledChainsaw, m_name, string, _("Overkill Rocket Propelled Chainsaw"));
 /* legacy    */ ATTRIB(OverkillRocketPropelledChainsaw, m_deprecated_netname, string, "rpc");
 
+#define RPC_MINS '-4 -4 -4' // 0.8.5 used '-3 -3 -3' (before sv_legacy_bbox_expand 0)
+#define RPC_MAXS '4 4 4'    // 0.8.5 used '3 3 3'    (before sv_legacy_bbox_expand 0)
+
 #define X(BEGIN, P, END, class, prefix) \
        BEGIN(class) \
                P(class, prefix, ammo, float, PRI) \
index 43d7a03a400dae69ba74e6e6858435ad9ad113fe..5aa7bfa5254391e30d1626b9ebdd9f0c81aadf00 100644 (file)
@@ -158,10 +158,11 @@ void W_Arc_Attack_Bolt(Weapon thiswep, entity actor, .entity weaponentity, int f
        setthink(missile, adaptor_think2use_hittype_splash);
        missile.nextthink = time + WEP_CVAR(arc, bolt_lifetime);
        PROJECTILE_MAKETRIGGER(missile);
+       missile.clipgroup = CLIPGROUP_UNHITTABLEPROJ;
        missile.projectiledeathtype = thiswep.m_id | HITTYPE_SECONDARY;
        missile.weaponentity_fld = weaponentity;
        setorigin(missile, w_shotorg);
-       setsize(missile, '0 0 0', '0 0 0');
+       setsize(missile, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS);
 
        set_movetype(missile, MOVETYPE_BOUNCEMISSILE);
        W_SetupProjVelocity_PRE(missile, arc, bolt_);
index 3c134a3db37b85bb21848a322098b4ba81ba7c19..c4d6720c2d37c915457ed0a7453f31f5a7fb4a7c 100644 (file)
@@ -57,9 +57,10 @@ void W_Blaster_Attack(
        missile.bot_dodge = true;
        missile.bot_dodgerating = atk_damage;
        PROJECTILE_MAKETRIGGER(missile);
+       missile.clipgroup = CLIPGROUP_UNHITTABLEPROJ;
 
        setorigin(missile, w_shotorg);
-       setsize(missile, '0 0 0', '0 0 0');
+       setsize(missile, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS);
 
        float atk_speed = WEP_CVAR_BOTH(blaster, isprimary, speed);
        float atk_spread = WEP_CVAR_BOTH(blaster, isprimary, spread);
index ae1eae28459adfb50c468fc37571feb1000e9a69..074a99abab9887a7271d4ff78cd1ddfbbd3a9ae6 100644 (file)
@@ -341,11 +341,12 @@ void W_Crylink_Attack(Weapon thiswep, entity actor, .entity weaponentity)
 
                set_movetype(proj, MOVETYPE_BOUNCEMISSILE);
                PROJECTILE_MAKETRIGGER(proj);
+               proj.clipgroup = CLIPGROUP_UNHITTABLEPROJ;
                proj.projectiledeathtype = thiswep.m_id;
                //proj.gravity = 0.001;
 
                setorigin(proj, w_shotorg);
-               setsize(proj, '0 0 0', '0 0 0');
+               setsize(proj, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS);
 
 
                s = '0 0 0';
@@ -454,11 +455,12 @@ void W_Crylink_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
 
                set_movetype(proj, MOVETYPE_BOUNCEMISSILE);
                PROJECTILE_MAKETRIGGER(proj);
+               proj.clipgroup = CLIPGROUP_UNHITTABLEPROJ;
                proj.projectiledeathtype = thiswep.m_id | HITTYPE_SECONDARY;
                //proj.gravity = 0.001;
 
                setorigin(proj, w_shotorg);
-               setsize(proj, '0 0 0', '0 0 0');
+               setsize(proj, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS);
 
                if(WEP_CVAR_SEC(crylink, spreadtype) == 1)
                {
index 6f428dc6c413430cb52440659da1c3a5eac6e6b5..40a2e35d459a38b335589ee7925af388d89bff1f 100644 (file)
@@ -307,7 +307,7 @@ void W_Devastator_Attack(Weapon thiswep, entity actor, .entity weaponentity, int
 {
        W_DecreaseAmmo(thiswep, actor, WEP_CVAR(devastator, ammo), weaponentity);
 
-       W_SetupShot_ProjectileSize(actor, weaponentity, '-3 -3 -3', '3 3 3', false, 5, SND_ROCKET_FIRE, CH_WEAPON_A, WEP_CVAR(devastator, damage), thiswep.m_id);
+       W_SetupShot_ProjectileSize(actor, weaponentity, ROCKET_MINS, ROCKET_MAXS, false, 5, SND_ROCKET_FIRE, CH_WEAPON_A, WEP_CVAR(devastator, damage), thiswep.m_id);
        W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
 
        entity missile = WarpZone_RefSys_SpawnSameRefSys(actor);
@@ -333,7 +333,7 @@ void W_Devastator_Attack(Weapon thiswep, entity actor, .entity weaponentity, int
        set_movetype(missile, MOVETYPE_FLY);
        PROJECTILE_MAKETRIGGER(missile);
        missile.projectiledeathtype = thiswep.m_id;
-       setsize(missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
+       setsize(missile, ROCKET_MINS, ROCKET_MAXS); // give it some size so it can be shot
 
        setorigin(missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
        W_SetupProjVelocity_Basic(missile, WEP_CVAR(devastator, speedstart), 0);
index 7a10bf62a17358ff085a8464d70fcdc24f1b7bfb..e849f6957972a953a1a4c5c42044b73636675b60 100644 (file)
@@ -20,6 +20,9 @@ CLASS(Devastator, Weapon)
 /* wepname   */ ATTRIB(Devastator, m_name, string, _("Devastator"));
 /* legacy    */ ATTRIB(Devastator, m_deprecated_netname, string, "rocketlauncher");
 
+#define ROCKET_MINS '-4 -4 -4' // 0.8.5 used '-3 -3 -3' (before sv_legacy_bbox_expand 0)
+#define ROCKET_MAXS '4 4 4'    // 0.8.5 used '3 3 3'    (before sv_legacy_bbox_expand 0)
+
 #define X(BEGIN, P, END, class, prefix) \
        BEGIN(class) \
                P(class, prefix, ammo, float, NONE) \
index 2c03871ce54580335fe95adff435d86d4a555818..fbd92f0cb36677a57bd5672efceab9e51357e3f7 100644 (file)
@@ -221,8 +221,8 @@ void W_Electro_Attack_Bolt(Weapon thiswep, entity actor, .entity weaponentity)
        W_SetupShot_ProjectileSize(
                actor,
                weaponentity,
-               '0 0 -3',
-               '0 0 -3',
+               BOLT_MINS,
+               BOLT_MAXS,
                false,
                2,
                SND_ELECTRO_FIRE,
@@ -242,6 +242,7 @@ void W_Electro_Attack_Bolt(Weapon thiswep, entity actor, .entity weaponentity)
        proj.nextthink = time;
        proj.ltime = time + WEP_CVAR_PRI(electro, lifetime);
        PROJECTILE_MAKETRIGGER(proj);
+       proj.clipgroup = CLIPGROUP_UNHITTABLEPROJ;
        proj.projectiledeathtype = thiswep.m_id;
        proj.weaponentity_fld = weaponentity;
        setorigin(proj, w_shotorg);
@@ -251,7 +252,7 @@ void W_Electro_Attack_Bolt(Weapon thiswep, entity actor, .entity weaponentity)
        W_SetupProjVelocity_PRI(proj, electro);
        proj.angles = vectoangles(proj.velocity);
        settouch(proj, W_Electro_TouchExplode);
-       setsize(proj, '0 0 -3', '0 0 -3');
+       setsize(proj, BOLT_MINS, BOLT_MAXS);
        proj.flags = FL_PROJECTILE;
        IL_PUSH(g_projectiles, proj);
        IL_PUSH(g_bot_dodge, proj);
@@ -422,8 +423,8 @@ void W_Electro_Attack_Orb(Weapon thiswep, entity actor, .entity weaponentity)
        W_SetupShot_ProjectileSize(
                actor,
                weaponentity,
-               '-4 -4 -4',
-               '4 4 4',
+               ORB_MINS,
+               ORB_MAXS,
                false,
                2,
                SND_ELECTRO_FIRE2,
@@ -454,7 +455,7 @@ void W_Electro_Attack_Orb(Weapon thiswep, entity actor, .entity weaponentity)
        set_movetype(proj, MOVETYPE_BOUNCE);
        W_SetupProjVelocity_UP_SEC(proj, electro);
        settouch(proj, W_Electro_Orb_Touch);
-       setsize(proj, '-4 -4 -4', '4 4 4');
+       setsize(proj, ORB_MINS, ORB_MAXS);
        proj.takedamage = DAMAGE_YES;
        proj.damageforcescale = WEP_CVAR_SEC(electro, damageforcescale);
        SetResourceExplicit(proj, RES_HEALTH, WEP_CVAR_SEC(electro, health));
index e4263403bf82161b52cf66eac3a1507e9f4b3748..b0b3ba799d7d57d4bce5776c8c0d27eeb22cdd2e 100644 (file)
@@ -19,6 +19,11 @@ CLASS(Electro, Weapon)
 /* refname   */ ATTRIB(Electro, netname, string, "electro");
 /* wepname   */ ATTRIB(Electro, m_name, string, _("Electro"));
 
+#define ORB_MINS  '-5 -5 -5' // 0.8.5 used '-4 -4 -4' (before sv_legacy_bbox_expand 0)
+#define ORB_MAXS  '5 5 5'    // 0.8.5 used '4 4 4'    (before sv_legacy_bbox_expand 0)
+#define BOLT_MINS '-1 -1 -4' // 0.8.5 used '0 0 -3'   (before sv_legacy_bbox_expand 0)
+#define BOLT_MAXS '1 1 -2'   // 0.8.5 used '0 0 -3'   (before sv_legacy_bbox_expand 0)
+
 #define X(BEGIN, P, END, class, prefix) \
        BEGIN(class) \
                P(class, prefix, ammo, float, BOTH) \
index a8c12efccd2002dad48197ffccd8be1b6be6a3c0..096f8ed8b7066e23eaa8fefd07c6aa729f4a1c09 100644 (file)
@@ -102,10 +102,11 @@ void W_Hagar_Attack(Weapon thiswep, entity actor, .entity weaponentity)
        setthink(missile, adaptor_think2use_hittype_splash);
        missile.nextthink = time + WEP_CVAR_PRI(hagar, lifetime);
        PROJECTILE_MAKETRIGGER(missile);
+       missile.clipgroup = CLIPGROUP_UNHITTABLEPROJ;
        missile.projectiledeathtype = thiswep.m_id;
        missile.weaponentity_fld = weaponentity;
        setorigin(missile, w_shotorg);
-       setsize(missile, '0 0 0', '0 0 0');
+       setsize(missile, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS);
 
        set_movetype(missile, MOVETYPE_FLY);
        W_SetupProjVelocity_PRI(missile, hagar);
@@ -149,10 +150,11 @@ void W_Hagar_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
        setthink(missile, adaptor_think2use_hittype_splash);
        missile.nextthink = time + WEP_CVAR_SEC(hagar, lifetime_min) + random() * WEP_CVAR_SEC(hagar, lifetime_rand);
        PROJECTILE_MAKETRIGGER(missile);
+       missile.clipgroup = CLIPGROUP_UNHITTABLEPROJ;
        missile.projectiledeathtype = thiswep.m_id | HITTYPE_SECONDARY;
        missile.weaponentity_fld = weaponentity;
        setorigin(missile, w_shotorg);
-       setsize(missile, '0 0 0', '0 0 0');
+       setsize(missile, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS);
 
        set_movetype(missile, MOVETYPE_BOUNCEMISSILE);
        W_SetupProjVelocity_SEC(missile, hagar);
@@ -211,10 +213,11 @@ void W_Hagar_Attack2_Load_Release(Weapon thiswep, entity actor, .entity weaponen
                setthink(missile, adaptor_think2use_hittype_splash);
                missile.nextthink = time + WEP_CVAR_SEC(hagar, lifetime_min) + random() * WEP_CVAR_SEC(hagar, lifetime_rand);
                PROJECTILE_MAKETRIGGER(missile);
+               missile.clipgroup = CLIPGROUP_UNHITTABLEPROJ;
                missile.projectiledeathtype = thiswep.m_id | HITTYPE_SECONDARY;
                missile.weaponentity_fld = weaponentity;
                setorigin(missile, w_shotorg);
-               setsize(missile, '0 0 0', '0 0 0');
+               setsize(missile, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS);
                set_movetype(missile, MOVETYPE_FLY);
                missile.missile_flags = MIF_SPLASH;
 
index 18dde744003019106b11e8b46d373900bf6cefba..4282598a99877361aeb8c07ae0ba72a438003b68 100644 (file)
@@ -45,9 +45,10 @@ void W_HLAC_Attack(Weapon thiswep, entity actor, .entity weaponentity)
 
        set_movetype(missile, MOVETYPE_FLY);
        PROJECTILE_MAKETRIGGER(missile);
+       missile.clipgroup = CLIPGROUP_UNHITTABLEPROJ;
 
        setorigin(missile, w_shotorg);
-       setsize(missile, '0 0 0', '0 0 0');
+       setsize(missile, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS);
 
        W_SetupProjVelocity_Basic(missile, WEP_CVAR_PRI(hlac, speed), spread);
        //missile.angles = vectoangles(missile.velocity); // csqc
@@ -90,9 +91,10 @@ void W_HLAC_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
 
                set_movetype(missile, MOVETYPE_FLY);
                PROJECTILE_MAKETRIGGER(missile);
+               missile.clipgroup = CLIPGROUP_UNHITTABLEPROJ;
 
                setorigin(missile, w_shotorg);
-               setsize(missile, '0 0 0', '0 0 0');
+               setsize(missile, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS);
 
                W_SetupProjVelocity_Basic(missile, WEP_CVAR_SEC(hlac, speed), spread);
                //missile.angles = vectoangles(missile.velocity); // csqc
index 94d4ac33ed765899b1fd0cd46ae9a964f8d54324..30c2233ac72489e6a7a359634033c3c84767f974 100644 (file)
@@ -77,10 +77,11 @@ void W_Hook_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
        gren.bot_dodgerating = WEP_CVAR_SEC(hook, damage);
        set_movetype(gren, MOVETYPE_TOSS);
        PROJECTILE_MAKETRIGGER(gren);
+       gren.clipgroup = CLIPGROUP_UNHITTABLEPROJ;
        gren.projectiledeathtype = WEP_HOOK.m_id | HITTYPE_SECONDARY;
        gren.weaponentity_fld = weaponentity;
        setorigin(gren, w_shotorg);
-       setsize(gren, '0 0 0', '0 0 0');
+       setsize(gren, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS);
 
        gren.nextthink = time + WEP_CVAR_SEC(hook, lifetime);
        setthink(gren, adaptor_think2use_hittype_splash);
index c73db2bc28f1d9e634d87b36fc4a21b5146b6e39..40474b874030a8fed1b2a03e933b064a82057733 100644 (file)
@@ -20,7 +20,7 @@ void W_MineLayer_Stick(entity this, entity to)
        newmine.realowner = this.realowner;
        setorigin(newmine, this.origin);
        setmodel(newmine, MDL_MINELAYER_MINE);
-       setsize(newmine, '-4 -4 -4', '4 4 4');
+       setsize(newmine, MINE_MINS, MINE_MAXS);
        newmine.angles = vectoangles(-trace_plane_normal); // face against the surface
 
        newmine.movedir = -trace_plane_normal;
@@ -269,7 +269,7 @@ void W_MineLayer_Attack(Weapon thiswep, entity actor, .entity weaponentity)
 
        W_DecreaseAmmo(thiswep, actor, WEP_CVAR(minelayer, ammo), weaponentity);
 
-       W_SetupShot_ProjectileSize(actor, weaponentity, '-4 -4 -4', '4 4 4', false, 5, SND_MINE_FIRE, CH_WEAPON_A, WEP_CVAR(minelayer, damage), thiswep.m_id);
+       W_SetupShot_ProjectileSize(actor, weaponentity, MINE_MINS, MINE_MAXS, false, 5, SND_MINE_FIRE, CH_WEAPON_A, WEP_CVAR(minelayer, damage), thiswep.m_id);
        W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
 
        entity mine = WarpZone_RefSys_SpawnSameRefSys(actor);
@@ -295,7 +295,7 @@ void W_MineLayer_Attack(Weapon thiswep, entity actor, .entity weaponentity)
        PROJECTILE_MAKETRIGGER(mine);
        mine.projectiledeathtype = thiswep.m_id;
        mine.weaponentity_fld = weaponentity;
-       setsize(mine, '-4 -4 -4', '4 4 4'); // give it some size so it can be shot
+       setsize(mine, MINE_MINS, MINE_MAXS);
 
        setorigin(mine, w_shotorg - v_forward * 4); // move it back so it hits the wall at the right point
        W_SetupProjVelocity_Basic(mine, WEP_CVAR(minelayer, speed), 0);
index a574510f57736e373e0107ea59202d102ca09fca..ce331ca6b5e82a819c2fab64e1b0bbb20364b22b 100644 (file)
@@ -19,6 +19,9 @@ CLASS(MineLayer, Weapon)
 /* refname   */ ATTRIB(MineLayer, netname, string, "minelayer");
 /* wepname   */ ATTRIB(MineLayer, m_name, string, _("Mine Layer"));
 
+#define MINE_MINS '-5 -5 -5' // 0.8.5 used '-4 -4 -4' (before sv_legacy_bbox_expand 0)
+#define MINE_MAXS '5 5 5'    // 0.8.5 used '4 4 4'    (before sv_legacy_bbox_expand 0)
+
 #define X(BEGIN, P, END, class, prefix) \
        BEGIN(class) \
                P(class, prefix, ammo, float, NONE) \
index 442f88265e52a0f5462079e63a96bde3fc8d27e1..0a543cbbe9c2c65d5953ede23a884e6babc436da 100644 (file)
@@ -151,7 +151,7 @@ void W_Mortar_Attack(Weapon thiswep, entity actor, .entity weaponentity)
 {
        W_DecreaseAmmo(thiswep, actor, WEP_CVAR_PRI(mortar, ammo), weaponentity);
 
-       W_SetupShot_ProjectileSize(actor, weaponentity, '-3 -3 -3', '3 3 3', false, 4, SND_GRENADE_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage), thiswep.m_id);
+       W_SetupShot_ProjectileSize(actor, weaponentity, GREN_MINS, GREN_MAXS, false, 4, SND_GRENADE_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage), thiswep.m_id);
        w_shotdir = v_forward; // no TrueAim for grenades please
 
        W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
@@ -167,7 +167,7 @@ void W_Mortar_Attack(Weapon thiswep, entity actor, .entity weaponentity)
        gren.projectiledeathtype = thiswep.m_id;
        gren.weaponentity_fld = weaponentity;
        setorigin(gren, w_shotorg);
-       setsize(gren, '-3 -3 -3', '3 3 3');
+       setsize(gren, GREN_MINS, GREN_MAXS);
 
        gren.cnt = time + WEP_CVAR_PRI(mortar, lifetime);
        gren.nextthink = time;
@@ -203,7 +203,7 @@ void W_Mortar_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
 
        W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(mortar, ammo), weaponentity);
 
-       W_SetupShot_ProjectileSize(actor, weaponentity, '-3 -3 -3', '3 3 3', false, 4, SND_GRENADE_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage), thiswep.m_id | HITTYPE_SECONDARY);
+       W_SetupShot_ProjectileSize(actor, weaponentity, GREN_MINS, GREN_MAXS, false, 4, SND_GRENADE_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage), thiswep.m_id | HITTYPE_SECONDARY);
        w_shotdir = v_forward; // no TrueAim for grenades please
 
        W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
@@ -219,7 +219,7 @@ void W_Mortar_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
        gren.projectiledeathtype = thiswep.m_id | HITTYPE_SECONDARY;
        gren.weaponentity_fld = weaponentity;
        setorigin(gren, w_shotorg);
-       setsize(gren, '-3 -3 -3', '3 3 3');
+       setsize(gren, GREN_MINS, GREN_MAXS);
 
        gren.nextthink = time + WEP_CVAR_SEC(mortar, lifetime);
        setthink(gren, adaptor_think2use_hittype_splash);
index 6d44e75644ca0f2efe5865a2f855d46cec3f2c46..ef86c5f2a5057cc46e03e760ca9eacbef48ac7a5 100644 (file)
@@ -20,6 +20,9 @@ CLASS(Mortar, Weapon)
 /* wepname   */ ATTRIB(Mortar, m_name, string, _("Mortar"));
 /* legacy    */ ATTRIB(Mortar, m_deprecated_netname, string, "grenadelauncher");
 
+#define GREN_MINS '-4 -4 -4' // 0.8.5 used '-3 -3 -3' (before sv_legacy_bbox_expand 0)
+#define GREN_MAXS '4 4 4'    // 0.8.5 used '3 3 3'    (before sv_legacy_bbox_expand 0)
+
 #define X(BEGIN, P, END, class, prefix) \
        BEGIN(class) \
                P(class, prefix, ammo, float, BOTH) \
index b681078c2670d07d8a27cf04d632466fbda11c80..ab400856c3e89745aa649e1ee359a7fb35192189 100644 (file)
@@ -298,10 +298,11 @@ void W_Porto_Attack(Weapon thiswep, entity actor, .entity weaponentity, float ty
        gren.bot_dodgerating = 200;
        set_movetype(gren, MOVETYPE_BOUNCEMISSILE);
        PROJECTILE_MAKETRIGGER(gren);
+       gren.clipgroup = CLIPGROUP_UNHITTABLEPROJ;
        gren.effects = EF_RED;
        gren.scale = 4;
        setorigin(gren, w_shotorg);
-       setsize(gren, '0 0 0', '0 0 0');
+       setsize(gren, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS);
 
        gren.nextthink = time + WEP_CVAR_BOTH(porto, (type <= 0), lifetime);
        setthink(gren, W_Porto_Think);
index 7abb2a43c3f96e3e73df2db9ec6235ae2cdf4691..be6d6e13c81dbde5248df327799fb242593d9399 100644 (file)
@@ -169,7 +169,7 @@ void W_Seeker_Fire_Missile(Weapon thiswep, entity actor, .entity weaponentity, v
        W_DecreaseAmmo(thiswep, actor, WEP_CVAR(seeker, missile_ammo), weaponentity);
 
        makevectors(actor.v_angle);
-       W_SetupShot_ProjectileSize(actor, weaponentity, '-4 -4 -4', '4 4 4', false, 2, SND_SEEKER_FIRE, CH_WEAPON_A, 0, ((m_target != NULL) ? thiswep.m_id | HITTYPE_SECONDARY : thiswep.m_id));
+       W_SetupShot_ProjectileSize(actor, weaponentity, MISSILE_MINS, MISSILE_MAXS, false, 2, SND_SEEKER_FIRE, CH_WEAPON_A, 0, ((m_target != NULL) ? thiswep.m_id | HITTYPE_SECONDARY : thiswep.m_id));
        w_shotorg += f_diff;
        W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
 
@@ -203,7 +203,7 @@ void W_Seeker_Fire_Missile(Weapon thiswep, entity actor, .entity weaponentity, v
 
 
        setorigin(missile, w_shotorg);
-       setsize(missile, '-4 -4 -4', '4 4 4');
+       setsize(missile, MISSILE_MINS, MISSILE_MAXS);
        set_movetype(missile, MOVETYPE_FLYMISSILE);
        missile.flags = FL_PROJECTILE;
        IL_PUSH(g_projectiles, missile);
@@ -266,7 +266,7 @@ void W_Seeker_Fire_Flac(Weapon thiswep, entity actor, .entity weaponentity)
                        f_diff = '+1.25 +3.75 0';
                        break;
        }
-       W_SetupShot_ProjectileSize(actor, weaponentity, '-2 -2 -2', '2 2 2', false, 2, SND_FLAC_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, flac_damage), thiswep.m_id | HITTYPE_SECONDARY);
+       W_SetupShot_ProjectileSize(actor, weaponentity, FLAC_MINS, FLAC_MAXS, false, 2, SND_FLAC_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, flac_damage), thiswep.m_id | HITTYPE_SECONDARY);
        w_shotorg += f_diff;
 
        // uses hagar effects!
@@ -294,7 +294,7 @@ void W_Seeker_Fire_Flac(Weapon thiswep, entity actor, .entity weaponentity)
        //missile.scale = 0.4; // BUG: the model is too big
 
        setorigin(missile, w_shotorg);
-       setsize(missile, '-2 -2 -2', '2 2 2');
+       setsize(missile, FLAC_MINS, FLAC_MAXS);
 
        W_SetupProjVelocity_UP_PRE(missile, seeker, flac_);
        CSQCProjectile(missile, true, PROJECTILE_FLAC, true);
@@ -489,7 +489,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep, entity actor, .entity weaponentity)
 {
        W_DecreaseAmmo(thiswep, actor, WEP_CVAR(seeker, tag_ammo), weaponentity);
 
-       W_SetupShot_ProjectileSize(actor, weaponentity, '-2 -2 -2', '2 2 2', false, 2, SND_TAG_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count), thiswep.m_id | HITTYPE_BOUNCE | HITTYPE_SECONDARY);
+       W_SetupShot_ProjectileSize(actor, weaponentity, TAG_MINS, TAG_MAXS, false, 2, SND_TAG_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count), thiswep.m_id | HITTYPE_BOUNCE | HITTYPE_SECONDARY);
 
        entity missile          = new(seeker_tag);
        missile.weaponentity_fld = weaponentity;
@@ -508,7 +508,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep, entity actor, .entity weaponentity)
        missile.damageforcescale = WEP_CVAR(seeker, tag_damageforcescale);
 
        setorigin(missile, w_shotorg);
-       setsize(missile, '-2 -2 -2', '2 2 2');
+       setsize(missile, TAG_MINS, TAG_MAXS);
 
        missile.flags = FL_PROJECTILE;
        IL_PUSH(g_projectiles, missile);
index d3024a436e485fa5a0bda7557d1489a4ebaca4a8..81a2876352162570ca0ad5151eb15d7d10925760 100644 (file)
@@ -19,6 +19,13 @@ CLASS(Seeker, Weapon)
 /* refname   */ ATTRIB(Seeker, netname, string, "seeker");
 /* wepname   */ ATTRIB(Seeker, m_name, string, _("T.A.G. Seeker"));
 
+#define MISSILE_MINS '-5 -5 -5' // 0.8.5 used '-4 -4 -4' (before sv_legacy_bbox_expand 0)
+#define MISSILE_MAXS '5 5 5'    // 0.8.5 used '4 4 4'    (before sv_legacy_bbox_expand 0)
+#define TAG_MINS     '-3 -3 -3' // 0.8.5 used '-2 -2 -2' (before sv_legacy_bbox_expand 0)
+#define TAG_MAXS     '3 3 3'    // 0.8.5 used '2 2 2'    (before sv_legacy_bbox_expand 0)
+#define FLAC_MINS    '-3 -3 -3' // 0.8.5 used '-2 -2 -2' (before sv_legacy_bbox_expand 0)
+#define FLAC_MAXS    '3 3 3'    // 0.8.5 used '2 2 2'    (before sv_legacy_bbox_expand 0)
+
 #define X(BEGIN, P, END, class, prefix) \
        BEGIN(class) \
        P(class, prefix, flac_ammo, float, NONE) \
index 71bc39a7c7e16c8cee309c7b776afd8a2aed3b66..b29fd38f4f6247354123112a28fbc673a95cd0f2 100644 (file)
@@ -194,7 +194,7 @@ void W_RocketMinsta_Attack(entity actor, .entity weaponentity, int mode)
        int laser_count = max(1, autocvar_g_rm_laser_count);
        int total = (mode == 0) ? laser_count : 1;
        Sound snd = (mode == 0) ? SND_CRYLINK_FIRE : SND_ELECTRO_FIRE2;
-       W_SetupShot_ProjectileSize(actor, weaponentity, '0 0 -3', '0 0 -3', false, 2, snd, CH_WEAPON_A, autocvar_g_rm_laser_damage, WEP_ELECTRO.m_id);
+       W_SetupShot_ProjectileSize(actor, weaponentity, RM_MINS, RM_MAXS, false, 2, snd, CH_WEAPON_A, autocvar_g_rm_laser_damage, WEP_ELECTRO.m_id);
 
        // uses electro effects
        W_MuzzleFlash(WEP_ELECTRO, actor, weaponentity, w_shotorg, w_shotdir);
@@ -230,7 +230,7 @@ void W_RocketMinsta_Attack(entity actor, .entity weaponentity, int mode)
                proj.velocity = W_CalculateProjectileVelocity(actor, actor.velocity, proj.velocity, true);
                proj.angles = vectoangles(proj.velocity);
                settouch(proj, W_RocketMinsta_Laser_Touch);
-               setsize(proj, '0 0 -3', '0 0 -3');
+               setsize(proj, RM_MINS, RM_MAXS);
                proj.flags = FL_PROJECTILE;
                IL_PUSH(g_projectiles, proj);
                IL_PUSH(g_bot_dodge, proj);
index 87249f7364b9b6525e9ac74153d4d3902cecd1dd..b0c703809c88e90fd53be188564e68de4fd02b0c 100644 (file)
@@ -21,6 +21,9 @@ CLASS(Vaporizer, Weapon)
 /* wepname   */ ATTRIB(Vaporizer, m_name, string, _("Vaporizer"));
 /* legacy    */ ATTRIB(Vaporizer, m_deprecated_netname, string, "minstanex");
 
+#define RM_MINS '-1 -1 -4' // 0.8.5 used '0 0 -3' (before sv_legacy_bbox_expand 0)
+#define RM_MAXS '1 1 -2'   // 0.8.5 used '0 0 -3' (before sv_legacy_bbox_expand 0)
+
 #define X(BEGIN, P, END, class, prefix) \
        BEGIN(class) \
                P(class, prefix, ammo, float, PRI) \
index a50830348a49caaf109b60fd7269ca3fc02c1554..5bc00c1506a4e202fe4891d12e1aeac021c34fc1 100644 (file)
@@ -370,7 +370,7 @@ void FireGrapplingHook(entity actor, .entity weaponentity)
        vector vs = hook_shotorigin[s];
        vector oldmovedir = actor.(weaponentity).movedir;
        actor.(weaponentity).movedir = vs;
-       W_SetupShot_ProjectileSize(actor, weaponentity, '-3 -3 -3', '3 3 3', true, 0, SND_HOOK_FIRE, CH_WEAPON_B, 0, WEP_HOOK.m_id);
+       W_SetupShot_ProjectileSize(actor, weaponentity, HOOK_MINS, HOOK_MAXS, true, 0, SND_HOOK_FIRE, CH_WEAPON_B, 0, WEP_HOOK.m_id);
        W_MuzzleFlash(WEP_HOOK, actor, weaponentity, w_shotorg, '0 0 0');
        actor.(weaponentity).movedir = oldmovedir;
 
@@ -388,7 +388,7 @@ void FireGrapplingHook(entity actor, .entity weaponentity)
        PROJECTILE_MAKETRIGGER(missile);
 
        //setmodel (missile, MDL_HOOK); // precision set below
-       setsize (missile, '-3 -3 -3', '3 3 3');
+       setsize (missile, HOOK_MINS, HOOK_MAXS);
        setorigin(missile, w_shotorg);
 
        missile.state = 0; // not latched onto anything
index 1b0729bd05ffe5d9bc7b53ef865bf0c06ebbc92f..2af2b66d3005cb5c7a3aab64396739b5063e1abd 100644 (file)
@@ -35,3 +35,5 @@ const float HOOK_WAITING_FOR_RELEASE = BIT(4);
 
 vector hook_shotorigin[4];
 
+#define HOOK_MINS '-4 -4 -4' // 0.8.5 used '-3 -3 -3' (before sv_legacy_bbox_expand 0)
+#define HOOK_MAXS '4 4 4'    // 0.8.5 used '3 3 3'    (before sv_legacy_bbox_expand 0)
index 779226be3dfc98ded7bb21b56042e9ac54265b40..fb790b0fce1dc29e5d1bd299049f245ecdea9461 100644 (file)
@@ -24,7 +24,14 @@ bool WarpZone_Projectile_Touch_ImpactFilter_Callback(entity this, entity toucher
 
 .entity realowner;
 
-#define PROJECTILE_TOUCH(e,t) MACRO_BEGIN if (WarpZone_Projectile_Touch(e,t)) return; MACRO_END
+// if these are too big the max possible blaster jump height is increased a little
+const vector UNHITTABLEPROJ_MINS = '-0.015625 -0.015625 -0.015625'; // 0.8.5 set '0 0 0' (before sv_legacy_bbox_expand 0)
+const vector UNHITTABLEPROJ_MAXS = '0.015625 0.015625 0.015625';    // 0.8.5 set '0 0 0' (before sv_legacy_bbox_expand 0)
+const int CLIPGROUP_UNHITTABLEPROJ = 1;        // these projectiles cannot deflect or destroy each other
+// TODO: remove the following clipgroup comparison, which is included for backwards compatibility, after upgrading DP:
+// in DP versions with DP_RM_CLIPGROUP, the touch func isn't called when the clipgroup is a matching non zero integer.
+// see: https://gitlab.com/xonotic/xonotic-data.pk3dir/-/merge_requests/1131
+#define PROJECTILE_TOUCH(e,t) if (((e).clipgroup && (e).clipgroup == (t).clipgroup) || ((e).solid == SOLID_TRIGGER && (t).solid == SOLID_TRIGGER) || WarpZone_Projectile_Touch(e,t)) return
 
 #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE
 // when doing this, hagar can go through clones
index 94b3be212e3ec472932c4d666f5716843fb11eff..95376b64bb89d8ca6981dd22ea2ce2c8905d1291 100644 (file)
@@ -29,11 +29,11 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, .entity weaponentity, vect
 #define W_SetupShot_ProjectileSize(ent, wepent, mi, ma, antilag, recoil, snd, chan, maxdamage, deathtype) \
        W_SetupShot_Dir_ProjectileSize(ent, wepent, v_forward, mi, ma, antilag, recoil, snd, chan, maxdamage, deathtype)
 #define W_SetupShot_Dir(ent, wepent, s_forward, antilag, recoil, snd, chan, maxdamage, deathtype) \
-       W_SetupShot_Dir_ProjectileSize(ent, wepent, s_forward, '0 0 0', '0 0 0', antilag, recoil, snd, chan, maxdamage, deathtype)
+       W_SetupShot_Dir_ProjectileSize(ent, wepent, s_forward, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS, antilag, recoil, snd, chan, maxdamage, deathtype)
 #define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype) \
-       W_SetupShot_ProjectileSize(ent, wepent, '0 0 0', '0 0 0', antilag, recoil, snd, chan, maxdamage, deathtype)
+       W_SetupShot_ProjectileSize(ent, wepent, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS, antilag, recoil, snd, chan, maxdamage, deathtype)
 #define W_SetupShot_Range(ent, wepent, antilag, recoil, snd, chan, maxdamage, range, deathtype) \
-       W_SetupShot_Dir_ProjectileSize_Range(ent, wepent, v_forward, '0 0 0', '0 0 0', antilag, recoil, snd, chan, maxdamage, range, deathtype)
+       W_SetupShot_Dir_ProjectileSize_Range(ent, wepent, v_forward, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS, antilag, recoil, snd, chan, maxdamage, range, deathtype)
 
 vector W_CalculateProjectileVelocity(entity actor, vector pvelocity, vector mvelocity, float forceAbsolute);