]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add support for traileffect on CSQC models
authorMario <zacjardine@y7mail.com>
Mon, 5 Oct 2015 09:39:25 +0000 (19:39 +1000)
committerMario <zacjardine@y7mail.com>
Mon, 5 Oct 2015 09:39:25 +0000 (19:39 +1000)
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/weapons/projectile.qc
qcsrc/common/csqcmodel_settings.qh
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/nades.qh
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/unit/bumblebee.qc
qcsrc/common/vehicles/unit/spiderbot.qc
qcsrc/csqcmodellib/sv_model.qc
qcsrc/csqcmodellib/sv_model.qh
qcsrc/server/mutators/mutator_nades.qc

index 0c25e60064533141963afe43b98f957756279e2f..488289f15e60d88da20f79688b51d27f0dbe354a 100644 (file)
@@ -494,10 +494,12 @@ const int MF_TRACER2 =  64; // orange split trail
 const int MF_TRACER3 = 128; // purple trail
 .int csqcmodel_effects;
 .int csqcmodel_modelflags;
+.int csqcmodel_traileffect;
 void CSQCModel_Effects_PreUpdate(void)
 {SELFPARAM();
        self.effects = self.csqcmodel_effects;
        self.modelflags = self.csqcmodel_modelflags;
+       self.traileffect = self.csqcmodel_traileffect;
 }
 void Reset_ArcBeam(void);
 void CSQCModel_Effects_PostUpdate(void)
@@ -509,6 +511,7 @@ void CSQCModel_Effects_PostUpdate(void)
        }
        self.csqcmodel_effects = self.effects;
        self.csqcmodel_modelflags = self.modelflags;
+       self.csqcmodel_traileffect = self.traileffect;
        self.effects = 0;
        self.modelflags = 0;
        if(self.csqcmodel_teleported)
@@ -518,13 +521,14 @@ void CSQCModel_Effects_PostUpdate(void)
 void CSQCModel_Effects_Apply(void)
 {SELFPARAM();
        int eff = self.csqcmodel_effects & ~CSQCMODEL_EF_RESPAWNGHOST;
+       int tref = self.csqcmodel_traileffect;
 
        self.renderflags &= ~(RF_DEPTHHACK | RF_ADDITIVE | RF_FULLBRIGHT | EF_NOSHADOW | RF_USEAXIS);
        self.effects = 0;
        self.traileffect = 0;
 
        if(eff & EF_BRIGHTFIELD)
-               self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA);
+               tref = particleeffectnum(EFFECT_TR_NEXUIZPLASMA);
        // ignoring EF_MUZZLEFLASH
        if(eff & EF_BRIGHTLIGHT)
                adddynamiclight(self.origin, 400, '3 3 3');
@@ -558,24 +562,26 @@ void CSQCModel_Effects_Apply(void)
                self.renderflags |= RF_DYNAMICMODELLIGHT;
        // ignoring EF_UNUSED18, EF_UNUSED19, EF_RESTARTANIM_BIT, EF_TELEPORT_BIT, EF_LOWPRECISION
        if(self.csqcmodel_modelflags & MF_ROCKET)
-               self.traileffect = particleeffectnum(EFFECT_TR_ROCKET);
+               tref = particleeffectnum(EFFECT_TR_ROCKET);
        if(self.csqcmodel_modelflags & MF_GRENADE)
-               self.traileffect = particleeffectnum(EFFECT_TR_GRENADE);
+               tref = particleeffectnum(EFFECT_TR_GRENADE);
        if(self.csqcmodel_modelflags & MF_GIB)
-               self.traileffect = particleeffectnum(EFFECT_TR_BLOOD);
+               tref = particleeffectnum(EFFECT_TR_BLOOD);
        if(self.csqcmodel_modelflags & MF_ROTATE)
        {
                self.renderflags |= RF_USEAXIS;
                makevectors(self.angles + '0 100 0' * fmod(time, 3.6));
        }
        if(self.csqcmodel_modelflags & MF_TRACER)
