]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Even more cleanup of SetupProjVelocity
authorSamual Lenks <samual@xonotic.org>
Tue, 31 Dec 2013 13:24:47 +0000 (08:24 -0500)
committerSamual Lenks <samual@xonotic.org>
Tue, 31 Dec 2013 13:24:47 +0000 (08:24 -0500)
16 files changed:
qcsrc/common/weapons/w_blaster.qc
qcsrc/common/weapons/w_crylink.qc
qcsrc/common/weapons/w_devastator.qc
qcsrc/common/weapons/w_electro.qc
qcsrc/common/weapons/w_fireball.qc
qcsrc/common/weapons/w_hagar.qc
qcsrc/common/weapons/w_hlac.qc
qcsrc/common/weapons/w_hook.qc
qcsrc/common/weapons/w_minelayer.qc
qcsrc/common/weapons/w_mortar.qc
qcsrc/common/weapons/w_porto.qc
qcsrc/common/weapons/w_seeker.qc
qcsrc/server/g_hook.qc
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/tracing.qh

index 30a2e437d86910872b8aa1d887c1c08a5bd1bc12..6a9d2a764ad1e8ffe7256b6688035b2133c6f8ee 100644 (file)
@@ -107,7 +107,7 @@ void W_Blaster_Attack(
        setorigin(missile, w_shotorg);
        setsize(missile, '0 0 0', '0 0 0');
        
-       W_SetupProjectileVelocityEx(
+       W_SetupProjVelocity_Explicit(
                missile,
                w_shotdir,
                v_up,
index 9ba08ff724c1a37ef818493492585d28f1633dd0..a7f3a1b063e509c1e73f285d3bf4178e5c881a6a 100644 (file)
@@ -404,7 +404,7 @@ void W_Crylink_Attack (void)
                        s_z = v_forward_y;
                }
                s = s * WEP_CVAR_PRI(crylink, spread) * g_weaponspreadfactor;
-               W_SetupProjectileVelocityEx(proj, w_shotdir + right * s_y + up * s_z, v_up, WEP_CVAR_PRI(crylink, speed), 0, 0, 0, FALSE);
+               W_SetupProjVelocity_Explicit(proj, w_shotdir + right * s_y + up * s_z, v_up, WEP_CVAR_PRI(crylink, speed), 0, 0, 0, FALSE);
                proj.touch = W_Crylink_Touch;
 
                proj.think = W_Crylink_Fadethink;
@@ -521,7 +521,7 @@ void W_Crylink_Attack2 (void)
                        s = (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * WEP_CVAR_SEC(crylink, spread) * g_weaponspreadfactor);
                }
 
-               W_SetupProjectileVelocityEx(proj, s, v_up, WEP_CVAR_SEC(crylink, speed), 0, 0, 0, FALSE);
+               W_SetupProjVelocity_Explicit(proj, s, v_up, WEP_CVAR_SEC(crylink, speed), 0, 0, 0, FALSE);
                proj.touch = W_Crylink_Touch;
                proj.think = W_Crylink_Fadethink;
                if(counter == (shots - 1) / 2)
index 9262389d2ff4aaa804ff20040cc02317b986110b..0f5afb02ceb0f783e24bfe011c302acd7352957d 100644 (file)
@@ -292,7 +292,7 @@ void W_Devastator_Attack (void)
        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_SetupVelocity_Explicit(missile, WEP_CVAR(devastator, speedstart), 0);
+       W_SetupProjVelocity_Basic(missile, WEP_CVAR(devastator, speedstart), 0);
        missile.angles = vectoangles (missile.velocity);
 
        missile.touch = W_Devastator_Touch;
index 6f68cee7c6afd56c61925b55b8f139adbeb4a6b3..44234b7f6db92e0cc5dcffaa95cc9de4c8dd634d 100644 (file)
@@ -262,7 +262,7 @@ void W_Electro_Attack_Bolt(void)
        setorigin(proj, w_shotorg);
 
        proj.movetype = MOVETYPE_FLY;
-       W_SetupVelocity_PRI(proj, electro);
+       W_SetupProjVelocity_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;
-       W_SetupVelocity_UP_SEC(proj, electro);
+       W_SetupProjVelocity_UP_SEC(proj, electro);
        proj.touch = W_Electro_Orb_Touch;
        setsize(proj, '0 0 -4', '0 0 -4');
        proj.takedamage = DAMAGE_YES;
index e3a9ac7520f65016ae3c888c68c511995371e034..0a19c3df0496dae873d962e16aaae2de2c5fce58 100644 (file)
@@ -200,7 +200,7 @@ void W_Fireball_Attack1()
        setorigin(proj, w_shotorg);
 
        proj.movetype = MOVETYPE_FLY;
-       W_SetupVelocity_PRI(proj, fireball);
+       W_SetupProjVelocity_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);
-       W_SetupVelocity_UP_SEC(proj, fireball);
+       W_SetupProjVelocity_UP_SEC(proj, fireball);
 
        proj.angles = vectoangles(proj.velocity);
        proj.flags = FL_PROJECTILE;
