]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Clean up SetupProjectileVelocity a little bit
authorSamual Lenks <samual@xonotic.org>
Tue, 31 Dec 2013 12:46:35 +0000 (07:46 -0500)
committerSamual Lenks <samual@xonotic.org>
Tue, 31 Dec 2013 12:46:35 +0000 (07:46 -0500)
qcsrc/common/weapons/w_electro.qc
qcsrc/common/weapons/w_fireball.qc
qcsrc/common/weapons/w_hagar.qc
qcsrc/common/weapons/w_mortar.qc
qcsrc/common/weapons/w_seeker.qc
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/tracing.qh

index eb2f5a4aa535a930f138c9990a2ee19ede243a3a..352e4eeae5d282c325f10eefb3eb1f3fc2345d5c 100644 (file)
@@ -262,7 +262,7 @@ void W_Electro_Attack_Bolt(void)
        setorigin(proj, w_shotorg);
 
        proj.movetype = MOVETYPE_FLY;
-       WEP_SETUPPROJVELOCITY_PRI(proj, electro);
+       WEP_SPV_PRI(proj, electro);
        proj.angles = vectoangles(proj.velocity);
        proj.touch = W_Electro_TouchExplode;
        setsize(proj, '0 0 -3', '0 0 -3');
@@ -354,7 +354,7 @@ void W_Electro_Attack_Orb(void)
        //proj.glow_size = 50;
        //proj.glow_color = 45;
        proj.movetype = MOVETYPE_BOUNCE;
-       WEP_SETUPPROJVELOCITY_UP_SEC(proj, electro);
+       WEP_SPV_UP_SEC(proj, electro);
        proj.touch = W_Electro_Orb_Touch;
        setsize(proj, '0 0 -4', '0 0 -4');
        proj.takedamage = DAMAGE_YES;
index b2cd8a63c360c0156f9fa5c24e1a4b8940c1aac5..63effc9f3872fc2d901c057eb37bc95c5a9d2143 100644 (file)
@@ -200,7 +200,7 @@ void W_Fireball_Attack1()
        setorigin(proj, w_shotorg);
 
        proj.movetype = MOVETYPE_FLY;
-       WEP_SETUPPROJVELOCITY_PRI(proj, fireball);
+       WEP_SPV_PRI(proj, fireball);
        proj.angles = vectoangles(proj.velocity);
        proj.touch = W_Fireball_TouchExplode;
        setsize(proj, '-16 -16 -16', '16 16 16');
@@ -332,7 +332,7 @@ void W_Fireball_Attack2()
        proj.nextthink = time;
        proj.damageforcescale = WEP_CVAR_SEC(fireball, damageforcescale);
        proj.pushltime = time + WEP_CVAR_SEC(fireball, lifetime);
-       WEP_SETUPPROJVELOCITY_UP_SEC(proj, fireball);
+       WEP_SPV_UP_SEC(proj, fireball);
 
        proj.angles = vectoangles(proj.velocity);
        proj.flags = FL_PROJECTILE;
index 709e03597736f00a89a689c527e89af94168cfc7..99a55e3ed260302c0d5b3b28213dcb8ddf460d1b 100644 (file)
@@ -148,7 +148,7 @@ void W_Hagar_Attack (void)
        setsize(missile, '0 0 0', '0 0 0');
 
        missile.movetype = MOVETYPE_FLY;
-       WEP_SETUPPROJVELOCITY_PRI(missile, hagar);
+       WEP_SPV_PRI(missile, hagar);
 
        missile.angles = vectoangles (missile.velocity);
        missile.flags = FL_PROJECTILE;
@@ -192,7 +192,7 @@ void W_Hagar_Attack2 (void)
        setsize(missile, '0 0 0', '0 0 0');
 
        missile.movetype = MOVETYPE_BOUNCEMISSILE;
-       WEP_SETUPPROJVELOCITY_SEC(missile, hagar);
+       WEP_SPV_SEC(missile, hagar);
 
        missile.angles = vectoangles (missile.velocity);
        missile.flags = FL_PROJECTILE;