-               self.traileffect = particleeffectnum(EFFECT_TR_WIZSPIKE);
+               tref = particleeffectnum(EFFECT_TR_WIZSPIKE);
        if(self.csqcmodel_modelflags & MF_ZOMGIB)
-               self.traileffect = particleeffectnum(EFFECT_TR_SLIGHTBLOOD);
+               tref = particleeffectnum(EFFECT_TR_SLIGHTBLOOD);
        if(self.csqcmodel_modelflags & MF_TRACER2)
-               self.traileffect = particleeffectnum(EFFECT_TR_KNIGHTSPIKE);
+               tref = particleeffectnum(EFFECT_TR_KNIGHTSPIKE);
        if(self.csqcmodel_modelflags & MF_TRACER3)
-               self.traileffect = particleeffectnum(EFFECT_TR_VORESPIKE);
+               tref = particleeffectnum(EFFECT_TR_VORESPIKE);
+
+       self.traileffect = tref;
 
        if(self.drawmask)
                Projectile_DrawTrail(self.origin);
index c83dc0551e49d661c40afb5a7e3e46adbfe6bbc3..051bc40982f55c2df6185373b2c9826a81b3310c 100644 (file)
@@ -47,7 +47,7 @@ void Projectile_DrawTrail(vector to)
        if (self.traileffect)
        {
                particles_alphamin = particles_alphamax = particles_fade = sqrt(self.alpha);
-               boxparticles(self.traileffect, self, from, to, self.velocity, self.velocity, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE | PARTICLES_DRAWASTRAIL);
+               boxparticles(particleeffectnum(effects_ent[self.traileffect]), self, from, to, self.velocity, self.velocity, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE | PARTICLES_DRAWASTRAIL);
        }
 }
 
