]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/electro.qc
Move MOVETYPE_FLY to ecs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / electro.qc
index 09cb77c8bd9a5b2774d8178f48bccc195bead691..1fc3cb4b1a71ac0ae217beeaad83106652cfe2cc 100644 (file)
@@ -202,8 +202,12 @@ void W_Electro_TouchExplode(entity this)
        W_Electro_Explode(this);
 }
 
+
+void sys_phys_update_single(entity this);
+
 void W_Electro_Bolt_Think(entity this)
 {
+       sys_phys_update_single(this);
        if(time >= this.ltime)
        {
                this.use(this, NULL, NULL);
@@ -252,6 +256,7 @@ void W_Electro_Bolt_Think(entity this)
                        { this.nextthink = min(time + WEP_CVAR_PRI(electro, midaircombo_interval), this.ltime); }
        }
        else { this.nextthink = this.ltime; }
+       this.nextthink = time;
 }
 
 void W_Electro_Attack_Bolt(Weapon thiswep, entity actor)
@@ -285,7 +290,7 @@ void W_Electro_Attack_Bolt(Weapon thiswep, entity actor)
        proj.projectiledeathtype = WEP_ELECTRO.m_id;
        setorigin(proj, w_shotorg);
 
-       proj.movetype = MOVETYPE_FLY;
+       if (IS_CSQC) proj.movetype = MOVETYPE_FLY;
        W_SetupProjVelocity_PRI(proj, electro);
        proj.angles = vectoangles(proj.velocity);
        settouch(proj, W_Electro_TouchExplode);
@@ -296,6 +301,8 @@ void W_Electro_Attack_Bolt(Weapon thiswep, entity actor)
        CSQCProjectile(proj, true, PROJECTILE_ELECTRO_BEAM, true);
 
        MUTATOR_CALLHOOK(EditProjectile, actor, proj);
+       proj.com_phys_pos = proj.origin;
+       proj.com_phys_vel = proj.velocity;
 }
 
 void W_Electro_Orb_Touch(entity this)