index 122bdf23d61eb6e7663109859b53777a4bfbe4b1..63c044a73e68922ff156198414736d257c3dbd2e 100644 (file)
@@ -253,7 +253,7 @@ void W_Mortar_Attack()
        gren.event_damage = W_Mortar_Grenade_Damage;
        gren.damagedbycontents = TRUE;
        gren.missile_flags = MIF_SPLASH | MIF_ARC;
-       WEP_SETUPPROJVELOCITY_UP_PRI(gren, mortar);
+       WEP_SPV_UP_PRI(gren, mortar);
 
        gren.angles = vectoangles (gren.velocity);
        gren.flags = FL_PROJECTILE;
@@ -301,7 +301,7 @@ void W_Mortar_Attack2()
        gren.event_damage = W_Mortar_Grenade_Damage;
        gren.damagedbycontents = TRUE;
        gren.missile_flags = MIF_SPLASH | MIF_ARC;
-       WEP_SETUPPROJVELOCITY_UP_SEC(gren, mortar); // WEAPONTODO
+       WEP_SPV_UP_SEC(gren, mortar); // WEAPONTODO
 
        gren.angles = vectoangles (gren.velocity);
        gren.flags = FL_PROJECTILE;
index a8400e4ef40e9ae80f67073db460c8b0ff1d1ca6..f22c82c1ba9f1499f8d7c316feced8f9e803d2ee 100644 (file)
@@ -283,7 +283,7 @@ void W_Seeker_Fire_Missile(vector f_diff, entity m_target)
        missile.flags       = FL_PROJECTILE;
        missile.missile_flags = MIF_SPLASH | MIF_GUIDED_TAG;
 
-       WEP_SETUPPROJVELOCITY_UP_NONE(missile, seeker, missile_);
+       WEP_SPV_UP_NONE(missile, seeker, missile_);
 
        missile.angles = vectoangles (missile.velocity);
 
@@ -364,7 +364,7 @@ void W_Seeker_Fire_Flac()
        setorigin (missile, w_shotorg);
        setsize (missile, '-2 -2 -2', '2 2 2');
 
-       WEP_SETUPPROJVELOCITY_UP_NONE(missile, seeker, flac_);
+       WEP_SPV_UP_NONE(missile, seeker, flac_);
        CSQCProjectile(missile, TRUE, PROJECTILE_FLAC, TRUE);
 
        other = missile; MUTATOR_CALLHOOK(EditProjectile);
@@ -580,7 +580,7 @@ void W_Seeker_Fire_Tag()
        //missile.missile_flags = MIF_..?;
 
        missile.movetype    = MOVETYPE_FLY;
-       WEP_SETUPPROJVELOCITY_NONE(missile, seeker, tag_);
+       WEP_SPV_NONE(missile, seeker, tag_);
        missile.angles = vectoangles (missile.velocity);
 
        CSQCProjectile(missile, TRUE, PROJECTILE_TAG, FALSE); // has sound
index 33cb37efec147c8b729667fc1519f0506a765f2e..9a0ea219bdc726365ab4bcb0d32adf011084c579 100644 (file)
@@ -166,11 +166,6 @@ void W_SetupProjectileVelocityEx(entity missile, vector dir, vector upDir, float
        missile.velocity = W_CalculateProjectileVelocity(missile.owner.velocity, pSpeed * dir, forceAbsolute);
 }
 
-void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread) // WEAPONTODO
-{
-       W_SetupProjectileVelocityEx(missile, w_shotdir, v_up, pSpeed, 0, 0, spread, FALSE);
-}
-
 
 // ====================
 //  Ballistics Tracing
index 6565ece04ca1e4d01b4bf73bac269d2c9a0af685..f62b56e7cc7d4fc31f188028aef5fa76932bb9ef 100644 (file)
@@ -24,15 +24,18 @@ float mspercallcount;
 #endif
 void W_SetupProjectileVelocityEx(entity missile, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute);
 