index 196c0e24449c647754433c7643827f7e017d1c45..d745d1473c628a21c478b29d9f46c883fe7971b9 100644 (file)
@@ -148,7 +148,7 @@ void W_Hagar_Attack (void)
        setsize(missile, '0 0 0', '0 0 0');
 
        missile.movetype = MOVETYPE_FLY;
-       W_SetupVelocity_PRI(missile, hagar);
+       W_SetupProjVelocity_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;
-       W_SetupVelocity_SEC(missile, hagar);
+       W_SetupProjVelocity_SEC(missile, hagar);
 
        missile.angles = vectoangles (missile.velocity);
        missile.flags = FL_PROJECTILE;
@@ -269,7 +269,7 @@ void W_Hagar_Attack2_Load_Release (void)
                }
                s = s * WEP_CVAR_SEC(hagar, load_spread) * g_weaponspreadfactor;
                
-               W_SetupProjectileVelocityEx(missile, w_shotdir + right * s_y + up * s_z, v_up, WEP_CVAR_SEC(hagar, speed), 0, 0, spread_pershot, FALSE);
+               W_SetupProjVelocity_Explicit(missile, w_shotdir + right * s_y + up * s_z, v_up, WEP_CVAR_SEC(hagar, speed), 0, 0, spread_pershot, FALSE);
 
                missile.angles = vectoangles (missile.velocity);
                missile.flags = FL_PROJECTILE;
index 246bf6b136c6cb72611a6b65e5e5eee41c46c97b..80ad5661dbee138aaa56f69dde445687108c3d26 100644 (file)
@@ -93,7 +93,7 @@ void W_HLAC_Attack (void)
        setorigin (missile, w_shotorg);
        setsize(missile, '0 0 0', '0 0 0');
 
-       W_SetupVelocity_Explicit(missile, WEP_CVAR_PRI(hlac, speed), spread);
+       W_SetupProjVelocity_Basic(missile, WEP_CVAR_PRI(hlac, speed), spread);
        //missile.angles = vectoangles (missile.velocity); // csqc
 
        missile.touch = W_HLAC_Touch;
@@ -136,7 +136,7 @@ void W_HLAC_Attack2()
        setorigin (missile, w_shotorg);
        setsize(missile, '0 0 0', '0 0 0');
 
-       W_SetupVelocity_Explicit(missile, WEP_CVAR_SEC(hlac, speed), spread);
+       W_SetupProjVelocity_Basic(missile, WEP_CVAR_SEC(hlac, speed), spread);
        //missile.angles = vectoangles (missile.velocity); // csqc
 
        missile.touch = W_HLAC_Touch;
index 61a30d2cd831dd250bbc8f3c83c003f8710547e8..361d8ba62d0d263c50cf8d4c5c72fde8822be79b 100644 (file)
@@ -159,7 +159,7 @@ void W_Hook_Attack2()
                gren.velocity = gren.velocity + self.velocity;
 
        gren.gravity = WEP_CVAR_SEC(hook, gravity);
-       //W_SetupVelocity_Explicit(gren); // just falling down!
+       //W_SetupProjVelocity_Basic(gren); // just falling down!
 
        gren.angles = '0 0 0';
        gren.flags = FL_PROJECTILE;
index 20ef89008f3bcda3e52e9601f2432bf8983e8331..6e70043ae190aa91ca7bc56c33f9ee3a8f5ef345 100644 (file)
@@ -347,7 +347,7 @@ void W_MineLayer_Attack()
        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_SetupVelocity_Explicit(mine, WEP_CVAR(minelayer, speed), 0);
