]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix hook alignment
authorMario <mario@smbclan.net>
Mon, 3 Oct 2016 12:42:15 +0000 (22:42 +1000)
committerMario <mario@smbclan.net>
Mon, 3 Oct 2016 12:42:15 +0000 (22:42 +1000)
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/hook.qc
qcsrc/server/g_hook.qc

index 6f8b6691ab11e52d53f4ff9d2a1b76d6349b913c..889222d4ccb96c209a98c0c78e7b11564ee5708f 100644 (file)
@@ -1304,7 +1304,7 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew)
 
        if(isnew)
        {
-               int gunalign = W_GunAlign(viewmodels[slot], STAT(GUNALIGN));
+               int gunalign = W_GunAlign(viewmodels[slot], STAT(GUNALIGN)) - 1;
 
                this.beam_shotorigin = arc_shotorigin[gunalign];
 
index db2ac45d6eed9461d3ee7c5da750013f7c95ddde..964877425420949fdcd06bcb1d1e7524c1efdadc 100644 (file)
@@ -379,7 +379,7 @@ void Draw_GrapplingHook(entity this)
 
        InterpolateOrigin_Do(this);
 
-       int s = viewmodels[this.cnt].m_gunalign; //W_GunAlign(NULL, STAT(GUNALIGN));
+       int s = viewmodels[this.cnt].m_gunalign - 1; //W_GunAlign(NULL, STAT(GUNALIGN));
 
        switch(this.HookType)
        {
index 636e8c6aae99670ab355a0c24354c4a4c79291f3..32cce331a50776da625ffa35df7544f86afbcc5f 100644 (file)
@@ -172,7 +172,7 @@ void GrapplingHookThink(entity this)
 
        this.nextthink = time;
 
-       int s = W_GunAlign(this.realowner.(weaponentity), STAT(GUNALIGN, this.realowner));
+       int s = W_GunAlign(this.realowner.(weaponentity), STAT(GUNALIGN, this.realowner)) - 1;
        vs = hook_shotorigin[s];
 
        makevectors(this.realowner.v_angle);
@@ -362,28 +362,24 @@ void GrapplingHook_Damage(entity this, entity inflictor, entity attacker, float
 
 void FireGrapplingHook(entity actor, .entity weaponentity)
 {
-       entity missile;
-       vector org;
-       vector vs;
-
        if(forbidWeaponUse(actor)) return;
        if(actor.vehicle) return;
 
        makevectors(actor.v_angle);
 
-       int s = W_GunAlign(actor.(weaponentity), STAT(GUNALIGN, actor));
-       vs = hook_shotorigin[s];
+       int s = W_GunAlign(actor.(weaponentity), STAT(GUNALIGN, actor)) - 1;
+       vector vs = hook_shotorigin[s];
 
        // UGLY WORKAROUND: play this on CH_WEAPON_B so it can't cut off fire sounds
        sound (actor, CH_WEAPON_B, SND_HOOK_FIRE, VOL_BASE, ATTEN_NORM);
-       org = actor.origin + actor.view_ofs + v_forward * vs.x + v_right * -vs.y + v_up * vs.z;
+       vector org = actor.origin + actor.view_ofs + v_forward * vs.x + v_right * -vs.y + v_up * vs.z;
 
        tracebox(actor.origin + actor.view_ofs, '-3 -3 -3', '3 3 3', org, MOVE_NORMAL, actor);
        org = trace_endpos;
 
        Send_Effect(EFFECT_HOOK_MUZZLEFLASH, org, '0 0 0', 1);
 
-       missile = WarpZone_RefSys_SpawnSameRefSys(actor);
+       entity missile = WarpZone_RefSys_SpawnSameRefSys(actor);
        missile.owner = missile.realowner = actor;
        actor.(weaponentity).hook = missile;
        missile.weaponentity_fld = weaponentity;