@@ -279,45 +279,45 @@ void Ent_Projectile()
                self.traileffect = 0;
                switch (self.cnt) {
 #define CASE(id) case PROJECTILE_##id: setmodel(self, MDL_PROJECTILE_##id);
-                       CASE(ELECTRO)            self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
-                       CASE(ROCKET)             self.traileffect = particleeffectnum(EFFECT_TR_ROCKET); self.scale = 2; break;
-                       CASE(CRYLINK)            self.traileffect = particleeffectnum(EFFECT_TR_CRYLINKPLASMA); break;
-                       CASE(CRYLINK_BOUNCING)   self.traileffect = particleeffectnum(EFFECT_TR_CRYLINKPLASMA); break;
-                       CASE(ELECTRO_BEAM)       self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
-                       CASE(GRENADE)            self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break;
-                       CASE(GRENADE_BOUNCING)   self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break;
-                       CASE(MINE)               self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break;
-                       CASE(BLASTER)            self.traileffect = particleeffectnum(EFFECT_Null); break;
-                       CASE(HLAC)               self.traileffect = particleeffectnum(EFFECT_Null); break;
-                       CASE(PORTO_RED)          self.traileffect = particleeffectnum(EFFECT_TR_WIZSPIKE); self.scale = 4; break;
-                       CASE(PORTO_BLUE)         self.traileffect = particleeffectnum(EFFECT_TR_WIZSPIKE); self.scale = 4; break;
-                       CASE(HOOKBOMB)           self.traileffect = particleeffectnum(EFFECT_TR_KNIGHTSPIKE); break;
-                       CASE(HAGAR)              self.traileffect = particleeffectnum(EFFECT_HAGAR_ROCKET); self.scale = 0.75; break;
-                       CASE(HAGAR_BOUNCING)     self.traileffect = particleeffectnum(EFFECT_HAGAR_ROCKET); self.scale = 0.75; break;
+                       CASE(ELECTRO)            self.traileffect = EFFECT_TR_NEXUIZPLASMA.m_id; break;
+                       CASE(ROCKET)             self.traileffect = EFFECT_TR_ROCKET.m_id; self.scale = 2; break;
+                       CASE(CRYLINK)            self.traileffect = EFFECT_TR_CRYLINKPLASMA.m_id; break;
+                       CASE(CRYLINK_BOUNCING)   self.traileffect = EFFECT_TR_CRYLINKPLASMA.m_id; break;
+                       CASE(ELECTRO_BEAM)       self.traileffect = EFFECT_TR_NEXUIZPLASMA.m_id; break;
+                       CASE(GRENADE)            self.traileffect = EFFECT_TR_GRENADE.m_id; break;
+                       CASE(GRENADE_BOUNCING)   self.traileffect = EFFECT_TR_GRENADE.m_id; break;
+                       CASE(MINE)               self.traileffect = EFFECT_TR_GRENADE.m_id; break;
+                       CASE(BLASTER)            self.traileffect = EFFECT_Null.m_id; break;
+                       CASE(HLAC)               self.traileffect = EFFECT_Null.m_id; break;
+                       CASE(PORTO_RED)          self.traileffect = EFFECT_TR_WIZSPIKE.m_id; self.scale = 4; break;
+                       CASE(PORTO_BLUE)         self.traileffect = EFFECT_TR_WIZSPIKE.m_id; self.scale = 4; break;
+                       CASE(HOOKBOMB)           self.traileffect = EFFECT_TR_KNIGHTSPIKE.m_id; break;
+                       CASE(HAGAR)              self.traileffect = EFFECT_HAGAR_ROCKET.m_id; self.scale = 0.75; break;
+                       CASE(HAGAR_BOUNCING)     self.traileffect = EFFECT_HAGAR_ROCKET.m_id; self.scale = 0.75; break;
                        CASE(NAPALM_FOUNTAIN)    // fallthrough // sself.modelindex = 0; self.traileffect = _particleeffectnum("torch_small"); break;
-                       CASE(FIREBALL)           self.modelindex = 0; self.traileffect = particleeffectnum(EFFECT_FIREBALL); break; // particle effect is good enough
-                       CASE(FIREMINE)           self.modelindex = 0; self.traileffect = particleeffectnum(EFFECT_FIREMINE); break; // particle effect is good enough
-                       CASE(TAG)                self.traileffect = particleeffectnum(EFFECT_TR_ROCKET); break;
-                       CASE(FLAC)               self.scale = 0.4; self.traileffect = particleeffectnum(EFFECT_FLAC_TRAIL); break;
-                       CASE(SEEKER)             self.traileffect = particleeffectnum(EFFECT_SEEKER_TRAIL); break;
+                       CASE(FIREBALL)           self.modelindex = 0; self.traileffect = EFFECT_FIREBALL.m_id; break; // particle effect is good enough
+                       CASE(FIREMINE)           self.modelindex = 0; self.traileffect = EFFECT_FIREMINE.m_id; break; // particle effect is good enough
+                       CASE(TAG)                self.traileffect = EFFECT_TR_ROCKET.m_id; break;
+                       CASE(FLAC)               self.scale = 0.4; self.traileffect = EFFECT_FLAC_TRAIL.m_id; break;
+                       CASE(SEEKER)             self.traileffect = EFFECT_SEEKER_TRAIL.m_id; break;
 
-                       CASE(MAGE_SPIKE)         self.traileffect = particleeffectnum(EFFECT_TR_VORESPIKE); break;
-                       CASE(SHAMBLER_LIGHTNING) self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
+                       CASE(MAGE_SPIKE)         self.traileffect = EFFECT_TR_VORESPIKE.m_id; break;
+                       CASE(SHAMBLER_LIGHTNING) self.traileffect = EFFECT_TR_NEXUIZPLASMA.m_id; break;
 
-                       CASE(RAPTORBOMB)         self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(EFFECT_Null); break;
-                       CASE(RAPTORBOMBLET)      self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(EFFECT_Null); break;
-                       CASE(RAPTORCANNON)       self.traileffect = particleeffectnum(EFFECT_TR_CRYLINKPLASMA); break;
+                       CASE(RAPTORBOMB)         self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = EFFECT_Null.m_id; break;
+                       CASE(RAPTORBOMBLET)      self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = EFFECT_Null.m_id; break;
+                       CASE(RAPTORCANNON)       self.traileffect = EFFECT_TR_CRYLINKPLASMA.m_id; break;
 
-                       CASE(SPIDERROCKET)       self.traileffect = particleeffectnum(EFFECT_SPIDERBOT_ROCKET_TRAIL); break;
-                       CASE(WAKIROCKET)         self.traileffect = particleeffectnum(EFFECT_RACER_ROCKET_TRAIL); break;
-                       CASE(WAKICANNON)         self.traileffect = particleeffectnum(EFFECT_Null); break;
+                       CASE(SPIDERROCKET)       self.traileffect = EFFECT_SPIDERBOT_ROCKET_TRAIL.m_id; break;
+                       CASE(WAKIROCKET)         self.traileffect = EFFECT_RACER_ROCKET_TRAIL.m_id; break;
+                       CASE(WAKICANNON)         self.traileffect = EFFECT_Null.m_id; break;
 
-                       CASE(BUMBLE_GUN)         self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
-                       CASE(BUMBLE_BEAM)        self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
+                       CASE(BUMBLE_GUN)         self.traileffect = EFFECT_TR_NEXUIZPLASMA.m_id; break;
+                       CASE(BUMBLE_BEAM)        self.traileffect = EFFECT_TR_NEXUIZPLASMA.m_id; break;
 
-                       CASE(RPC)                self.traileffect = particleeffectnum(EFFECT_TR_ROCKET); break;
+                       CASE(RPC)                self.traileffect = EFFECT_TR_ROCKET.m_id; break;
 
-                       CASE(ROCKETMINSTA_LASER) self.traileffect = particleeffectnum(EFFECT_ROCKETMINSTA_LASER(self.team)); break;
+                       CASE(ROCKETMINSTA_LASER) self.traileffect = EFFECT_ROCKETMINSTA_LASER(self.team).m_id; break;
 #undef CASE
                        default:
                                if(MUTATOR_CALLHOOK(Ent_Projectile, self))
@@ -326,8 +326,8 @@ void Ent_Projectile()
                                if (Nade_FromProjectile(self.cnt) != NADE_TYPE_Null)
                                {
                                        setmodel(self, MDL_PROJECTILE_NADE);
-                                       string trail = Nade_TrailEffect(self.cnt, self.team);
-                                       if (trail) self.traileffect = _particleeffectnum(trail);
+                                       entity trail = Nade_TrailEffect(self.cnt, self.team);
+                                       if (trail.eent_eff_name) self.traileffect = trail.m_id;
                                        break;
                                }
                                error("Received invalid CSQC projectile, can't work with this!");
index d356ff76d072d7b4c8a670f4ef6118197801687f..256142759d622b44fd4baa21ddb0d5537120fb49 100644 (file)
@@ -59,6 +59,7 @@
                CSQCMODEL_PROPERTY(512, float, ReadApproxPastTime, WriteApproxPastTime, anim_upper_time) \
        CSQCMODEL_ENDIF \
        CSQCMODEL_PROPERTY(1024, float, ReadAngle, WriteAngle, v_angle_x) \
+       CSQCMODEL_PROPERTY(2048, int, ReadByte, WriteByte, traileffect) \
        CSQCMODEL_PROPERTY_SCALED(4096, float, ReadByte, WriteByte, scale, 16, 0, 255) \
        CSQCMODEL_PROPERTY(8192, int, ReadInt24_t, WriteInt24_t, dphitcontentsmask) \
        CSQCMODEL_PROPERTY(16384, TAG_VIEWLOC_TYPE, ReadShort, WriteEntity, TAG_VIEWLOC_NAME)
index 52e5af984753c8fbcdd43e898ac28165bac80433..1474ad5d241fb9c29ae8baadf9f00bf6bf4f0bad 100644 (file)
@@ -1036,7 +1036,7 @@ void Monster_Dead(entity attacker, float gibbed)
        if(!((self.flags & FL_FLY) || (self.flags & FL_SWIM)))
                self.velocity = '0 0 0';
 
-       CSQCModel_UnlinkEntity();
+       CSQCModel_UnlinkEntity(self);
 
        MON_ACTION(self.monsterid, MR_DEATH);
 
index 5a7f5d49dcd67f41f4e02232af4aee3b48048464..ef43f746c1e8259328d0647ed06d3e71b53dfcac 100644 (file)
@@ -34,7 +34,7 @@ CLASS(Nade, Object)
     ATTRIB(Nade, m_name, string, _("Grenade"))
     ATTRIB(Nade, m_icon, string, "nade_normal")
     ATTRIBARRAY(Nade, m_projectile, int, 2)
-    ATTRIBARRAY(Nade, m_trail, string, 2)
+    ATTRIBARRAY(Nade, m_trail, entity, 2)
     METHOD(Nade, display, void(entity this, void(string name, string icon) returns)) {
         returns(this.m_name, sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon));
     }
