From 33885ba02998d463c0c4f7e5ea26a7489980cc35 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Thu, 25 May 2023 16:56:54 +1000 Subject: [PATCH] Revert "Remove legacy Quake bbox expansion: projectiles" This reverts commit bf1d64ebc5c2867b079a0bfa09f448f076d6be01. --- .gitlab-ci.yml | 2 +- .../common/gamemodes/gamemode/nexball/sv_weapon.qc | 2 +- qcsrc/common/mutators/mutator/overkill/okrpc.qc | 4 ++-- qcsrc/common/mutators/mutator/overkill/okrpc.qh | 3 --- qcsrc/common/weapons/weapon/arc.qc | 3 +-- qcsrc/common/weapons/weapon/blaster.qc | 3 +-- qcsrc/common/weapons/weapon/crylink.qc | 6 ++---- qcsrc/common/weapons/weapon/devastator.qc | 4 ++-- qcsrc/common/weapons/weapon/devastator.qh | 3 --- qcsrc/common/weapons/weapon/electro.qc | 13 ++++++------- qcsrc/common/weapons/weapon/electro.qh | 5 ----- qcsrc/common/weapons/weapon/hagar.qc | 9 +++------ qcsrc/common/weapons/weapon/hlac.qc | 6 ++---- qcsrc/common/weapons/weapon/hook.qc | 3 +-- qcsrc/common/weapons/weapon/minelayer.qc | 6 +++--- qcsrc/common/weapons/weapon/minelayer.qh | 3 --- qcsrc/common/weapons/weapon/mortar.qc | 8 ++++---- qcsrc/common/weapons/weapon/mortar.qh | 3 --- qcsrc/common/weapons/weapon/porto.qc | 3 +-- qcsrc/common/weapons/weapon/seeker.qc | 12 ++++++------ qcsrc/common/weapons/weapon/seeker.qh | 7 ------- qcsrc/common/weapons/weapon/vaporizer.qc | 4 ++-- qcsrc/common/weapons/weapon/vaporizer.qh | 3 --- qcsrc/server/hook.qc | 4 ++-- qcsrc/server/hook.qh | 2 -- qcsrc/server/weapons/common.qh | 9 +-------- qcsrc/server/weapons/tracing.qh | 6 +++--- 27 files changed, 44 insertions(+), 92 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d146b9208..b56f2b44d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 - wget -nv -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache - - EXPECT=ab4f1c48fe9e823e2354ad6c029feea8 + - EXPECT=f2226bf353b6ff3dd3c489a742ce4e6a - HASH=$(${ENGINE} +exec serverbench.cfg | tee /dev/stderr | grep '^:' diff --git a/qcsrc/common/gamemodes/gamemode/nexball/sv_weapon.qc b/qcsrc/common/gamemodes/gamemode/nexball/sv_weapon.qc index 7ed7a4d19..d3d3a6a9d 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/sv_weapon.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/sv_weapon.qc @@ -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, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS); + setsize(missile, '0 0 0', '0 0 0'); setorigin(missile, w_shotorg); W_SetupProjVelocity_Basic(missile, autocvar_g_balance_nexball_secondary_speed, 0); diff --git a/qcsrc/common/mutators/mutator/overkill/okrpc.qc b/qcsrc/common/mutators/mutator/overkill/okrpc.qc index 9a3ba973f..d84a6766a 100644 --- a/qcsrc/common/mutators/mutator/overkill/okrpc.qc +++ b/qcsrc/common/mutators/mutator/overkill/okrpc.qc @@ -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, RPC_MINS, RPC_MAXS, false, 5, SND_ROCKET_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(okrpc, damage), thiswep.m_id); + 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_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, RPC_MINS, RPC_MAXS); // give it some size so it can be shot + setsize (missile, '-3 -3 -3', '3 3 3'); // 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); diff --git a/qcsrc/common/mutators/mutator/overkill/okrpc.qh b/qcsrc/common/mutators/mutator/overkill/okrpc.qh index ffa489f95..23421d2f5 100644 --- a/qcsrc/common/mutators/mutator/overkill/okrpc.qh +++ b/qcsrc/common/mutators/mutator/overkill/okrpc.qh @@ -22,9 +22,6 @@ 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) \ diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index 5aa7bfa52..43d7a03a4 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -158,11 +158,10 @@ 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, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS); + setsize(missile, '0 0 0', '0 0 0'); set_movetype(missile, MOVETYPE_BOUNCEMISSILE); W_SetupProjVelocity_PRE(missile, arc, bolt_); diff --git a/qcsrc/common/weapons/weapon/blaster.qc b/qcsrc/common/weapons/weapon/blaster.qc index c4d6720c2..3c134a3db 100644 --- a/qcsrc/common/weapons/weapon/blaster.qc +++ b/qcsrc/common/weapons/weapon/blaster.qc @@ -57,10 +57,9 @@ 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, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS); + setsize(missile, '0 0 0', '0 0 0'); float atk_speed = WEP_CVAR_BOTH(blaster, isprimary, speed); float atk_spread = WEP_CVAR_BOTH(blaster, isprimary, spread); diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index 1e1b8f991..6a69a7c57 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -341,12 +341,11 @@ 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, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS); + setsize(proj, '0 0 0', '0 0 0'); s = '0 0 0'; @@ -455,12 +454,11 @@ 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, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS); + setsize(proj, '0 0 0', '0 0 0'); if(WEP_CVAR_SEC(crylink, spreadtype) == 1) { diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 40a2e35d4..6f428dc6c 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -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, ROCKET_MINS, ROCKET_MAXS, false, 5, SND_ROCKET_FIRE, CH_WEAPON_A, WEP_CVAR(devastator, damage), thiswep.m_id); + 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_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, ROCKET_MINS, ROCKET_MAXS); // give it some size so it can be shot + setsize(missile, '-3 -3 -3', '3 3 3'); // 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); diff --git a/qcsrc/common/weapons/weapon/devastator.qh b/qcsrc/common/weapons/weapon/devastator.qh index e849f6957..7a10bf62a 100644 --- a/qcsrc/common/weapons/weapon/devastator.qh +++ b/qcsrc/common/weapons/weapon/devastator.qh @@ -20,9 +20,6 @@ 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) \ diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index fbd92f0cb..2c03871ce 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -221,8 +221,8 @@ void W_Electro_Attack_Bolt(Weapon thiswep, entity actor, .entity weaponentity) W_SetupShot_ProjectileSize( actor, weaponentity, - BOLT_MINS, - BOLT_MAXS, + '0 0 -3', + '0 0 -3', false, 2, SND_ELECTRO_FIRE, @@ -242,7 +242,6 @@ 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); @@ -252,7 +251,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, BOLT_MINS, BOLT_MAXS); + setsize(proj, '0 0 -3', '0 0 -3'); proj.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, proj); IL_PUSH(g_bot_dodge, proj); @@ -423,8 +422,8 @@ void W_Electro_Attack_Orb(Weapon thiswep, entity actor, .entity weaponentity) W_SetupShot_ProjectileSize( actor, weaponentity, - ORB_MINS, - ORB_MAXS, + '-4 -4 -4', + '4 4 4', false, 2, SND_ELECTRO_FIRE2, @@ -455,7 +454,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, ORB_MINS, ORB_MAXS); + setsize(proj, '-4 -4 -4', '4 4 4'); proj.takedamage = DAMAGE_YES; proj.damageforcescale = WEP_CVAR_SEC(electro, damageforcescale); SetResourceExplicit(proj, RES_HEALTH, WEP_CVAR_SEC(electro, health)); diff --git a/qcsrc/common/weapons/weapon/electro.qh b/qcsrc/common/weapons/weapon/electro.qh index b0b3ba799..e4263403b 100644 --- a/qcsrc/common/weapons/weapon/electro.qh +++ b/qcsrc/common/weapons/weapon/electro.qh @@ -19,11 +19,6 @@ 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) \ diff --git a/qcsrc/common/weapons/weapon/hagar.qc b/qcsrc/common/weapons/weapon/hagar.qc index 096f8ed8b..a8c12efcc 100644 --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@ -102,11 +102,10 @@ 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, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS); + setsize(missile, '0 0 0', '0 0 0'); set_movetype(missile, MOVETYPE_FLY); W_SetupProjVelocity_PRI(missile, hagar); @@ -150,11 +149,10 @@ 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, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS); + setsize(missile, '0 0 0', '0 0 0'); set_movetype(missile, MOVETYPE_BOUNCEMISSILE); W_SetupProjVelocity_SEC(missile, hagar); @@ -213,11 +211,10 @@ 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, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS); + setsize(missile, '0 0 0', '0 0 0'); set_movetype(missile, MOVETYPE_FLY); missile.missile_flags = MIF_SPLASH; diff --git a/qcsrc/common/weapons/weapon/hlac.qc b/qcsrc/common/weapons/weapon/hlac.qc index 4282598a9..18dde7440 100644 --- a/qcsrc/common/weapons/weapon/hlac.qc +++ b/qcsrc/common/weapons/weapon/hlac.qc @@ -45,10 +45,9 @@ 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, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS); + setsize(missile, '0 0 0', '0 0 0'); W_SetupProjVelocity_Basic(missile, WEP_CVAR_PRI(hlac, speed), spread); //missile.angles = vectoangles(missile.velocity); // csqc @@ -91,10 +90,9 @@ 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, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS); + setsize(missile, '0 0 0', '0 0 0'); W_SetupProjVelocity_Basic(missile, WEP_CVAR_SEC(hlac, speed), spread); //missile.angles = vectoangles(missile.velocity); // csqc diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index 30c2233ac..94d4ac33e 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -77,11 +77,10 @@ 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, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS); + setsize(gren, '0 0 0', '0 0 0'); gren.nextthink = time + WEP_CVAR_SEC(hook, lifetime); setthink(gren, adaptor_think2use_hittype_splash); diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index 40474b874..c73db2bc2 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -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, MINE_MINS, MINE_MAXS); + setsize(newmine, '-4 -4 -4', '4 4 4'); 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, MINE_MINS, MINE_MAXS, false, 5, SND_MINE_FIRE, CH_WEAPON_A, WEP_CVAR(minelayer, damage), thiswep.m_id); + 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_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, MINE_MINS, MINE_MAXS); + setsize(mine, '-4 -4 -4', '4 4 4'); // give it some size so it can be shot 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); diff --git a/qcsrc/common/weapons/weapon/minelayer.qh b/qcsrc/common/weapons/weapon/minelayer.qh index ce331ca6b..a574510f5 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qh +++ b/qcsrc/common/weapons/weapon/minelayer.qh @@ -19,9 +19,6 @@ 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) \ diff --git a/qcsrc/common/weapons/weapon/mortar.qc b/qcsrc/common/weapons/weapon/mortar.qc index 0a543cbbe..442f88265 100644 --- a/qcsrc/common/weapons/weapon/mortar.qc +++ b/qcsrc/common/weapons/weapon/mortar.qc @@ -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, GREN_MINS, GREN_MAXS, false, 4, SND_GRENADE_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage), thiswep.m_id); + 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_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, GREN_MINS, GREN_MAXS); + setsize(gren, '-3 -3 -3', '3 3 3'); 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, GREN_MINS, GREN_MAXS, false, 4, SND_GRENADE_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage), thiswep.m_id | HITTYPE_SECONDARY); + 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_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, GREN_MINS, GREN_MAXS); + setsize(gren, '-3 -3 -3', '3 3 3'); gren.nextthink = time + WEP_CVAR_SEC(mortar, lifetime); setthink(gren, adaptor_think2use_hittype_splash); diff --git a/qcsrc/common/weapons/weapon/mortar.qh b/qcsrc/common/weapons/weapon/mortar.qh index ef86c5f2a..6d44e7564 100644 --- a/qcsrc/common/weapons/weapon/mortar.qh +++ b/qcsrc/common/weapons/weapon/mortar.qh @@ -20,9 +20,6 @@ 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) \ diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index ab400856c..b681078c2 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -298,11 +298,10 @@ 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, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS); + setsize(gren, '0 0 0', '0 0 0'); gren.nextthink = time + WEP_CVAR_BOTH(porto, (type <= 0), lifetime); setthink(gren, W_Porto_Think); diff --git a/qcsrc/common/weapons/weapon/seeker.qc b/qcsrc/common/weapons/weapon/seeker.qc index be6d6e13c..7abb2a43c 100644 --- a/qcsrc/common/weapons/weapon/seeker.qc +++ b/qcsrc/common/weapons/weapon/seeker.qc @@ -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, 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_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_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, MISSILE_MINS, MISSILE_MAXS); + setsize(missile, '-4 -4 -4', '4 4 4'); 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, FLAC_MINS, FLAC_MAXS, false, 2, SND_FLAC_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, flac_damage), thiswep.m_id | HITTYPE_SECONDARY); + 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_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, FLAC_MINS, FLAC_MAXS); + setsize(missile, '-2 -2 -2', '2 2 2'); 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, 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); + 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); 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, TAG_MINS, TAG_MAXS); + setsize(missile, '-2 -2 -2', '2 2 2'); missile.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, missile); diff --git a/qcsrc/common/weapons/weapon/seeker.qh b/qcsrc/common/weapons/weapon/seeker.qh index 81a287635..d3024a436 100644 --- a/qcsrc/common/weapons/weapon/seeker.qh +++ b/qcsrc/common/weapons/weapon/seeker.qh @@ -19,13 +19,6 @@ 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) \ diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index ac0a408f3..4be54b6b2 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -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, RM_MINS, RM_MAXS, false, 2, snd, CH_WEAPON_A, autocvar_g_rm_laser_damage, WEP_ELECTRO.m_id); + 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); // 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, RM_MINS, RM_MAXS); + setsize(proj, '0 0 -3', '0 0 -3'); proj.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, proj); IL_PUSH(g_bot_dodge, proj); diff --git a/qcsrc/common/weapons/weapon/vaporizer.qh b/qcsrc/common/weapons/weapon/vaporizer.qh index 1df620995..83a1660cc 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qh +++ b/qcsrc/common/weapons/weapon/vaporizer.qh @@ -21,9 +21,6 @@ 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) \ diff --git a/qcsrc/server/hook.qc b/qcsrc/server/hook.qc index 5bc00c150..a50830348 100644 --- a/qcsrc/server/hook.qc +++ b/qcsrc/server/hook.qc @@ -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, HOOK_MINS, HOOK_MAXS, true, 0, SND_HOOK_FIRE, CH_WEAPON_B, 0, WEP_HOOK.m_id); + 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_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, HOOK_MINS, HOOK_MAXS); + setsize (missile, '-3 -3 -3', '3 3 3'); setorigin(missile, w_shotorg); missile.state = 0; // not latched onto anything diff --git a/qcsrc/server/hook.qh b/qcsrc/server/hook.qh index 2af2b66d3..1b0729bd0 100644 --- a/qcsrc/server/hook.qh +++ b/qcsrc/server/hook.qh @@ -35,5 +35,3 @@ 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) diff --git a/qcsrc/server/weapons/common.qh b/qcsrc/server/weapons/common.qh index fb790b0fc..779226be3 100644 --- a/qcsrc/server/weapons/common.qh +++ b/qcsrc/server/weapons/common.qh @@ -24,14 +24,7 @@ bool WarpZone_Projectile_Touch_ImpactFilter_Callback(entity this, entity toucher .entity realowner; -// 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_TOUCH(e,t) MACRO_BEGIN if (WarpZone_Projectile_Touch(e,t)) return; MACRO_END #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE // when doing this, hagar can go through clones diff --git a/qcsrc/server/weapons/tracing.qh b/qcsrc/server/weapons/tracing.qh index 95376b64b..94b3be212 100644 --- a/qcsrc/server/weapons/tracing.qh +++ b/qcsrc/server/weapons/tracing.qh @@ -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, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS, 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) #define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype) \ - W_SetupShot_ProjectileSize(ent, wepent, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS, antilag, recoil, snd, chan, maxdamage, deathtype) + W_SetupShot_ProjectileSize(ent, wepent, '0 0 0', '0 0 0', 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, UNHITTABLEPROJ_MINS, UNHITTABLEPROJ_MAXS, 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) vector W_CalculateProjectileVelocity(entity actor, vector pvelocity, vector mvelocity, float forceAbsolute); -- 2.39.2