]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Lyberta/OffhandBlaster 534/head
authorLyberta <lyberta@lyberta.net>
Sat, 17 Feb 2018 05:21:25 +0000 (08:21 +0300)
committerLyberta <lyberta@lyberta.net>
Sat, 17 Feb 2018 05:21:25 +0000 (08:21 +0300)
1  2 
qcsrc/common/mutators/mutator/overkill/sv_overkill.qc
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/blaster.qh
qcsrc/common/weapons/weapon/vaporizer.qc

index cb790afc1ee1f40ac67daa3a247b1623b0b248d4,20216f9283d1333115be8045b3a78c395f24b17e..e9106239467ffc7432cda21fa887481db192a6cc
@@@ -144,7 -144,20 +144,7 @@@ MUTATOR_HOOKFUNCTION(ok, PlayerPreThink
                        if(player.(weaponentity).m_weapon == WEP_Null && slot != 0)
                                continue;
  
-                       BLASTER_SECONDARY_ATTACK_HACK(vaporizer, player, weaponentity);
 -                      W_Blaster_Attack(
 -                              player,
 -                              weaponentity,
 -                              WEP_BLASTER.m_id | HITTYPE_SECONDARY,
 -                              WEP_CVAR_SEC(vaporizer, shotangle),
 -                              WEP_CVAR_SEC(vaporizer, damage),
 -                              WEP_CVAR_SEC(vaporizer, edgedamage),
 -                              WEP_CVAR_SEC(vaporizer, radius),
 -                              WEP_CVAR_SEC(vaporizer, force),
 -                              WEP_CVAR_SEC(vaporizer, speed),
 -                              WEP_CVAR_SEC(vaporizer, spread),
 -                              WEP_CVAR_SEC(vaporizer, delay),
 -                              WEP_CVAR_SEC(vaporizer, lifetime)
 -                      );
++                      BLASTER_SECONDARY_ATTACK(vaporizer, player, weaponentity);
                }
        }
  
index 9ca40be75741c3d8818c1fed4dd430f33ba5fea3,ec1f070e3e2be1f24167c3432b50ce4909870158..e3d713d470b5808f2f12a35b02cdaf6c53bb5755
@@@ -193,17 -195,6 +195,17 @@@ METHOD(Blaster, wr_killmessage, Notific
      return WEAPON_BLASTER_MURDER;
  }
  
-       BLASTER_SECONDARY_ATTACK_HACK(blaster, actor, weaponentity);
 +METHOD(OffhandBlaster, offhand_think, void(OffhandBlaster this, entity actor, bool key_pressed))
 +{
 +      if (!key_pressed || (time < actor.jump_interval))
 +      {
 +              return;
 +      }
 +      actor.jump_interval = time + WEP_CVAR_SEC(blaster, refire) * W_WeaponRateFactor(actor);
 +      .entity weaponentity = weaponentities[1];
++      BLASTER_SECONDARY_ATTACK(blaster, actor, weaponentity);
 +}
 +
  #endif
  #ifdef CSQC
  
index 9d28e73772dd3405046d24ad5f7dcebae4ba0209,0a0e7c17d2f57c21cdbee6d3735f0576c566377e..7efbdf7a52cc661899ce42c973c72c11df5959df
@@@ -59,24 -55,4 +59,22 @@@ OffhandBlaster OFFHAND_BLASTER; STATIC_
  .float blaster_force;
  .float blaster_lifetime;
  
- #define BLASTER_SECONDARY_ATTACK_HACK(weapon_name, actor, weaponentity) \
++// Will be demacroed after WEP_CVAR macros are also demacroed.
++#define BLASTER_SECONDARY_ATTACK(weapon_name, actor, weaponentity) \
 +      makevectors(actor.v_angle); \
-       Weapon oldwep = actor.(weaponentity).m_weapon; \
-       actor.(weaponentity).m_weapon = WEP_BLASTER; \
 +      W_Blaster_Attack( \
 +              actor, \
 +              weaponentity, \
 +              WEP_BLASTER.m_id | HITTYPE_SECONDARY, \
 +              WEP_CVAR_SEC(weapon_name, shotangle), \
 +              WEP_CVAR_SEC(weapon_name, damage), \
 +              WEP_CVAR_SEC(weapon_name, edgedamage), \
 +              WEP_CVAR_SEC(weapon_name, radius), \
 +              WEP_CVAR_SEC(weapon_name, force), \
 +              WEP_CVAR_SEC(weapon_name, speed), \
 +              WEP_CVAR_SEC(weapon_name, spread), \
 +              WEP_CVAR_SEC(weapon_name, delay), \
 +              WEP_CVAR_SEC(weapon_name, lifetime) \
-       ); \
-       actor.(weaponentity).m_weapon = oldwep;
++      );
 +
  #endif
index 0cb3883f42fa6db1b3aa8f341cd070d9d2bf65e5,c2a9491be2ad0a3c30f79e2a5da14a233c72d86c..7dae1b3f731d2a3cf479a8a71ddd733ea1ed2afe
@@@ -342,7 -338,22 +338,7 @@@ METHOD(Vaporizer, wr_think, void(entit
              if(WEP_CVAR_SEC(vaporizer, ammo))
                  W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(vaporizer, ammo), weaponentity);
  
-             BLASTER_SECONDARY_ATTACK_HACK(vaporizer, actor, weaponentity);
 -            // ugly instagib hack to reuse the fire mode of the laser
 -            makevectors(actor.v_angle);
 -            W_Blaster_Attack(
 -                actor,
 -                weaponentity,
 -                WEP_BLASTER.m_id | HITTYPE_SECONDARY,
 -                WEP_CVAR_SEC(vaporizer, shotangle),
 -                WEP_CVAR_SEC(vaporizer, damage),
 -                WEP_CVAR_SEC(vaporizer, edgedamage),
 -                WEP_CVAR_SEC(vaporizer, radius),
 -                WEP_CVAR_SEC(vaporizer, force),
 -                WEP_CVAR_SEC(vaporizer, speed),
 -                WEP_CVAR_SEC(vaporizer, spread),
 -                WEP_CVAR_SEC(vaporizer, delay),
 -                WEP_CVAR_SEC(vaporizer, lifetime)
 -            );
++            BLASTER_SECONDARY_ATTACK(vaporizer, actor, weaponentity);
  
              // now do normal refire
              weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(vaporizer, animtime), w_ready);