+       W_SetupProjVelocity_Basic(mine, WEP_CVAR(minelayer, speed), 0);
        mine.angles = vectoangles (mine.velocity);
 
        mine.touch = W_MineLayer_Touch;
index f1905abb61cd3d325d6f3b84c06d1fe3f4c00bc2..267912ff26ab7a0a3c2cd9f66c0aba3189c7f90d 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;
-       W_SetupVelocity_UP_PRI(gren, mortar);
+       W_SetupProjVelocity_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;
-       W_SetupVelocity_UP_SEC(gren, mortar); // WEAPONTODO
+       W_SetupProjVelocity_UP_SEC(gren, mortar); // WEAPONTODO
 
        gren.angles = vectoangles (gren.velocity);
        gren.flags = FL_PROJECTILE;
index 46963a1a7450df5c2fbe6479b465ec63f5abc0a0..2963182ea27f845ec25ac0c1e4940b56168b9eff 100644 (file)
@@ -257,9 +257,9 @@ void W_Porto_Attack (float type)
        gren.touch = W_Porto_Touch;
        
        if(self.items & IT_STRENGTH)
-               W_SetupVelocity_Explicit(gren, WEP_CVAR_BOTH(porto, (type <= 0), speed) * autocvar_g_balance_powerup_strength_force, 0);
+               W_SetupProjVelocity_Basic(gren, WEP_CVAR_BOTH(porto, (type <= 0), speed) * autocvar_g_balance_powerup_strength_force, 0);
        else
-               W_SetupVelocity_Explicit(gren, WEP_CVAR_BOTH(porto, (type <= 0), speed), 0);
+               W_SetupProjVelocity_Basic(gren, WEP_CVAR_BOTH(porto, (type <= 0), speed), 0);
 
        gren.angles = vectoangles (gren.velocity);
        gren.flags = FL_PROJECTILE;
index ae3baf21442a3b8731cdc174d91b5b3a9118ffe5..64662a50c5d05998b05799b907790c831b8fdf42 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;
 
