]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/electro.qc
Allow electro orbs to stick to entities if touchexplode is off
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / electro.qc
index cff7122c0f68decdbff36981ab3880e86a9d6a4e..e22b5e941270b7f2757b407675b6db7c6ead44a5 100644 (file)
@@ -64,7 +64,7 @@ void W_Electro_ExplodeCombo(entity this)
                NULL,
                NULL,
                WEP_CVAR(electro, combo_force),
-               this.projectiledeathtype | HITTYPE_BOUNCE, // use THIS type for a combo because primary can't bounce
+               WEP_ELECTRO.m_id | HITTYPE_BOUNCE, // use THIS type for a combo because primary can't bounce
                this.weaponentity_fld,
                NULL
        );
@@ -279,14 +279,14 @@ void W_Electro_Orb_Stick(entity this, entity to)
        delete(this);
 
        if(to)
-               SetMovetypeFollow(this, to);
+               SetMovetypeFollow(newproj, to);
 }
 
 void W_Electro_Orb_Touch(entity this, entity toucher)
 {
        PROJECTILE_TOUCH(this, toucher);
-       if(toucher.takedamage == DAMAGE_AIM)
-               { if(WEP_CVAR_SEC(electro, touchexplode)) { W_Electro_Explode(this, toucher); } }
+       if(toucher.takedamage == DAMAGE_AIM && WEP_CVAR_SEC(electro, touchexplode))
+               { W_Electro_Explode(this, toucher); }
        else if(toucher.owner != this.owner && toucher.classname != this.classname) // don't stick to player's other projectiles!
        {
                //UpdateCSQCProjectile(this);
@@ -394,14 +394,6 @@ void W_Electro_Attack_Orb(Weapon thiswep, entity actor, .entity weaponentity)
        proj.bouncestop = WEP_CVAR_SEC(electro, bouncestop);
        proj.missile_flags = MIF_SPLASH | MIF_ARC;
 
-#if 0
-       entity p2;
-       p2 = spawn();
-       copyentity(proj, p2);
-       setmodel(p2, MDL_PROJECTILE_ELECTRO);
-       setsize(p2, proj.mins, proj.maxs);
-#endif
-
        CSQCProjectile(proj, true, PROJECTILE_ELECTRO, false); // no culling, it has sound
 
        MUTATOR_CALLHOOK(EditProjectile, actor, proj);