]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix dual wielding devastator and mortar, enable vortex and rifle in dual wielding...
authorMario <mario@smbclan.net>
Sat, 9 Jun 2018 12:15:07 +0000 (22:15 +1000)
committerMario <mario@smbclan.net>
Sat, 9 Jun 2018 12:15:07 +0000 (22:15 +1000)
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/devastator.qh
qcsrc/common/weapons/weapon/fireball.qc
qcsrc/common/weapons/weapon/mortar.qh
qcsrc/common/weapons/weapon/rifle.qh
qcsrc/common/weapons/weapon/vortex.qh
qcsrc/server/weapons/tracing.qc

index 0a046389c7fa3d3cc57aa2106324124dce0e3271..c53e110fddb07a699988578d09067db6e73a462c 100644 (file)
@@ -235,11 +235,19 @@ void W_Devastator_Think(entity this)
                        else
                                f = 1;
 
+                       vector md = this.realowner.(weaponentity).movedir;
+                       vector vecs = ((md.x > 0) ? md : '0 0 0');
+
+                       vector dv = v_right * -vecs.y + v_up * vecs.z;
+
+                       if(!W_DualWielding(this.realowner))
+                               dv = '0 0 0'; // don't override!
+
                        velspeed = vlen(this.velocity);
 
                        makevectors(this.realowner.v_angle);
                        desireddir = WarpZone_RefSys_TransformVelocity(this.realowner, this, v_forward);
-                       desiredorigin = WarpZone_RefSys_TransformOrigin(this.realowner, this, this.realowner.origin + this.realowner.view_ofs);
+                       desiredorigin = WarpZone_RefSys_TransformOrigin(this.realowner, this, this.realowner.origin + this.realowner.view_ofs + dv);
                        olddir = normalize(this.velocity);
 
                        // now it gets tricky... we want to move like some curve to approximate the target direction
index 0e8d8b2fbc8b271102ac17363b1435a957db1047..e858d54e42d155f87653fb38c1bb85c304d8e152 100644 (file)
@@ -4,7 +4,7 @@ CLASS(Devastator, Weapon)
 /* spawnfunc */ ATTRIB(Devastator, m_canonical_spawnfunc, string, "weapon_devastator");
 /* ammotype  */ ATTRIB(Devastator, ammo_type, int, RESOURCE_ROCKETS);
 /* impulse   */ ATTRIB(Devastator, impulse, int, 9);
-/* flags     */ ATTRIB(Devastator, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
+/* flags     */ ATTRIB(Devastator, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
 /* rating    */ ATTRIB(Devastator, bot_pickupbasevalue, float, 8000);
 /* color     */ ATTRIB(Devastator, wpcolor, vector, '1 1 0');
 /* modelname */ ATTRIB(Devastator, mdl, string, "rl");
index ef2eb91cad89e031398ab71de55ecdd3bf1010c3..ee4b2e0847f27b032837872c4070e3026254113f 100644 (file)
@@ -155,7 +155,6 @@ void W_Fireball_Attack1(entity actor, .entity weaponentity)
        PROJECTILE_MAKETRIGGER(proj);
        proj.projectiledeathtype = WEP_FIREBALL.m_id;
        proj.weaponentity_fld = weaponentity;
-       proj.weaponentity_fld = weaponentity;
        setorigin(proj, w_shotorg);
 
        set_movetype(proj, MOVETYPE_FLY);
index 2161d468bf6df5f18c497aee3c2ef484d7c01665..affec0dbcae952696866a9c6e08c84d15b7ba454 100644 (file)
@@ -4,7 +4,7 @@ CLASS(Mortar, Weapon)
 /* spawnfunc */ ATTRIB(Mortar, m_canonical_spawnfunc, string, "weapon_mortar");
 /* ammotype  */ ATTRIB(Mortar, ammo_type, int, RESOURCE_ROCKETS);
 /* impulse   */ ATTRIB(Mortar, impulse, int, 4);
-/* flags     */ ATTRIB(Mortar, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
+/* flags     */ ATTRIB(Mortar, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
 /* rating    */ ATTRIB(Mortar, bot_pickupbasevalue, float, 7000);
 /* color     */ ATTRIB(Mortar, wpcolor, vector, '1 0 0');
 /* modelname */ ATTRIB(Mortar, mdl, string, "gl");
index 87bc4d7ec1d856424cde3776886176591166ef57..560354c0529b40b5e19e9a4ff389a01946dae6c6 100644 (file)
@@ -4,7 +4,7 @@ CLASS(Rifle, Weapon)
 /* spawnfunc */ ATTRIB(Rifle, m_canonical_spawnfunc, string, "weapon_rifle");
 /* ammotype  */ ATTRIB(Rifle, ammo_type, int, RESOURCE_BULLETS);
 /* impulse   */ ATTRIB(Rifle, impulse, int, 7);
-/* flags     */ ATTRIB(Rifle, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS | WEP_FLAG_NODUAL);
+/* flags     */ ATTRIB(Rifle, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS);
 /* rating    */ ATTRIB(Rifle, bot_pickupbasevalue, float, 7000);
 /* color     */ ATTRIB(Rifle, wpcolor, vector, '0.5 1 0');
 /* modelname */ ATTRIB(Rifle, mdl, string, "campingrifle");
index cc975ccebdff7748748601b20c59d8ea3008f370..8a11b2e13e4c3a00a751400047f4ded606a94789 100644 (file)
@@ -4,7 +4,7 @@ CLASS(Vortex, Weapon)
 /* spawnfunc */ ATTRIB(Vortex, m_canonical_spawnfunc, string, "weapon_vortex");
 /* ammotype  */ ATTRIB(Vortex, ammo_type, int, RESOURCE_CELLS);
 /* impulse   */ ATTRIB(Vortex, impulse, int, 7);
-/* flags     */ ATTRIB(Vortex, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_NODUAL);
+/* flags     */ ATTRIB(Vortex, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN);
 /* rating    */ ATTRIB(Vortex, bot_pickupbasevalue, float, 8000);
 /* color     */ ATTRIB(Vortex, wpcolor, vector, '0.5 1 1');
 /* modelname */ ATTRIB(Vortex, mdl, string, "nex");
index a3898c627720059dbf6aecb3eef1c29e3a71c5aa..46c26b2e866182fbaaa332000e366c0794317424 100644 (file)
@@ -81,7 +81,10 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, .entity weaponentity, vect
                tracebox(w_shotorg, mi, ma, w_shotorg + v_forward * (vecs.x + nudge), MOVE_NORMAL, ent);
        w_shotorg = trace_endpos - v_forward * nudge;
        // calculate the shotdir from the chosen shotorg
-       w_shotdir = normalize(w_shotend - w_shotorg);
+       if(W_DualWielding(ent))
+               w_shotdir = s_forward;
+       else
+               w_shotdir = normalize(w_shotend - w_shotorg);
 
        //vector prevdir = w_shotdir;
        //vector prevorg = w_shotorg;