-       W_SetupVelocity_UP_PRE(missile, seeker, missile_);
+       W_SetupProjVelocity_UP_PRE(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');
 
-       W_SetupVelocity_UP_PRE(missile, seeker, flac_);
+       W_SetupProjVelocity_UP_PRE(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;
-       W_SetupVelocity_PRE(missile, seeker, tag_);
+       W_SetupProjVelocity_PRE(missile, seeker, tag_);
        missile.angles = vectoangles (missile.velocity);
 
        CSQCProjectile(missile, TRUE, PROJECTILE_TAG, FALSE); // has sound
index c2768cf6ae777a95b235bdef1d2f0255ad926b4d..7b0648f705d28e2bbd2a6beeb34efe18f68da1f8 100644 (file)
@@ -335,7 +335,7 @@ void FireGrapplingHook (void)
 
        missile.state = 0; // not latched onto anything
 
-       W_SetupProjectileVelocityEx(missile, v_forward, v_up, autocvar_g_balance_grapplehook_speed_fly, 0, 0, 0, FALSE);
+       W_SetupProjVelocity_Explicit(missile, v_forward, v_up, autocvar_g_balance_grapplehook_speed_fly, 0, 0, 0, FALSE);
 
        missile.angles = vectoangles (missile.velocity);
        //missile.glow_color = 250; // 244, 250
index b998ecd33ebbd4ffe743fb90e950d09e1c5c8d06..408ce34f27a91d625de2afb69d8afa830af029e0 100644 (file)
@@ -764,7 +764,7 @@ void W_Nexball_Attack2(void)
        setsize(missile, '0 0 0', '0 0 0');
        setorigin(missile, w_shotorg);
 
-       W_SetupVelocity_Explicit(missile, autocvar_g_balance_nexball_secondary_speed, 0);
+       W_SetupProjVelocity_Basic(missile, autocvar_g_balance_nexball_secondary_speed, 0);
        missile.angles = vectoangles(missile.velocity);
        missile.touch = W_Nexball_Touch;
        missile.think = SUB_Remove;
index 0bd6b4f9e0e41739dc3e47388568dbda90cb1546..02bd88a7664aec6708d9c10b5ec95bdef16db90e 100644 (file)
@@ -133,9 +133,9 @@ vector W_CalculateProjectileVelocity(vector pvelocity, vector mvelocity, float f
        return outvelocity;
 }
 
-void W_SetupProjectileVelocityEx(entity missile, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute)
+void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute)
 {
-       if(missile.owner == world)
+       if(proj.owner == world)
                error("Unowned missile");
 
        dir = dir + upDir * (pUpSpeed / pSpeed);
@@ -143,22 +143,24 @@ void W_SetupProjectileVelocityEx(entity missile, vector dir, vector upDir, float
        pSpeed *= vlen(dir);
        dir = normalize(dir);
 
-#if 0
+       #if 0
        if(autocvar_g_projectiles_spread_style != mspercallsstyle)
        {
                mspercallsum = mspercallcount = 0;
                mspercallsstyle = autocvar_g_projectiles_spread_style;
        }
        mspercallsum -= gettime(GETTIME_HIRES);
-#endif
+       #endif
+       
        dir = W_CalculateSpread(dir, spread, g_weaponspreadfactor, autocvar_g_projectiles_spread_style);
-#if 0
+       
+       #if 0
        mspercallsum += gettime(GETTIME_HIRES);
        mspercallcount += 1;
        print("avg: ", ftos(mspercallcount / mspercallsum), " per sec\n");
-#endif
+       #endif
 
-       missile.velocity = W_CalculateProjectileVelocity(missile.owner.velocity, pSpeed * dir, forceAbsolute);
+       proj.velocity = W_CalculateProjectileVelocity(proj.owner.velocity, pSpeed * dir, forceAbsolute);
 }
 
 
index ae7f966af3729b45527d24f52a59084c9528d603..f949706983ed7625d8fbb418bd950f333ba6166e 100644 (file)
@@ -23,18 +23,18 @@ float mspercallsstyle;
 float mspercallcount;
 #endif
 
-void W_SetupProjectileVelocityEx(entity missile, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute);
-#define W_SetupVelocity_Explicit(ent,pspeed,pspread) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, pspeed, 0, 0, pspread, FALSE)
-
-#define W_SetupVelocity_UP_PRE(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 W_SetupVelocity_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 W_SetupVelocity_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 W_SetupVelocity_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 W_SetupVelocity_PRE(ent,wepname,prefix) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR(wepname, prefix##speed), 0, 0, WEP_CVAR(wepname, prefix##spread), FALSE)
-#define W_SetupVelocity_PRI(ent,wepname) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_PRI(wepname, speed), 0, 0, WEP_CVAR_PRI(wepname, spread), FALSE)
-#define W_SetupVelocity_SEC(ent,wepname) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_SEC(wepname, speed), 0, 0, WEP_CVAR_SEC(wepname, spread), FALSE)
-#define W_SetupVelocity_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)
+void W_SetupProjVelocity_Explicit(entity missile, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute);
+#define W_SetupProjVelocity_Basic(ent,pspeed,pspread) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, pspeed, 0, 0, pspread, FALSE)
+
+#define W_SetupProjVelocity_UP_PRE(ent,wepname,prefix) W_SetupProjVelocity_Explicit(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 W_SetupProjVelocity_UP_PRI(ent,wepname) W_SetupProjVelocity_Explicit(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 W_SetupProjVelocity_UP_SEC(ent,wepname) W_SetupProjVelocity_Explicit(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 W_SetupProjVelocity_UP_BOTH(ent,wepname,isprimary) W_SetupProjVelocity_Explicit(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 W_SetupProjVelocity_PRE(ent,wepname,prefix) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR(wepname, prefix##speed), 0, 0, WEP_CVAR(wepname, prefix##spread), FALSE)
+#define W_SetupProjVelocity_PRI(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_PRI(wepname, speed), 0, 0, WEP_CVAR_PRI(wepname, spread), FALSE)
+#define W_SetupProjVelocity_SEC(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_SEC(wepname, speed), 0, 0, WEP_CVAR_SEC(wepname, spread), FALSE)
+#define W_SetupProjVelocity_BOTH(ent,wepname,isprimary) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_BOTH(wepname, isprimary, speed), 0, 0, WEP_CVAR_BOTH(wepname, isprimary, spread), FALSE)
 
 // ====================
 //  Ballistics Tracing