Skip to content

Commit

Permalink
game: change gi.CreatePersistantEffect definition
Browse files Browse the repository at this point in the history
  • Loading branch information
0lvin committed Dec 12, 2024
1 parent d7347b5 commit 23088ba
Show file tree
Hide file tree
Showing 61 changed files with 817 additions and 816 deletions.
2 changes: 1 addition & 1 deletion src/game/character/corvus/corvus3.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void corvus3_teleportsmalleffect (edict_t *self)
void corvus3_teleporteffect (edict_t *self)
{
gi.sound(self,CHAN_WEAPON,gi.soundindex("weapons/teleport.wav"),1,ATTN_NORM,0);
gi.CreateEffect(&self->s, FX_PLAYER_TELEPORT_IN, CEF_OWNERS_ORIGIN, self->s.origin, NULL);
gi.CreateEffect(self, FX_PLAYER_TELEPORT_IN, CEF_OWNERS_ORIGIN, self->s.origin, NULL);
}

/*-------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/game/character/elflord/elflord.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ float mist_yaw;

void Elflord_c_gib(edict_t *self, G_Message_t *msg)
{
gi.CreateEffect(&self->s, FX_WEAPON_SPHEREEXPLODE, CEF_OWNERS_ORIGIN , NULL,
gi.CreateEffect(self, FX_WEAPON_SPHEREEXPLODE, CEF_OWNERS_ORIGIN , NULL,
"db", self->movedir, (byte)(AVG_VEC3T(self->s.scale) * 7.5));

gi.sound(self,CHAN_WEAPON,gi.soundindex("weapons/SphereImpact.wav"),2,ATTN_NORM,0);
Expand Down
4 changes: 2 additions & 2 deletions src/game/g_combat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ void T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t pdir,
if (!was_dead)
targ->s.effects &= ~EF_DISABLE_EXTRA_FX; // The flag causes the fire to stop generating.
targ->s.effects |= EF_ON_FIRE;
gi.CreateEffect(&targ->s, FX_FIRE_ON_ENTITY, CEF_OWNERS_ORIGIN, NULL, "bbb", (int)scale, 255, 1);//we'll turn this off manually
gi.CreateEffect(targ, FX_FIRE_ON_ENTITY, CEF_OWNERS_ORIGIN, NULL, "bbb", (int)scale, 255, 1);//we'll turn this off manually
}
else
targ->fire_damage_time += duration;
Expand Down Expand Up @@ -1160,7 +1160,7 @@ void T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t pdir,
if (!was_dead)
targ->s.effects &= ~EF_DISABLE_EXTRA_FX; // The flag causes the fire to stop generating.
targ->s.effects |= EF_ON_FIRE; // The flag causes the fire to stop generating.
gi.CreateEffect(&targ->s, FX_FIRE_ON_ENTITY, CEF_OWNERS_ORIGIN, NULL, "bbb", (int)scale, 40, 0);
gi.CreateEffect(targ, FX_FIRE_ON_ENTITY, CEF_OWNERS_ORIGIN, NULL, "bbb", (int)scale, 40, 0);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/game/g_env.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void smoke_use (edict_t *self, edict_t *other, edict_t *activator)
wait = Q_ftol(self->wait);
maxrange = Q_ftol(self->attenuation);

self->PersistantCFX = gi.CreatePersistantEffect(&self->s,
self->PersistantCFX = gi.CreatePersistantEffect(self,
FX_ENVSMOKE,
CEF_BROADCAST,self->s.origin,
"bdbbb",scale,dir,speed,wait,maxrange);
Expand All @@ -98,7 +98,7 @@ void smoke_use (edict_t *self, edict_t *other, edict_t *activator)
gi.RemovePersistantEffect(self->PersistantCFX, REMOVE_SMOKE);
self->PersistantCFX = 0;
}
gi.RemoveEffects(&self->s, FX_ENVSMOKE);
gi.RemoveEffects(self, FX_ENVSMOKE);
self->spawnflags |= START_OFF;
}
}
Expand Down Expand Up @@ -165,7 +165,7 @@ void SP_env_smoke (edict_t *self)
else
{
AngleVectors(self->s.angles, dir, NULL, NULL);
self->PersistantCFX = gi.CreatePersistantEffect(&self->s,
self->PersistantCFX = gi.CreatePersistantEffect(self,
FX_ENVSMOKE,
CEF_BROADCAST,self->s.origin,
"bdbbb",scale,dir,speed,wait,maxrange);
Expand Down
18 changes: 9 additions & 9 deletions src/game/g_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ DoRespawn(edict_t *ent)

// Create a respawn client-effect (this isn't currenlty doing anything on the client).

//gi.CreateEffect(&ent->s,FX_ITEM_RESPAWN,CEF_OWNERS_ORIGIN,ent->s.origin,NULL);
//gi.CreateEffect(ent,FX_ITEM_RESPAWN,CEF_OWNERS_ORIGIN,ent->s.origin,NULL);

// So it'll get sent to the client again.

Expand Down Expand Up @@ -722,7 +722,7 @@ Pickup_Health(edict_t *ent, edict_t *other)
if(other->fire_damage_time<=0)
{
other->fire_damage_time = 0;
// gi.RemoveEffects(&other->s, FX_FIRE_ON_ENTITY);//turn off CFX too
// gi.RemoveEffects(other, FX_FIRE_ON_ENTITY);//turn off CFX too
other->s.effects |= EF_MARCUS_FLAG1; // Notify the effect to turn itself off.
}
}
Expand Down Expand Up @@ -822,7 +822,7 @@ Touch_Item(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)

// Once picked up, the item is gone forever, so remove it's client effect(s).

gi.RemoveEffects(&ent->s,0);
gi.RemoveEffects(ent,0);

// The persistent part is removed from the server here.

Expand Down Expand Up @@ -1139,26 +1139,26 @@ SpawnItemEffect(edict_t *ent, gitem_t *item)

if(ent->item->flags & IT_PUZZLE)
{
ent->PersistantCFX = gi.CreatePersistantEffect(&ent->s, FX_PICKUP_PUZZLE, CEF_BROADCAST, ent->s.origin, "bv", ent->item->tag,ent->s.angles);
ent->PersistantCFX = gi.CreatePersistantEffect(ent, FX_PICKUP_PUZZLE, CEF_BROADCAST, ent->s.origin, "bv", ent->item->tag,ent->s.angles);
}
else if(ent->item->flags & IT_WEAPON)
{
ent->PersistantCFX = gi.CreatePersistantEffect(&ent->s, FX_PICKUP_WEAPON, CEF_BROADCAST, ent->s.origin, "b", ent->item->tag);
ent->PersistantCFX = gi.CreatePersistantEffect(ent, FX_PICKUP_WEAPON, CEF_BROADCAST, ent->s.origin, "b", ent->item->tag);
}
else if(ent->item->flags & IT_AMMO)
{
ent->PersistantCFX = gi.CreatePersistantEffect(&ent->s, FX_PICKUP_AMMO, CEF_BROADCAST, ent->s.origin, "b", ent->item->tag);
ent->PersistantCFX = gi.CreatePersistantEffect(ent, FX_PICKUP_AMMO, CEF_BROADCAST, ent->s.origin, "b", ent->item->tag);
}
else if(ent->item->flags & IT_DEFENSE)
{
ent->PersistantCFX = gi.CreatePersistantEffect(&ent->s, FX_PICKUP_DEFENSE, CEF_BROADCAST, ent->s.origin, "b", ent->item->tag);
ent->PersistantCFX = gi.CreatePersistantEffect(ent, FX_PICKUP_DEFENSE, CEF_BROADCAST, ent->s.origin, "b", ent->item->tag);
}
else
{
if (ent->item->tag)
ent->PersistantCFX = gi.CreatePersistantEffect(&ent->s, FX_PICKUP_HEALTH, CEF_FLAG6|CEF_BROADCAST, ent->s.origin, "");
ent->PersistantCFX = gi.CreatePersistantEffect(ent, FX_PICKUP_HEALTH, CEF_FLAG6|CEF_BROADCAST, ent->s.origin, "");
else
ent->PersistantCFX = gi.CreatePersistantEffect(&ent->s, FX_PICKUP_HEALTH, CEF_BROADCAST, ent->s.origin, "");
ent->PersistantCFX = gi.CreatePersistantEffect(ent, FX_PICKUP_HEALTH, CEF_BROADCAST, ent->s.origin, "");
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/game/g_light.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void SpawnFlame(edict_t *self,vec3_t origin)
scale = AVG_VEC3T(self->s.scale) * 32;
}

self->PersistantCFX = gi.CreatePersistantEffect(&self->s,
self->PersistantCFX = gi.CreatePersistantEffect(self,
FX_FIRE,
CEF_BROADCAST,
origin,
Expand Down Expand Up @@ -209,7 +209,7 @@ void fire_use (edict_t *self, edict_t *other, edict_t *activator)
scale = AVG_VEC3T(self->s.scale) * 32;
}

self->PersistantCFX = gi.CreatePersistantEffect(&self->s,
self->PersistantCFX = gi.CreatePersistantEffect(self,
FX_FIRE,
CEF_BROADCAST,
self->s.origin,
Expand Down Expand Up @@ -237,7 +237,7 @@ void fire_use (edict_t *self, edict_t *other, edict_t *activator)
self->PersistantCFX = 0;
}
self->s.sound = 0;
gi.RemoveEffects(&self->s, FX_FIRE);
gi.RemoveEffects(self, FX_FIRE);
self->spawnflags |= FIRE_OFF;
G_FreeEdict(self->enemy);

Expand All @@ -251,7 +251,7 @@ void firemove_think(edict_t *self)

scale = AVG_VEC3T(self->s.scale) * 8;

self->PersistantCFX = gi.CreatePersistantEffect(&self->s,
self->PersistantCFX = gi.CreatePersistantEffect(self,
FX_FIRE_ON_ENTITY,
CEF_BROADCAST | CEF_OWNERS_ORIGIN,
self->s.origin,
Expand Down Expand Up @@ -368,7 +368,7 @@ SP_env_fire(edict_t *self)
if (self->spawnflags & 32)
flags |= CEF_FLAG6;

self->PersistantCFX = gi.CreatePersistantEffect(&self->s,
self->PersistantCFX = gi.CreatePersistantEffect(self,
FX_FIRE,
flags,
self->s.origin,
Expand Down
4 changes: 2 additions & 2 deletions src/game/g_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ void CheckContinuousAutomaticEffects(edict_t *self)
{//FIXME: make hiss and smoke too
gi.dprintf("%s fire doused\n", self->classname);
self->fire_damage_time = 0;
// gi.RemoveEffects(&self->s, FX_FIRE_ON_ENTITY);//turn off CFX too
// gi.RemoveEffects(self, FX_FIRE_ON_ENTITY);//turn off CFX too
self->s.effects &= ~EF_ON_FIRE; // Use this to instead notify the fire to stop.
gi.CreateEffect(NULL,
FX_ENVSMOKE,
Expand Down Expand Up @@ -726,7 +726,7 @@ void CheckContinuousAutomaticEffects(edict_t *self)
else if(self->fire_damage_time>0)
{
self->fire_damage_time = 0;
// gi.RemoveEffects(&self->s, FX_FIRE_ON_ENTITY);//turn off CFX too
// gi.RemoveEffects(self, FX_FIRE_ON_ENTITY);//turn off CFX too
self->s.effects &= ~EF_ON_FIRE; // Use this to instead notify the fire to stop.
return;
}
Expand Down
20 changes: 10 additions & 10 deletions src/game/g_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ ThrowGib(edict_t *self, const char *gibname, int damage, int type)
gi.setmodel(gib, gibname);
gib->solid = SOLID_NOT;

gi.CreateEffect(&gib->s,FX_GIB_TRAIL,CEF_OWNERS_ORIGIN,gib->s.origin,NULL);
gi.CreateEffect(gib, FX_GIB_TRAIL, CEF_OWNERS_ORIGIN, gib->s.origin, NULL);

gib->flags |= FL_NO_KNOCKBACK;
gib->takedamage = DAMAGE_YES;
Expand Down Expand Up @@ -1400,7 +1400,7 @@ void Teleporter_Deactivate(edict_t *self, G_Message_t *msg)
// if there's an effect out there, kill it
if (self->enemy)
{
gi.RemoveEffects(&self->enemy->s, FX_TELEPORT_PAD);
gi.RemoveEffects(self->enemy, FX_TELEPORT_PAD);
if (self->enemy->PersistantCFX)
{
gi.RemovePersistantEffect(self->enemy->PersistantCFX, REMOVE_TELEPORT_PAD);
Expand Down Expand Up @@ -1433,7 +1433,7 @@ void Teleporter_Activate(edict_t *self, G_Message_t *msg)
real_origin[2] = ((self->maxs[2] - self->mins[2]) / 2.0) + self->mins[2];

if (!(self->spawnflags & 1))
effect->PersistantCFX = gi.CreatePersistantEffect(&effect->s, FX_TELEPORT_PAD, CEF_BROADCAST, real_origin, "");
effect->PersistantCFX = gi.CreatePersistantEffect(effect, FX_TELEPORT_PAD, CEF_BROADCAST, real_origin, "");
}
}

Expand Down Expand Up @@ -1499,7 +1499,7 @@ void SP_misc_teleporter (edict_t *ent)
real_origin[2] = ((ent->maxs[2] - ent->mins[2]) / 2.0) + ent->mins[2];

if (!(ent->spawnflags & 1))
effect->PersistantCFX = gi.CreatePersistantEffect(&effect->s, FX_TELEPORT_PAD, CEF_BROADCAST, real_origin, "");
effect->PersistantCFX = gi.CreatePersistantEffect(effect, FX_TELEPORT_PAD, CEF_BROADCAST, real_origin, "");
}

}
Expand Down Expand Up @@ -1569,7 +1569,7 @@ void misc_magic_portal_use (edict_t *self, edict_t *other, edict_t *activator)
// We aren't engaged yet. Make solid and start the effect.
self->solid = SOLID_TRIGGER;
self->touch = misc_magic_portal_touch;
self->PersistantCFX = gi.CreatePersistantEffect(&self->s, FX_MAGIC_PORTAL, CEF_BROADCAST, self->s.origin,
self->PersistantCFX = gi.CreatePersistantEffect(self, FX_MAGIC_PORTAL, CEF_BROADCAST, self->s.origin,
"vbb", self->s.angles, (byte)style, (byte)count);
self->s.effects &= ~EF_DISABLE_EXTRA_FX;
}
Expand Down Expand Up @@ -1732,7 +1732,7 @@ void soundambient_think(edict_t *self)
default:
style = Q_ftol(self->style);
wait = Q_ftol(self->wait);
gi.CreatePersistantEffect(&self->s,
gi.CreatePersistantEffect(self,
FX_SOUND,
CEF_BROADCAST | CEF_OWNERS_ORIGIN,
self->s.origin,
Expand All @@ -1751,7 +1751,7 @@ void sound_ambient_use (edict_t *self, edict_t *other, edict_t *activator)
if (self->count) // This is just a flag to show it's on
{
self->count = 0;
gi.RemoveEffects(&self->s,0);
gi.RemoveEffects(self,0);
}
else
soundambient_think(self);
Expand Down Expand Up @@ -2456,7 +2456,7 @@ void SpawnClientAnim(edict_t *self, byte type, char *sound)
skin = (byte)self->s.skinnum;

// self->svflags |= SVF_ALWAYS_SEND;
self->PersistantCFX = gi.CreatePersistantEffect(&self->s,
self->PersistantCFX = gi.CreatePersistantEffect(self,
FX_ANIMATE,
CEF_BROADCAST,
self->s.origin,
Expand Down Expand Up @@ -2545,13 +2545,13 @@ void fire_spark_think (edict_t *self)
void fire_spark_gone (edict_t *self, edict_t *other, edict_t *activator)
{
self->use = NULL;
gi.RemoveEffects(&self->s, FX_SPARKS);
gi.RemoveEffects(self, FX_SPARKS);
G_FreeEdict(self);
}

void fire_spark_use (edict_t *self, edict_t *other, edict_t *activator)
{
gi.CreateEffect(&self->s, FX_SPARKS, CEF_FLAG6|CEF_FLAG7|CEF_FLAG8, self->s.origin, "d", vec3_up);
gi.CreateEffect(self, FX_SPARKS, CEF_FLAG6|CEF_FLAG7|CEF_FLAG8, self->s.origin, "d", vec3_up);

self->use = fire_spark_gone;

Expand Down
2 changes: 1 addition & 1 deletion src/game/g_monster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1715,7 +1715,7 @@ void M_EndDeath( edict_t *self)
self->think = NULL;
self->nextthink = -1;//stop thinkin'

gi.RemoveEffects(&self->s, 0);
gi.RemoveEffects(self, 0);
}
self->s.effects |= EF_DISABLE_EXTRA_FX;

Expand Down
2 changes: 1 addition & 1 deletion src/game/g_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -3565,7 +3565,7 @@ void SP_obj_shrine (edict_t *self)
// make the ball appear in the middle
VectorScale(self->s.angles, ANGLE_TO_RAD, offset);
DirFromAngles(offset, offset2);
self->PersistantCFX = gi.CreatePersistantEffect(&self->s, FX_SHRINE_BALL, CEF_BROADCAST, self->s.origin,
self->PersistantCFX = gi.CreatePersistantEffect(self, FX_SHRINE_BALL, CEF_BROADCAST, self->s.origin,
"db", offset2, (byte)(self->style-1));

}
Expand Down
10 changes: 5 additions & 5 deletions src/game/g_rope.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ void rope_think(edict_t *self)
//Create the new rope that's attached to the player
self->rope_grab->s.effects |= EF_ALTCLIENTFX;

gi.CreateEffect(&self->enemy->s,
gi.CreateEffect(self->enemy,
FX_ROPE, CEF_BROADCAST | CEF_OWNERS_ORIGIN | CEF_FLAG6,
rope_top,
"ssbvvv",
Expand Down Expand Up @@ -530,11 +530,11 @@ void hanging_chicken_pain(edict_t *self, edict_t *other, float kick, int damage)

if (damage < 100)
{
gi.CreateEffect(&self->s, FX_CHICKEN_EXPLODE, CEF_OWNERS_ORIGIN|CEF_FLAG6, NULL, "" );
gi.CreateEffect(self, FX_CHICKEN_EXPLODE, CEF_OWNERS_ORIGIN|CEF_FLAG6, NULL, "" );
}
else
{
gi.CreateEffect(&self->s, FX_CHICKEN_EXPLODE, CEF_OWNERS_ORIGIN, NULL, "" );
gi.CreateEffect(self, FX_CHICKEN_EXPLODE, CEF_OWNERS_ORIGIN, NULL, "" );
}

if (irand(0,1))
Expand Down Expand Up @@ -748,7 +748,7 @@ void spawn_hanging_chicken(edict_t *self)
VectorCopy(self->s.origin, rope_end);
rope_end[2] += self->mins[2];

gi.CreatePersistantEffect(&self->s, FX_ROPE, CEF_BROADCAST, self->s.origin, "ssbvvv", end_id, end_id, model_type, end_ent->s.origin, end_ent->s.origin, end_ent->s.origin );
gi.CreatePersistantEffect(self, FX_ROPE, CEF_BROADCAST, self->s.origin, "ssbvvv", end_id, end_id, model_type, end_ent->s.origin, end_ent->s.origin, end_ent->s.origin );

self->think = rope_end_think2;
self->nextthink = level.time + 0.1;
Expand Down Expand Up @@ -889,7 +889,7 @@ void SP_obj_rope(edict_t *self)

rope_sway(self);

gi.CreatePersistantEffect(&self->s, FX_ROPE, CEF_BROADCAST, self->s.origin, "ssbvvv", grab_id, end_id, model_type, self->s.origin, grab_ent->s.origin, end_ent->s.origin );
gi.CreatePersistantEffect(self, FX_ROPE, CEF_BROADCAST, self->s.origin, "ssbvvv", grab_id, end_id, model_type, self->s.origin, grab_ent->s.origin, end_ent->s.origin );

self->think = rope_sway;
self->nextthink = level.time + 1;
Expand Down
Loading

0 comments on commit 23088ba

Please sign in to comment.