@@ -49,56 +49,56 @@ REGISTER_NADE(Null);
 
 REGISTER_NADE(NORMAL) {
     this.m_color = '1 1 1';
-    NADE_PROJECTILE(0, PROJECTILE_NADE, string_null);
-    NADE_PROJECTILE(1, PROJECTILE_NADE_BURN, string_null);
+    NADE_PROJECTILE(0, PROJECTILE_NADE, EFFECT_Null);
+    NADE_PROJECTILE(1, PROJECTILE_NADE_BURN, EFFECT_Null);
 }
 
 REGISTER_NADE(NAPALM) {
     this.m_color = '2 0.5 0';
     this.m_name = _("Napalm grenade");
     this.m_icon = "nade_napalm";
-    NADE_PROJECTILE(0, PROJECTILE_NADE_NAPALM, "TR_ROCKET");
-    NADE_PROJECTILE(1, PROJECTILE_NADE_NAPALM_BURN, "spiderbot_rocket_thrust");
+    NADE_PROJECTILE(0, PROJECTILE_NADE_NAPALM, EFFECT_TR_ROCKET);
+    NADE_PROJECTILE(1, PROJECTILE_NADE_NAPALM_BURN, EFFECT_SPIDERBOT_ROCKET_TRAIL);
 }
 
 REGISTER_NADE(ICE) {
     this.m_color = '0 0.5 2';
     this.m_name = _("Ice grenade");
     this.m_icon = "nade_ice";
-    NADE_PROJECTILE(0, PROJECTILE_NADE_ICE, "TR_NEXUIZPLASMA");
-    NADE_PROJECTILE(1, PROJECTILE_NADE_ICE_BURN, "wakizashi_rocket_thrust");
+    NADE_PROJECTILE(0, PROJECTILE_NADE_ICE, EFFECT_TR_NEXUIZPLASMA);
+    NADE_PROJECTILE(1, PROJECTILE_NADE_ICE_BURN, EFFECT_RACER_ROCKET_TRAIL);
 }
 
 REGISTER_NADE(TRANSLOCATE) {
     this.m_color = '1 0 1';
     this.m_name = _("Translocate grenade");
     this.m_icon = "nade_translocate";
-    NADE_PROJECTILE(0, PROJECTILE_NADE_TRANSLOCATE, "TR_CRYLINKPLASMA");
-    NADE_PROJECTILE(1, PROJECTILE_NADE_TRANSLOCATE, "TR_CRYLINKPLASMA");
+    NADE_PROJECTILE(0, PROJECTILE_NADE_TRANSLOCATE, EFFECT_TR_CRYLINKPLASMA);
+    NADE_PROJECTILE(1, PROJECTILE_NADE_TRANSLOCATE, EFFECT_TR_CRYLINKPLASMA);
 }
 
 REGISTER_NADE(SPAWN) {
     this.m_color = '1 0.9 0';
     this.m_name = _("Spawn grenade");
     this.m_icon = "nade_spawn";
-    NADE_PROJECTILE(0, PROJECTILE_NADE_SPAWN, "nade_yellow");
-    NADE_PROJECTILE(1, PROJECTILE_NADE_SPAWN, "nade_yellow");
+    NADE_PROJECTILE(0, PROJECTILE_NADE_SPAWN, EFFECT_NADE_TRAIL_YELLOW);
+    NADE_PROJECTILE(1, PROJECTILE_NADE_SPAWN, EFFECT_NADE_TRAIL_YELLOW);
 }
 
 REGISTER_NADE(HEAL) {
     this.m_color = '1 0 0';
     this.m_name = _("Heal grenade");
     this.m_icon = "nade_heal";
-    NADE_PROJECTILE(0, PROJECTILE_NADE_HEAL, "nade_red");
-    NADE_PROJECTILE(1, PROJECTILE_NADE_HEAL_BURN, "nade_red_burn");
+    NADE_PROJECTILE(0, PROJECTILE_NADE_HEAL, EFFECT_NADE_TRAIL_RED);
+    NADE_PROJECTILE(1, PROJECTILE_NADE_HEAL_BURN, EFFECT_NADE_TRAIL_BURN_RED);
 }
 
 REGISTER_NADE(MONSTER) {
     this.m_color = '0.25 0.75 0';
     this.m_name = _("Monster grenade");
     this.m_icon = "nade_monster";
-    NADE_PROJECTILE(0, PROJECTILE_NADE_MONSTER, "nade_red");
-    NADE_PROJECTILE(1, PROJECTILE_NADE_MONSTER_BURN, "nade_red_burn");
+    NADE_PROJECTILE(0, PROJECTILE_NADE_MONSTER, EFFECT_NADE_TRAIL_RED);
+    NADE_PROJECTILE(1, PROJECTILE_NADE_MONSTER_BURN, EFFECT_NADE_TRAIL_BURN_RED);
 }
 
 entity Nade_FromProjectile(float proj)
