mirror of
https://github.com/yquake2/rogue.git
synced 2025-04-19 08:41:27 +00:00
Investigated PVS report for g_weapon and addressed its points
This commit is contained in:
parent
d72d5ba9e8
commit
4a429e7e57
1 changed files with 7 additions and 16 deletions
|
@ -347,7 +347,7 @@ blaster_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
|
|||
{
|
||||
int mod;
|
||||
|
||||
if (!self || !other || !plane || !surf)
|
||||
if (!self || !other || !plane)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -387,16 +387,7 @@ blaster_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
|
|||
gi.WriteByte(svc_temp_entity);
|
||||
gi.WriteByte(TE_BLASTER);
|
||||
gi.WritePosition(self->s.origin);
|
||||
|
||||
if (!plane)
|
||||
{
|
||||
gi.WriteDir(vec3_origin);
|
||||
}
|
||||
else
|
||||
{
|
||||
gi.WriteDir(plane->normal);
|
||||
}
|
||||
|
||||
gi.WriteDir(plane->normal);
|
||||
gi.multicast(self->s.origin, MULTICAST_PVS);
|
||||
}
|
||||
|
||||
|
@ -550,7 +541,7 @@ Grenade_Explode(edict_t *ent)
|
|||
void
|
||||
Grenade_Touch(edict_t *ent, edict_t *other, cplane_t *plane /* unused */, csurface_t *surf)
|
||||
{
|
||||
if (!ent || !other || !surf)
|
||||
if (!ent || !other)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -696,7 +687,7 @@ rocket_touch(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
|
|||
vec3_t origin;
|
||||
int n;
|
||||
|
||||
if (!ent || !other || !plane || !surf)
|
||||
if (!ent || !other || !plane)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -789,7 +780,7 @@ fire_rocket(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed,
|
|||
rocket->s.modelindex = gi.modelindex("models/objects/rocket/tris.md2");
|
||||
rocket->owner = self;
|
||||
rocket->touch = rocket_touch;
|
||||
rocket->nextthink = level.time + 8000 / speed;
|
||||
rocket->nextthink = level.time + (8000.0f / (float)speed);
|
||||
rocket->think = G_FreeEdict;
|
||||
rocket->dmg = damage;
|
||||
rocket->radius_dmg = radius_damage;
|
||||
|
@ -947,7 +938,7 @@ bfg_explode(edict_t *self)
|
|||
void
|
||||
bfg_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
|
||||
{
|
||||
if (!self || !other || !plane || !surf)
|
||||
if (!self || !other || !plane)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1127,7 +1118,7 @@ fire_bfg(edict_t *self, vec3_t start, vec3_t dir, int damage,
|
|||
bfg->s.modelindex = gi.modelindex("sprites/s_bfg1.sp2");
|
||||
bfg->owner = self;
|
||||
bfg->touch = bfg_touch;
|
||||
bfg->nextthink = level.time + 8000 / speed;
|
||||
bfg->nextthink = level.time + (8000.0f / (float)speed);
|
||||
bfg->think = G_FreeEdict;
|
||||
bfg->radius_dmg = damage;
|
||||
bfg->dmg_radius = damage_radius;
|
||||
|
|
Loading…
Reference in a new issue