]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow melee while crouching (the technical limitation preventing this before no longe...
authorMario <mario@smbclan.net>
Mon, 8 Aug 2016 11:16:57 +0000 (21:16 +1000)
committerMario <mario@smbclan.net>
Mon, 8 Aug 2016 11:16:57 +0000 (21:16 +1000)
qcsrc/common/physics/player.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/server/cl_client.qc

index 9341f1b2b03b7fcbeba6529819153b7223e91d66..6823c29631a18146a561cd4ecbbc25baa513d641 100644 (file)
@@ -134,10 +134,6 @@ void PM_ClientMovement_UpdateStatus(entity this)
                do_crouch = false;
        if(STAT(FROZEN, this))
                do_crouch = false;
-       if((activeweapon.spawnflags & WEP_TYPE_MELEE_PRI) && viewmodel.animstate_startframe == viewmodel.anim_fire1_x && time < viewmodel.weapon_nextthink)
-               do_crouch = false;
-       if((activeweapon.spawnflags & WEP_TYPE_MELEE_SEC) && viewmodel.animstate_startframe == viewmodel.anim_fire2_x && time < viewmodel.weapon_nextthink)
-               do_crouch = false;
 
        if (do_crouch)
        {
index f143bd1cc2e0fe7703d7d3ea1364ae36e40c4d50..f8f41f1b4a4197305feec1905f55223698e0b59f 100644 (file)
@@ -718,7 +718,6 @@ METHOD(Shockwave, wr_think, void(entity thiswep, entity actor, .entity weaponent
     else if(fire & 2)
     {
         //if(actor.clip_load >= 0) // we are not currently reloading
-        if(!actor.crouch) // no crouchmelee please
         if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR(shockwave, melee_refire)))
         {
             // attempt forcing playback of the anim by switching to another anim (that we never play) here...
index b03c6fb4da31ae397691e2bf66981dd6383975e7..d8de5ee0f674c7a9fa51eb4753f603f74011b354 100644 (file)
@@ -270,7 +270,6 @@ METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentit
         }
     }
     if(actor.clip_load >= 0) // we are not currently reloading
-    if(!actor.crouch) // no crouchmelee please
     if(WEP_CVAR(shotgun, secondary) == 1)
     if(((fire & 1) && actor.(thiswep.ammo_field) <= 0 && !(actor.items & IT_UNLIMITED_WEAPON_AMMO)) || (fire & 2))
     if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(shotgun, refire)))
index b9ada9722f1ca341cc9000fd977880942b758589..a1e6c7cca1fe10996b384621c47c8e784bbb716d 100644 (file)
@@ -2329,7 +2329,6 @@ void PlayerPreThink (entity this)
                this.prevorigin = this.origin;
 
                bool do_crouch = PHYS_INPUT_BUTTON_CROUCH(this);
-        .entity weaponentity = weaponentities[0]; // TODO: unhardcode
                if (this.hook.state) {
                        do_crouch = false;
                } else if (this.waterlevel >= WATERLEVEL_SWIMMING) {
@@ -2338,10 +2337,6 @@ void PlayerPreThink (entity this)
                        do_crouch = false;
                } else if (STAT(FROZEN, this)) {
                        do_crouch = false;
-        } else if ((PS(this).m_weapon.spawnflags & WEP_TYPE_MELEE_PRI) && this.(weaponentity).wframe == WFRAME_FIRE1 && time < this.(weaponentity).weapon_nextthink) {
-                       do_crouch = false;
-        } else if ((PS(this).m_weapon.spawnflags & WEP_TYPE_MELEE_SEC) && this.(weaponentity).wframe == WFRAME_FIRE2 && time < this.(weaponentity).weapon_nextthink) {
-                       do_crouch = false;
         }
 
                if (do_crouch) {