@@ -112,25 +112,25 @@ entity Nade_FromProjectile(float proj)
     return NADE_TYPE_Null;
 }
 
-string Nade_TrailEffect(int proj, float nade_team)
+entity Nade_TrailEffect(int proj, int nade_team)
 {
-    switch (proj)
-    {
-        case PROJECTILE_NADE:       return EFFECT_NADE_TRAIL(nade_team).eent_eff_name;
-        case PROJECTILE_NADE_BURN:  return EFFECT_NADE_TRAIL_BURN(nade_team).eent_eff_name;
-    }
     FOREACH(NADES, true, LAMBDA(
         for (int j = 0; j < 2; j++)
         {
             if (it.m_projectile[j] == proj)
             {
-                string trail = it.m_trail[j];
-                if (trail) return trail;
+                string trail = it.m_trail[j].eent_eff_name;
+                if (trail) return it.m_trail[j];
                 break;
             }
         }
     ));
-    return string_null;
+    switch (proj)
+    {
+        case PROJECTILE_NADE:       return EFFECT_NADE_TRAIL(nade_team);
+        case PROJECTILE_NADE_BURN:  return EFFECT_NADE_TRAIL_BURN(nade_team);
+    }
+    return EFFECT_Null;
 }
 
 #ifdef SVQC
