]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a mutator hook to customise vortex beam
authorMario <mario@smbclan.net>
Thu, 12 Nov 2015 05:57:17 +0000 (15:57 +1000)
committerMario <mario@smbclan.net>
Thu, 12 Nov 2015 05:57:17 +0000 (15:57 +1000)
qcsrc/client/mutators/events.qh
qcsrc/common/weapons/weapon/vortex.qc

index 99707105a322a492e12e4a44f15a7dc12bb2598e..34f75b0ea1d5d331d0c801ff79177a75d8fcc1c5 100644 (file)
@@ -121,4 +121,13 @@ MUTATOR_HOOKABLE(HUD_Draw_overlay, EV_HUD_Draw_overlay);
 
 MUTATOR_HOOKABLE(HUD_Powerups_add, EV_NO_ARGS);
 
+/** Return true to not draw any vortex beam */
+#define EV_Particles_VortexBeam(i, o) \
+       /**/ i(vector, vbeam_shotorg) \
+       /**/ i(vector, vbeam_endpos) \
+       /**/
+vector vbeam_shotorg;
+vector vbeam_endpos;
+MUTATOR_HOOKABLE(Particles_VortexBeam, EV_Particles_VortexBeam);
+
 #endif
index bae7cca3de0ccb6fbd30086152c9c0f3cb31bedc..8a90679b81a2690428328e79dd4598ccf40ce183 100644 (file)
@@ -91,7 +91,8 @@ NET_HANDLE(TE_CSQC_VORTEXBEAMPARTICLE, bool isNew)
        charge = sqrt(charge); // divide evenly among trail spacing and alpha
        particles_alphamin = particles_alphamax = particles_fade = charge;
 
-       if (autocvar_cl_particles_oldvortexbeam && (getstati(STAT_ALLOW_OLDVORTEXBEAM) || isdemo()))
+       if(!MUTATOR_CALLHOOK(Particles_VortexBeam, shotorg, endpos))
+       if(autocvar_cl_particles_oldvortexbeam && (getstati(STAT_ALLOW_OLDVORTEXBEAM) || isdemo()))
                WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
        else
                WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);