-#define WEP_SETUPPROJVELOCITY_UP_NONE(ent,wepname,prefix) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR(wepname, prefix##speed), WEP_CVAR(wepname, prefix##speed_up), WEP_CVAR(wepname, prefix##speed_z), WEP_CVAR(wepname, prefix##spread), FALSE)
-#define WEP_SETUPPROJVELOCITY_UP_PRI(ent,wepname) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_PRI(wepname, speed), WEP_CVAR_PRI(wepname, speed_up), WEP_CVAR_PRI(wepname, speed_z), WEP_CVAR_PRI(wepname, spread), FALSE)
-#define WEP_SETUPPROJVELOCITY_UP_SEC(ent,wepname) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_SEC(wepname, speed), WEP_CVAR_SEC(wepname, speed_up), WEP_CVAR_SEC(wepname, speed_z), WEP_CVAR_SEC(wepname, spread), FALSE)
-#define WEP_SETUPPROJVELOCITY_UP_BOTH(ent,wepname,isprimary) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_BOTH(wepname, isprimary, speed), WEP_CVAR_BOTH(wepname, isprimary, speed_up), WEP_CVAR_BOTH(wepname, isprimary, speed_z), WEP_CVAR_BOTH(wepname, isprimary, spread), FALSE)
-
-#define WEP_SETUPPROJVELOCITY_NONE(ent,wepname,prefix) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR(wepname, prefix##speed), 0, 0, WEP_CVAR(wepname, prefix##spread), FALSE)
-#define WEP_SETUPPROJVELOCITY_PRI(ent,wepname) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_PRI(wepname, speed), 0, 0, WEP_CVAR_PRI(wepname, spread), FALSE)
-#define WEP_SETUPPROJVELOCITY_SEC(ent,wepname) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_SEC(wepname, speed), 0, 0, WEP_CVAR_SEC(wepname, spread), FALSE)
-#define WEP_SETUPPROJVELOCITY_BOTH(ent,wepname,isprimary) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_BOTH(wepname, isprimary, speed), 0, 0, WEP_CVAR_BOTH(wepname, isprimary, spread), FALSE)
+#define W_SetupProjectileVelocity(ent,pspeed,pspread) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, pspeed, 0, 0, pspread, FALSE)
+
+
+#define WEP_SPV_UP_NONE(ent,wepname,prefix) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR(wepname, prefix##speed), WEP_CVAR(wepname, prefix##speed_up), WEP_CVAR(wepname, prefix##speed_z), WEP_CVAR(wepname, prefix##spread), FALSE)
+#define WEP_SPV_UP_PRI(ent,wepname) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_PRI(wepname, speed), WEP_CVAR_PRI(wepname, speed_up), WEP_CVAR_PRI(wepname, speed_z), WEP_CVAR_PRI(wepname, spread), FALSE)
+#define WEP_SPV_UP_SEC(ent,wepname) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_SEC(wepname, speed), WEP_CVAR_SEC(wepname, speed_up), WEP_CVAR_SEC(wepname, speed_z), WEP_CVAR_SEC(wepname, spread), FALSE)
+#define WEP_SPV_UP_BOTH(ent,wepname,isprimary) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_BOTH(wepname, isprimary, speed), WEP_CVAR_BOTH(wepname, isprimary, speed_up), WEP_CVAR_BOTH(wepname, isprimary, speed_z), WEP_CVAR_BOTH(wepname, isprimary, spread), FALSE)
+
+#define WEP_SPV_NONE(ent,wepname,prefix) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR(wepname, prefix##speed), 0, 0, WEP_CVAR(wepname, prefix##spread), FALSE)
+#define WEP_SPV_PRI(ent,wepname) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_PRI(wepname, speed), 0, 0, WEP_CVAR_PRI(wepname, spread), FALSE)
+#define WEP_SPV_SEC(ent,wepname) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_SEC(wepname, speed), 0, 0, WEP_CVAR_SEC(wepname, spread), FALSE)
+#define WEP_SPV_BOTH(ent,wepname,isprimary) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_BOTH(wepname, isprimary, speed), 0, 0, WEP_CVAR_BOTH(wepname, isprimary, spread), FALSE)
 
 // ====================
 //  Ballistics Tracing