]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/seeker.qc
Rename the weapon swap cvar to g_weapon_noncore_allow and update its description...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / seeker.qc
index f8c2be1d50777e1cea209366fe830aee87381009..1150baf98b96af3bf24fb7b6513faa193969b68f 100644 (file)
@@ -2,6 +2,15 @@
 
 #ifdef SVQC
 
+METHOD(Seeker, m_spawnfunc_hookreplace, Weapon(Seeker this, entity e))
+{
+    if (autocvar_g_weapon_noncore_allow && !Item_IsLoot(e) && (this.spawnflags & WEP_FLAG_MUTATORBLOCKED))
+    {
+        return WEP_HAGAR;
+    }
+    return this;
+}
+
 // ============================
 // Begin: Missile functions, these are general functions to be manipulated by other code
 // ============================
@@ -342,8 +351,6 @@ void W_Seeker_Attack(Weapon thiswep, entity actor, .entity weaponentity)
 
 void W_Seeker_Vollycontroller_Think(entity this) // TODO: Merge this with W_Seeker_Attack
 {
-       float c;
-       entity oldenemy;
        this.cnt = this.cnt - 1;
 
        Weapon thiswep = WEP_SEEKER;
@@ -358,11 +365,10 @@ void W_Seeker_Vollycontroller_Think(entity this) // TODO: Merge this with W_Seek
 
        entity own = this.realowner;
 
-       oldenemy = own.enemy;
+       entity oldenemy = own.enemy;
        own.enemy = this.enemy;
 
-       c = own.cnt % 4;
-       switch(c)
+       switch(own.cnt % 4)
        {
                case 0:
                        W_Seeker_Fire_Missile(thiswep, own, weaponentity, '-1.25 -3.75 0', own.enemy); // TODO