if(Nade_IDFromProjectile(self.cnt) != 0)
{
+ float nade_type = Nade_IDFromProjectile(self.cnt);
self.mins = '-16 -16 -16';
self.maxs = '16 16 16';
- self.colormod = Nade_Color(Nade_IDFromProjectile(self.cnt));
- self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
+ self.colormod = Nade_Color(nade_type);
self.move_movetype = MOVETYPE_BOUNCE;
self.move_touch = func_null;
self.scale = 1.5;
self.avelocity = randomvec() * 720;
-
- if(Nade_IDFromProjectile(self.cnt) == NADE_TYPE_TRANSLOCATE)
- self.solid = SOLID_TRIGGER;
+
+ if(nade_type == NADE_TYPE_TRANSLOCATE || nade_type == NADE_TYPE_SPAWN)
+ self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
+ else
+ self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY;
}
setsize(self, self.mins, self.maxs);
sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM);
sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+ self.event_damage = func_null; // prevent somehow calling damage in the next call
+
if(nade_blast)
{
RadiusDamage(self, self.realowner, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage,
Damage_DamageInfo(self.origin, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage, autocvar_g_nades_nade_radius, '1 1 1' * autocvar_g_nades_nade_force, self.projectiledeathtype, 0, self);
}
- if(self.health != -1337)
+ if(self.takedamage)
switch ( self.nade_type )
{
case NADE_TYPE_NAPALM: nade_napalm_boom(); break;
void nade_touch()
{
- if(ITEM_TOUCH_NEEDKILL())
+ float is_weapclip = 0;
+ if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW)
+ if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID))
+ if (!(trace_dphitcontents & DPCONTENTS_OPAQUE))
+ is_weapclip = 1;
+ if(ITEM_TOUCH_NEEDKILL() || is_weapclip)
{
remove(self);
return;
{
if(ITEM_DAMAGE_NEEDKILL(deathtype))
{
- self.health = -1337; // hack
+ self.takedamage = DAMAGE_NO;
nade_boom();
return;
}
return;
if(DEATH_ISWEAPON(deathtype, WEP_BLASTER) || (DEATH_ISWEAPON(deathtype, WEP_VAPORIZER) && (deathtype & HITTYPE_SECONDARY)))
- return;
+ {
+ force *= 1.5;
+ damage = 0;
+ }
if(DEATH_ISWEAPON(deathtype, WEP_VORTEX) || DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
{
damage = self.max_health * 1.15;
self.velocity += force;
+ UpdateCSQCProjectile(self);
if(damage <= 0 || ((self.flags & FL_ONGROUND) && IS_PLAYER(attacker)))
return;
_nade.event_damage = nade_damage;
_nade.customizeentityforclient = func_null;
_nade.exteriormodeltoclient = world;
- _nade.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
_nade.traileffectnum = 0;
_nade.teleportable = TRUE;
_nade.pushable = TRUE;
_nade.toss_time = time;
_nade.solid = SOLID_CORPSE; //((_nade.nade_type == NADE_TYPE_TRANSLOCATE) ? SOLID_CORPSE : SOLID_BBOX);
+ if(_nade.nade_type == NADE_TYPE_TRANSLOCATE || _nade.nade_type == NADE_TYPE_SPAWN)
+ _nade.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
+ else
+ _nade.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY;
+
nade_spawn(_nade);
if(_time)