index 8f2f7581a215c4c8cb2264dffecfd9cfe355589f..4a5d5439f4c6985f7e82e7acaaeee4fe150cbe31 100644 (file)
@@ -1112,7 +1112,7 @@ void vehicles_enter(entity pl, entity veh)
        MUTATOR_CALLHOOK(VehicleEnter, pl, veh);
 
        setself(veh);
-       CSQCModel_UnlinkEntity();
+       CSQCModel_UnlinkEntity(veh);
        VEH_ACTION(veh.vehicleid, VR_ENTER);
        setself(this);
 
index d36392e207734c062c41887389909d89f2efaf33..d426a71808d48f62bc3ead87760575c1840b4348 100644 (file)
@@ -835,7 +835,7 @@ float v_bumblebee(float req)
                {
                        entity oldself = self;
 
-                       CSQCModel_UnlinkEntity();
+                       CSQCModel_UnlinkEntity(self);
 
                        // Hide beam
                        if(self.gun3.enemy || !wasfreed(self.gun3.enemy))
@@ -1029,7 +1029,7 @@ void bumble_raygun_draw()
 
        if(self.total_damages < time)
        {
-               boxparticles(self.traileffect, self, self.origin, self.origin + _dir * -64, _dir * -_len , _dir * -_len, 1, PARTICLES_USEALPHA);
+               boxparticles(particleeffectnum(effects_ent[self.traileffect]), self, self.origin, self.origin + _dir * -64, _dir * -_len , _dir * -_len, 1, PARTICLES_USEALPHA);
                boxparticles(self.lip, self, self.move_origin, self.move_origin + _dir * -64, _dir * -200 , _dir * -200, 1, PARTICLES_USEALPHA);
                self.total_damages = time + 0.1;
        }
@@ -1071,7 +1071,7 @@ void bumble_raygun_read(bool bIsNew)
                else
                        self.colormod = '0 1 0';
 
-               self.traileffect = particleeffectnum(EFFECT_BUMBLEBEE_HEAL_MUZZLEFLASH);
+               self.traileffect = EFFECT_BUMBLEBEE_HEAL_MUZZLEFLASH.m_id;
                self.lip = particleeffectnum(EFFECT_BUMBLEBEE_HEAL_IMPACT);
 
                self.draw = bumble_raygun_draw;
index 6e1fffe7a70c3cecd6f49175f8bac3e9d16744fe..ea0a34fd60df78a7d5980f2bd3584f9459d270cf 100644 (file)
@@ -867,7 +867,7 @@ float v_spiderbot(float req)
                        self.frame                              = 10;
                        self.movetype                   = MOVETYPE_TOSS;
 
-                       CSQCModel_UnlinkEntity(); // networking the death scene would be a nightmare
+                       CSQCModel_UnlinkEntity(self); // networking the death scene would be a nightmare
 
                        return true;
                }
