]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/effects/all.qc
Merge branch 'master' into terencehill/race_fix
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / effects / all.qc
index 7172a202abda3008109bdfc412ca20e81263ec7f..73f1fe65fb4f150da0a5d4108e101535339e9a4c 100644 (file)
@@ -1,11 +1,12 @@
 #include "all.qh"
 
-REGISTER_NET_TEMP(net_effect, bool isNew)
+REGISTER_NET_TEMP(net_effect)
 #ifdef CSQC
+NET_HANDLE(net_effect, bool isNew)
 {
        int net_name = (Effects_COUNT >= 255) ? ReadShort() : ReadByte();
 
-       entity eff = Effects[net_name];
+       entity eff = Effects_from(net_name);
 
        vector vel = '0 0 0';
        int eff_cnt = 1;
@@ -29,7 +30,8 @@ REGISTER_NET_TEMP(net_effect, bool isNew)
        if(eff_trail)
                WarpZone_TrailParticles(world, particleeffectnum(eff), v, vel);
        else
-               pointparticles(particleeffectnum(eff), v, vel, eff_cnt);
+               pointparticles(eff, v, vel, eff_cnt);
+       return true;
 }
 #endif
 
@@ -64,8 +66,7 @@ void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
 {
        if(!eff) { return; }
        if(!eff.eent_eff_trail && !eff_cnt) { return; } // effect has no count!
-       entity net_eff = new(net_effect);
-       make_pure(net_eff);
+       entity net_eff = new_pure(net_effect);
        net_eff.owner = eff;
        //net_eff.eent_broadcast = broadcast;
        net_eff.m_id = eff.m_id;
@@ -74,18 +75,20 @@ void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
        net_eff.eent_net_count = eff_cnt;
        net_eff.eent_eff_trail = eff.eent_eff_trail;
 
-       entity e; FOR_EACH_REALCLIENT(e) Net_Write_Effect(net_eff, e, 0);
+       FOREACH_CLIENT(IS_REAL_CLIENT(it), Net_Write_Effect(net_eff, it, 0));
        remove(net_eff);
 }
 
 void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt)
 {
        // problem with this is, we might not have all the available effects for it
-       FOREACH(Effects, it.eent_eff_name == eff_name, LAMBDA(
+       FOREACH(Effects, it.eent_eff_name == eff_name, {
                Send_Effect(it, eff_loc, eff_vel, eff_cnt);
                return;
-       ));
+       });
        // revert to engine handling
-       pointparticles(_particleeffectnum(eff_name), eff_loc, eff_vel, eff_cnt);
+       __pointparticles(_particleeffectnum(eff_name), eff_loc, eff_vel, eff_cnt);
 }
 #endif
+
+#include "effectinfo.qc"