index bbd9071f9a39e9e7f1b66f68e18e4747845159ca..ebe0b6e8765558a76de059fb6eed63f385dfebb3 100644 (file)
@@ -135,7 +135,7 @@ void CSQCModel_LinkEntity(entity e)
        CSQCModel_CheckUpdate(e);
 }
 
-void CSQCModel_UnlinkEntity()
-{SELFPARAM();
-       self.SendEntity = func_null;
+void CSQCModel_UnlinkEntity(entity e)
+{
+       e.SendEntity = func_null;
 }
index 6694ded1a633a8dcfa10fc2fdd4e543f5be3d515..713e8c224c66a083a5f527f141eda2c1125851bb 100644 (file)
@@ -28,7 +28,7 @@
 
 void CSQCModel_CheckUpdate(entity e);
 void CSQCModel_LinkEntity(entity e);
-void CSQCModel_UnlinkEntity();
+void CSQCModel_UnlinkEntity(entity e);
 
 #define CSQCMODEL_IF(cond)
 #define CSQCMODEL_ENDIF
index 19a0aa462c688f842043f9a703cc8bfd50862e44..f5e93472d82bb5f57fe05b07d3fd7fdf0385333f 100644 (file)
@@ -772,7 +772,7 @@ float nade_customize()
        {
                //self.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
                if(!self.traileffectnum)
-                       self.traileffectnum = _particleeffectnum(Nade_TrailEffect(NADES[self.nade_type].m_projectile[false], self.team));
+                       self.traileffectnum = _particleeffectnum(Nade_TrailEffect(NADES[self.nade_type].m_projectile[false], self.team).eent_eff_name);
                self.alpha = 1;
        }
 
@@ -816,7 +816,7 @@ void nade_prime()
        //setattachment(n, self, "bip01 l hand");
        n.exteriormodeltoclient = self;
        n.customizeentityforclient = nade_customize;
-       n.traileffectnum = _particleeffectnum(Nade_TrailEffect(NADES[n.nade_type].m_projectile[false], self.team));
+       n.traileffectnum = _particleeffectnum(Nade_TrailEffect(NADES[n.nade_type].m_projectile[false], self.team).eent_eff_name);
        n.colormod = NADES[n.nade_type].m_color;
        n.realowner = self;
        n.colormap = self.colormap;