From 23088ba039964995fab70bd8ec413c00067d4365 Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Thu, 12 Dec 2024 23:37:40 +0200 Subject: [PATCH] game: change gi.CreatePersistantEffect definition --- src/game/character/corvus/corvus3.c | 2 +- src/game/character/elflord/elflord.c | 2 +- src/game/g_combat.c | 4 +- src/game/g_env.c | 6 +- src/game/g_items.c | 18 +- src/game/g_light.c | 10 +- src/game/g_main.c | 4 +- src/game/g_misc.c | 20 +- src/game/g_monster.c | 2 +- src/game/g_obj.c | 2 +- src/game/g_rope.c | 10 +- src/game/g_shrine.c | 58 ++-- src/game/g_trigger.c | 4 +- src/game/g_waterfx.c | 16 +- src/game/game_utilities.c | 20 +- src/game/header/game.h | 10 +- src/game/mg_guide.c | 4 +- src/game/monster/assassin/assassin.c | 140 ++++---- src/game/monster/beast/beast.c | 12 +- src/game/monster/chicken/chicken.c | 6 +- src/game/monster/elflord/elflord.c | 28 +- src/game/monster/fish/fish.c | 6 +- src/game/monster/gkrokon/gkrokon.c | 6 +- src/game/monster/gorgon/gorgon.c | 6 +- src/game/monster/harpy/harpy.c | 4 +- src/game/monster/imp/imp.c | 12 +- src/game/monster/morcalavin/morcalavin.c | 28 +- src/game/monster/mssithra/mssithra.c | 40 +-- src/game/monster/plagueelf/plagueelf.c | 8 +- .../monster/plaguessithra/plaguessithra.c | 226 ++++++------ src/game/monster/priestess/priestess.c | 20 +- src/game/monster/seraph/seraph_guard.c | 6 +- src/game/monster/spreader/spreader.c | 6 +- src/game/monster/spreader/spreadermist.c | 4 +- src/game/monster/tcheckrik/tcheckrik.c | 12 +- src/game/monster/tcheckrik/tcheckrik_spells.c | 26 +- src/game/player/client.c | 34 +- src/game/player/funcs.c | 2 +- src/game/player/library/p_actions.c | 10 +- src/game/player/library/p_animactor.c | 12 +- src/game/player/library/p_chicken.c | 4 +- src/game/player/library/p_ctrl.c | 2 +- src/game/player/library/p_main.c | 20 +- src/game/player/library/p_types.h | 6 +- src/game/player/weapon.c | 128 +++---- src/game/spell/bluering.c | 10 +- src/game/spell/flyingfist.c | 6 +- src/game/spell/hellstaff.c | 8 +- src/game/spell/magicmissile.c | 66 ++-- src/game/spell/meteorbarrier.c | 38 +- src/game/spell/morph.c | 24 +- src/game/spell/phoenix.c | 12 +- src/game/spell/powerup.c | 23 +- src/game/spell/redrain.c | 42 +-- src/game/spell/ripper.c | 2 +- src/game/spell/shield.c | 4 +- src/game/spell/sphereofannihlation.c | 324 +++++++++--------- src/game/spell/teleport.c | 6 +- src/game/spell/tornado.c | 12 +- src/game/spell/wall.c | 12 +- src/server/sv_game.c | 38 +- 61 files changed, 817 insertions(+), 816 deletions(-) diff --git a/src/game/character/corvus/corvus3.c b/src/game/character/corvus/corvus3.c index b37287925..844a24d56 100644 --- a/src/game/character/corvus/corvus3.c +++ b/src/game/character/corvus/corvus3.c @@ -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); } /*------------------------------------------------------------------------- diff --git a/src/game/character/elflord/elflord.c b/src/game/character/elflord/elflord.c index f2d4dad24..18ec08c25 100644 --- a/src/game/character/elflord/elflord.c +++ b/src/game/character/elflord/elflord.c @@ -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); diff --git a/src/game/g_combat.c b/src/game/g_combat.c index b0e72041f..6b03a206a 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -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; @@ -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); } } diff --git a/src/game/g_env.c b/src/game/g_env.c index cef50ffab..873db24fa 100644 --- a/src/game/g_env.c +++ b/src/game/g_env.c @@ -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); @@ -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; } } @@ -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); diff --git a/src/game/g_items.c b/src/game/g_items.c index 54eee47d3..bb813abcb 100644 --- a/src/game/g_items.c +++ b/src/game/g_items.c @@ -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. @@ -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. } } @@ -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. @@ -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, ""); } } diff --git a/src/game/g_light.c b/src/game/g_light.c index c00ed50fc..388219779 100644 --- a/src/game/g_light.c +++ b/src/game/g_light.c @@ -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, @@ -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, @@ -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); @@ -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, @@ -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, diff --git a/src/game/g_main.c b/src/game/g_main.c index 43888241c..d2b46faad 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -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, @@ -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; } diff --git a/src/game/g_misc.c b/src/game/g_misc.c index c2db1bb3a..aaac089ff 100644 --- a/src/game/g_misc.c +++ b/src/game/g_misc.c @@ -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; @@ -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); @@ -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, ""); } } @@ -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, ""); } } @@ -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; } @@ -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, @@ -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); @@ -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, @@ -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; diff --git a/src/game/g_monster.c b/src/game/g_monster.c index bd629ba2f..80c0c59cd 100644 --- a/src/game/g_monster.c +++ b/src/game/g_monster.c @@ -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; diff --git a/src/game/g_obj.c b/src/game/g_obj.c index 519cfd04f..74bdd9690 100644 --- a/src/game/g_obj.c +++ b/src/game/g_obj.c @@ -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)); } diff --git a/src/game/g_rope.c b/src/game/g_rope.c index aab6cfd0d..7a4bae68f 100644 --- a/src/game/g_rope.c +++ b/src/game/g_rope.c @@ -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", @@ -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)) @@ -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; @@ -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; diff --git a/src/game/g_shrine.c b/src/game/g_shrine.c index 7097ef471..f383bbd81 100644 --- a/src/game/g_shrine.c +++ b/src/game/g_shrine.c @@ -102,11 +102,11 @@ void PlayerKillShrineFX(edict_t *self) // turn off the run shrine should we need to self->s.effects &= ~EF_SPEED_ACTIVE; - gi.RemoveEffects(&self->s, FX_FOOT_TRAIL); + gi.RemoveEffects(self, FX_FOOT_TRAIL); // Kill any lights that may already be out there for this player. - gi.RemoveEffects(&self->s, FX_PLAYER_TORCH); + gi.RemoveEffects(self, FX_PLAYER_TORCH); // Kill lungs. @@ -134,7 +134,7 @@ void PlayerKillShrineFX(edict_t *self) // Kill any tomes that may already be out there for this player. - gi.RemoveEffects(&self->s, FX_TOME_OF_POWER); + gi.RemoveEffects(self, FX_TOME_OF_POWER); // Turn off the tome at the client effect end through client flags that are passed down. @@ -156,11 +156,11 @@ void PlayerRestartShrineFX(edict_t *self) { // Kill any lights that may already be out there for this player. - gi.RemoveEffects(&self->s, FX_PLAYER_TORCH); + gi.RemoveEffects(self, FX_PLAYER_TORCH); // Create the light and the tome of power. - gi.CreateEffect(&self->s, FX_PLAYER_TORCH, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(self, FX_PLAYER_TORCH, CEF_OWNERS_ORIGIN, NULL, ""); } // If we have a powerup, turn it on. @@ -169,11 +169,11 @@ void PlayerRestartShrineFX(edict_t *self) { // Kill any lights that may already be out there for this player. - gi.RemoveEffects(&self->s, FX_TOME_OF_POWER); + gi.RemoveEffects(self, FX_TOME_OF_POWER); // Create the light and the tome of power. - gi.CreateEffect(&self->s, FX_TOME_OF_POWER, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(self, FX_TOME_OF_POWER, CEF_OWNERS_ORIGIN, NULL, ""); } // If we have a powerup, turn it on. @@ -182,11 +182,11 @@ void PlayerRestartShrineFX(edict_t *self) { // Kill any lights that may already be out there for this player. - gi.RemoveEffects(&self->s, FX_FOOT_TRAIL); + gi.RemoveEffects(self, FX_FOOT_TRAIL); // Create the light and the tome of power. - gi.CreateEffect(&self->s, FX_FOOT_TRAIL, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(self, FX_FOOT_TRAIL, CEF_OWNERS_ORIGIN, NULL, ""); } } @@ -369,7 +369,7 @@ void DelayThink(edict_t *self) VectorScale(dest->s.angles, ANGLE_TO_RAD, offset); DirFromAngles(offset, offset2); - dest->PersistantCFX=gi.CreatePersistantEffect(&dest->s, + dest->PersistantCFX=gi.CreatePersistantEffect(dest, FX_SHRINE_BALL, CEF_BROADCAST, dest->s.origin, @@ -455,7 +455,7 @@ void deal_with_shrine_node(edict_t *self) // But kill the shrine ball thats out there for this shrine. - gi.RemoveEffects(&dest->s, FX_SHRINE_BALL); + gi.RemoveEffects(dest, FX_SHRINE_BALL); // Kill the glowing ball in the middle. if (dest->PersistantCFX) @@ -467,7 +467,7 @@ void deal_with_shrine_node(edict_t *self) // Make the shrine ball explode. VectorScale(dest->s.angles, ANGLE_TO_RAD, offset); DirFromAngles(offset, offset2); - gi.CreateEffect(&dest->s,FX_SHRINE_BALL_EXPLODE,CEF_OWNERS_ORIGIN,dest->s.origin,"db",offset2,(byte)(dest->style-1)); + gi.CreateEffect(dest,FX_SHRINE_BALL_EXPLODE,CEF_OWNERS_ORIGIN,dest->s.origin,"db",offset2,(byte)(dest->style-1)); } void shrine_restore_player(edict_t *other) @@ -505,7 +505,7 @@ void player_shrine_health_effect(edict_t *self) { // Start up the shrine heal effect. - gi.CreateEffect(&self->s, FX_SHRINE_HEALTH, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(self, FX_SHRINE_HEALTH, CEF_OWNERS_ORIGIN, NULL, ""); // Do the SHRINE sound. @@ -613,7 +613,7 @@ void player_shrine_armor_silver_effect(edict_t *self) { // Start up the shrine armor effect. - gi.CreateEffect(&self->s, FX_SHRINE_ARMOR, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(self, FX_SHRINE_ARMOR, CEF_OWNERS_ORIGIN, NULL, ""); // Do the SHRINE sound. @@ -728,7 +728,7 @@ void player_shrine_armor_gold_effect(edict_t *self) { // Start up the shrine armor effect. - gi.CreateEffect(&self->s, FX_SHRINE_ARMOR, CEF_OWNERS_ORIGIN|CEF_FLAG6, NULL, ""); + gi.CreateEffect(self, FX_SHRINE_ARMOR, CEF_OWNERS_ORIGIN|CEF_FLAG6, NULL, ""); // Do the SHRINE sound. @@ -846,7 +846,7 @@ void player_shrine_staff_effect(edict_t *self) else gi.sound(self,CHAN_ITEM,gi.soundindex("items/shrine7.wav"),1,ATTN_NORM,0); - gi.CreateEffect(&self->s, FX_SHRINE_STAFF, flags, NULL, ""); + gi.CreateEffect(self, FX_SHRINE_STAFF, flags, NULL, ""); // Do the SHRINE sound. @@ -953,7 +953,7 @@ void player_shrine_lungs_effect(edict_t *self) { // Start up the shrine lung effect. - gi.CreateEffect(&self->s, FX_SHRINE_LUNGS, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(self, FX_SHRINE_LUNGS, CEF_OWNERS_ORIGIN, NULL, ""); // Do the SHRINE sound. @@ -1056,15 +1056,15 @@ void player_shrine_light_effect(edict_t *self) // Kill any lights that may already be out there for this player. - gi.RemoveEffects(&self->s, FX_PLAYER_TORCH); + gi.RemoveEffects(self, FX_PLAYER_TORCH); // Create the light and the tome of power. - gi.CreateEffect(&self->s, FX_PLAYER_TORCH, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(self, FX_PLAYER_TORCH, CEF_OWNERS_ORIGIN, NULL, ""); // Start up the shrine light effect. - gi.CreateEffect(&self->s, FX_SHRINE_LIGHT, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(self, FX_SHRINE_LIGHT, CEF_OWNERS_ORIGIN, NULL, ""); // Do the SHRINE sound. @@ -1171,7 +1171,7 @@ void player_shrine_mana_effect(edict_t *self) { // Start up the shrine mana effect. - gi.CreateEffect(&self->s, FX_SHRINE_MANA, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(self, FX_SHRINE_MANA, CEF_OWNERS_ORIGIN, NULL, ""); // Do the SHRINE sound. @@ -1276,7 +1276,7 @@ void player_shrine_ghost_effect(edict_t *self) // Start up the shrine ghost effect. - gi.CreateEffect(&self->s, FX_SHRINE_GHOST, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(self, FX_SHRINE_GHOST, CEF_OWNERS_ORIGIN, NULL, ""); // Do the SHRINE sound. @@ -1386,7 +1386,7 @@ void player_shrine_reflect_effect(edict_t *self) // Start up the shrine staff effect. - gi.CreateEffect(&self->s, FX_SHRINE_REFLECT, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(self, FX_SHRINE_REFLECT, CEF_OWNERS_ORIGIN, NULL, ""); // Do the SHRINE sound. @@ -1499,15 +1499,15 @@ void player_shrine_powerup_effect(edict_t *self) // Kill any tomes that may already be out there for this player. - gi.RemoveEffects(&self->s, FX_TOME_OF_POWER); + gi.RemoveEffects(self, FX_TOME_OF_POWER); // Create the tome of power. - gi.CreateEffect(&self->s, FX_TOME_OF_POWER, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(self, FX_TOME_OF_POWER, CEF_OWNERS_ORIGIN, NULL, ""); // Start up the shrine powerup effect. - gi.CreateEffect(&self->s, FX_SHRINE_POWERUP, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(self, FX_SHRINE_POWERUP, CEF_OWNERS_ORIGIN, NULL, ""); // Do the SHRINE sound. @@ -1615,7 +1615,7 @@ void player_shrine_speed_effect(edict_t *self) // Start up the shrine powerup effect. - gi.CreateEffect(&self->s, FX_SHRINE_SPEED, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(self, FX_SHRINE_SPEED, CEF_OWNERS_ORIGIN, NULL, ""); // Do the SHRINE sound. @@ -1645,11 +1645,11 @@ void shrine_speed_core (edict_t *self, edict_t *other) // Kill any tomes that may already be out there for this player. - gi.RemoveEffects(&other->s, FX_FOOT_TRAIL); + gi.RemoveEffects(other, FX_FOOT_TRAIL); // Create the tome of power. - gi.CreateEffect(&other->s, FX_FOOT_TRAIL, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(other, FX_FOOT_TRAIL, CEF_OWNERS_ORIGIN, NULL, ""); // restore dismemberment, and stop us being on fire shrine_restore_player(other); diff --git a/src/game/g_trigger.c b/src/game/g_trigger.c index 6d678a0ff..eef448cde 100644 --- a/src/game/g_trigger.c +++ b/src/game/g_trigger.c @@ -387,7 +387,7 @@ trigger_key_use(edict_t *self, edict_t *other, edict_t *activator) puzzle->solid = SOLID_NOT; // Once picked up, the item is gone forever, so remove it's client effect(s). - gi.RemoveEffects(&puzzle->s,0); + gi.RemoveEffects(puzzle,0); // The persistent part is removed from the server here. G_SetToFree(puzzle); @@ -819,7 +819,7 @@ void quake_use (edict_t *self, edict_t *other) count = (byte)self->count; time = (byte) self->time * 10; - gi.CreateEffect(&self->s, FX_QUAKE, CEF_BROADCAST, self->s.origin,"bbb",count,time,self->style); + gi.CreateEffect(self, FX_QUAKE, CEF_BROADCAST, self->s.origin,"bbb",count,time,self->style); G_UseTargets(self, self); diff --git a/src/game/g_waterfx.c b/src/game/g_waterfx.c index d98b20c93..9b312f6f6 100644 --- a/src/game/g_waterfx.c +++ b/src/game/g_waterfx.c @@ -26,7 +26,7 @@ void waterdrip_go(edict_t *self) frame = 1; } - self->PersistantCFX = gi.CreatePersistantEffect(&self->s, FX_DRIPPER, CEF_BROADCAST, + self->PersistantCFX = gi.CreatePersistantEffect(self, FX_DRIPPER, CEF_BROADCAST, self->s.origin, "bb", self->count, frame); self->think = NULL; @@ -39,7 +39,7 @@ void waterdrip_use (edict_t *self, edict_t *other, edict_t *activator) waterdrip_go(self); else { - gi.RemoveEffects(&self->s,0); + gi.RemoveEffects(self,0); self->PersistantCFX = 0; } } @@ -85,7 +85,7 @@ void fountain_use (edict_t *self, edict_t *other, edict_t *activator) frame = 0; if (self->spawnflags & FOUNTAIN_OFF) { - self->PersistantCFX = gi.CreatePersistantEffect(&self->s, FX_FOUNTAIN, CEF_BROADCAST, self->s.origin, "vsb", self->s.angles, drop, frame); + self->PersistantCFX = gi.CreatePersistantEffect(self, FX_FOUNTAIN, CEF_BROADCAST, self->s.origin, "vsb", self->s.angles, drop, frame); self->s.sound = gi.soundindex("ambient/fountainloop.wav"); self->s.sound_data = (255 & ENT_VOL_MASK) | ATTN_STATIC; self->spawnflags &= ~FOUNTAIN_OFF; @@ -97,7 +97,7 @@ void fountain_use (edict_t *self, edict_t *other, edict_t *activator) gi.RemovePersistantEffect(self->PersistantCFX, REMOVE_WATER); self->PersistantCFX = 0; } - gi.RemoveEffects(&self->s, FX_FOUNTAIN); + gi.RemoveEffects(self, FX_FOUNTAIN); self->spawnflags |= FOUNTAIN_OFF; self->s.sound = 0; } @@ -140,7 +140,7 @@ void SP_env_water_fountain(edict_t *self) drop = -self->delay * 8.0; frame = 0; - self->PersistantCFX = gi.CreatePersistantEffect(&self->s, FX_FOUNTAIN, CEF_BROADCAST, self->s.origin, "vsb", self->s.angles, drop, frame); + self->PersistantCFX = gi.CreatePersistantEffect(self, FX_FOUNTAIN, CEF_BROADCAST, self->s.origin, "vsb", self->s.angles, drop, frame); self->s.sound = gi.soundindex("ambient/fountainloop.wav"); self->s.sound_data = (255 & ENT_VOL_MASK) | ATTN_STATIC; } @@ -174,7 +174,7 @@ void SP_env_waterfall_base(edict_t *self) yaw = Q_ftol((self->s.angles[1] * 256.0) / 360.0); gi.linkentity(self); - gi.CreatePersistantEffect(&self->s, FX_WATERFALLBASE, CEF_BROADCAST, self->s.origin, "bbb", xrad, yrad, yaw); + gi.CreatePersistantEffect(self, FX_WATERFALLBASE, CEF_BROADCAST, self->s.origin, "bbb", xrad, yrad, yaw); } @@ -383,7 +383,7 @@ void SP_env_mist(edict_t *self) VectorSet(self->mins, -5, -5, -5); VectorSet(self->maxs, 5, 5, 5); - gi.CreatePersistantEffect(&self->s, FX_MIST, CEF_BROADCAST, self->s.origin, "b", scale); + gi.CreatePersistantEffect(self, FX_MIST, CEF_BROADCAST, self->s.origin, "b", scale); gi.linkentity(self); } @@ -401,7 +401,7 @@ void SP_env_bubbler(edict_t *self) VectorSet(self->maxs, 5, 5, 5); self->s.effects |= EF_ALWAYS_ADD_EFFECTS; - gi.CreatePersistantEffect(&self->s, FX_BUBBLER, CEF_BROADCAST, self->s.origin, "b", self->count); + gi.CreatePersistantEffect(self, FX_BUBBLER, CEF_BROADCAST, self->s.origin, "b", self->count); gi.linkentity(self); } diff --git a/src/game/game_utilities.c b/src/game/game_utilities.c index 2360ff329..5d694fc05 100644 --- a/src/game/game_utilities.c +++ b/src/game/game_utilities.c @@ -36,7 +36,7 @@ void remove_non_cinematic_entites(edict_t *owner) // kill the rain sound gi.sound(ent, CHAN_VOICE, gi.soundindex("misc/null.wav"), 1, ATTN_NORM,0); // remove the entity - gi.RemoveEffects(&ent->s, FX_WEAPON_REDRAIN); + gi.RemoveEffects(ent, FX_WEAPON_REDRAIN); G_SetToFree(ent); } } @@ -53,7 +53,7 @@ void remove_non_cinematic_entites(edict_t *owner) // kill the rain arrow travel sound gi.sound(ent, CHAN_VOICE, gi.soundindex("misc/null.wav"), 1, ATTN_NORM,0); // remove the entity - gi.RemoveEffects(&ent->s, FX_WEAPON_REDRAINMISSILE); + gi.RemoveEffects(ent, FX_WEAPON_REDRAINMISSILE); G_SetToFree(ent); } } @@ -117,7 +117,7 @@ void remove_non_cinematic_entites(edict_t *owner) if (ent->PersistantCFX) { gi.RemovePersistantEffect(ent->PersistantCFX, REMOVE_METEOR); - gi.RemoveEffects(&ent->owner->s, FX_SPELL_METEORBARRIER+ent->health); + gi.RemoveEffects(ent->owner, FX_SPELL_METEORBARRIER+ent->health); ent->PersistantCFX = 0; } // kill the meteorbarrier ambient sound @@ -144,14 +144,14 @@ void remove_non_cinematic_entites(edict_t *owner) ent->client->playerinfo.cinematic_starttime = level.time; if (ent->client->playerinfo.powerup_timer > ent->client->playerinfo.cinematic_starttime) - gi.RemoveEffects(&ent->s, FX_TOME_OF_POWER); + gi.RemoveEffects(ent, FX_TOME_OF_POWER); if (ent->client->playerinfo.speed_timer > ent->client->playerinfo.cinematic_starttime) - gi.RemoveEffects(&ent->s, FX_FOOT_TRAIL); + gi.RemoveEffects(ent, FX_FOOT_TRAIL); if (ent->client->playerinfo.shield_timer > ent->client->playerinfo.leveltime) { - gi.RemoveEffects(&ent->s, FX_SPELL_LIGHTNINGSHIELD); + gi.RemoveEffects(ent, FX_SPELL_LIGHTNINGSHIELD); ent->client->playerinfo.cin_shield_timer = ent->client->playerinfo.shield_timer; ent->client->playerinfo.shield_timer = 0; } @@ -189,7 +189,7 @@ void reinstate_non_cinematic_entites(edict_t *owner) { ent->client->playerinfo.light_timer += level.time - ent->client->playerinfo.cinematic_starttime; ent->s.effects |= EF_LIGHT_ENABLED; - gi.CreateEffect(&ent->s, FX_PLAYER_TORCH, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(ent, FX_PLAYER_TORCH, CEF_OWNERS_ORIGIN, NULL, ""); } if (ent->client->playerinfo.reflect_timer > ent->client->playerinfo.cinematic_starttime) @@ -209,14 +209,14 @@ void reinstate_non_cinematic_entites(edict_t *owner) ent->client->playerinfo.powerup_timer += level.time - ent->client->playerinfo.cinematic_starttime; ent->s.effects |= EF_POWERUP_ENABLED; ent->client->playerinfo.effects |= EF_POWERUP_ENABLED; - gi.CreateEffect(&ent->s, FX_TOME_OF_POWER, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(ent, FX_TOME_OF_POWER, CEF_OWNERS_ORIGIN, NULL, ""); } if (ent->client->playerinfo.cin_shield_timer > ent->client->playerinfo.cinematic_starttime) { ent->client->playerinfo.shield_timer = ent->client->playerinfo.cin_shield_timer + level.time - ent->client->playerinfo.cinematic_starttime; - ent->PersistantCFX = gi.CreatePersistantEffect(&ent->s, FX_SPELL_LIGHTNINGSHIELD, CEF_OWNERS_ORIGIN|CEF_BROADCAST, NULL, ""); + ent->PersistantCFX = gi.CreatePersistantEffect(ent, FX_SPELL_LIGHTNINGSHIELD, CEF_OWNERS_ORIGIN|CEF_BROADCAST, NULL, ""); } if (ent->client->playerinfo.speed_timer > ent->client->playerinfo.cinematic_starttime) @@ -224,7 +224,7 @@ void reinstate_non_cinematic_entites(edict_t *owner) ent->client->playerinfo.speed_timer += level.time - ent->client->playerinfo.cinematic_starttime; ent->s.effects |= EF_SPEED_ACTIVE; ent->client->playerinfo.effects |= EF_SPEED_ACTIVE; - gi.CreateEffect(&ent->s, FX_FOOT_TRAIL, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(ent, FX_FOOT_TRAIL, CEF_OWNERS_ORIGIN, NULL, ""); } // since we messed around with model stuff, like armor nodes and the like, lets update the model. diff --git a/src/game/header/game.h b/src/game/header/game.h index b7cefae31..99884f53d 100644 --- a/src/game/header/game.h +++ b/src/game/header/game.h @@ -205,11 +205,11 @@ typedef struct void (*FS_FreeFile) (void *buf); /* Heretic 2 specific */ - void (*CreateEffect) (entity_state_t *ent, int type, int flags, vec3_t origin, char *format, ...); - void (*RemoveEffects)(entity_state_t *ent, int type); - void (*CreateEffectEvent) (byte EventId,entity_state_t *ent, int type, int flags, vec3_t origin, char *format, ...); - void (*RemoveEffectsEvent)(byte EventId,entity_state_t *ent, int type); - int (*CreatePersistantEffect) (entity_state_t *ent, int type, int flags, vec3_t origin, char *format, ...); + void (*CreateEffect) (edict_t *ent, int type, int flags, vec3_t origin, char *format, ...); + void (*RemoveEffects)(edict_t *ent, int type); + void (*CreateEffectEvent) (byte EventId, edict_t *ent, int type, int flags, vec3_t origin, char *format, ...); + void (*RemoveEffectsEvent)(byte EventId, edict_t *ent, int type); + int (*CreatePersistantEffect) (edict_t *ent, int type, int flags, vec3_t origin, char *format, ...); qboolean (*RemovePersistantEffect) (int toRemove, int call_from); // removes the effect from the server's persistant effect list. // The effect is not removed on the client // This should be done by removing the effects from the owning entity or freein void (*ClearPersistantEffects) (void); diff --git a/src/game/mg_guide.c b/src/game/mg_guide.c index 3db874744..aadd1429c 100644 --- a/src/game/mg_guide.c +++ b/src/game/mg_guide.c @@ -1602,7 +1602,7 @@ void MG_AddBuoyEffect(edict_t *self, qboolean endbuoy) { gi.dprintf("Adding green effect to buoy %s\n", self->nextbuoy[0]->targetname); - gi.CreateEffect(&self->nextbuoy[0]->s, + gi.CreateEffect(self->nextbuoy[0], FX_M_EFFECTS, CEF_OWNERS_ORIGIN|CEF_FLAG6,//green self->nextbuoy[0]->s.origin, @@ -1621,7 +1621,7 @@ void MG_AddBuoyEffect(edict_t *self, qboolean endbuoy) { gi.dprintf("Adding red effect to buoy %s\n", self->nextbuoy[1]->targetname); - gi.CreateEffect(&self->nextbuoy[1]->s, + gi.CreateEffect(self->nextbuoy[1], FX_M_EFFECTS, CEF_OWNERS_ORIGIN,//red self->nextbuoy[1]->s.origin, diff --git a/src/game/monster/assassin/assassin.c b/src/game/monster/assassin/assassin.c index e36e3888a..db1df8f74 100644 --- a/src/game/monster/assassin/assassin.c +++ b/src/game/monster/assassin/assassin.c @@ -181,38 +181,38 @@ void assassin_jump(edict_t *self, G_Message_t *msg) edict_t *AssassinArrowReflect(edict_t *self, edict_t *other, vec3_t vel) { - edict_t *Arrow; - - Arrow = G_Spawn(); - - create_assassin_dagger(Arrow); - Arrow->s.modelindex = self->s.modelindex; - VectorCopy(self->s.origin, Arrow->s.origin); - Arrow->owner = other; - Arrow->enemy = self->owner; - Arrow->nextthink=self->nextthink; - VectorScale(self->avelocity, -0.5, Arrow->avelocity); - VectorCopy(vel, Arrow->velocity); - VectorNormalize2(vel, Arrow->movedir); - AnglesFromDir(Arrow->movedir, Arrow->s.angles); - Arrow->reflect_debounce_time = self->reflect_debounce_time -1; - Arrow->reflected_time=self->reflected_time; - - gi.CreateEffect(&Arrow->s, + edict_t *arrow; + + arrow = G_Spawn(); + + create_assassin_dagger(arrow); + arrow->s.modelindex = self->s.modelindex; + VectorCopy(self->s.origin, arrow->s.origin); + arrow->owner = other; + arrow->enemy = self->owner; + arrow->nextthink=self->nextthink; + VectorScale(self->avelocity, -0.5, arrow->avelocity); + VectorCopy(vel, arrow->velocity); + VectorNormalize2(vel, arrow->movedir); + AnglesFromDir(arrow->movedir, arrow->s.angles); + arrow->reflect_debounce_time = self->reflect_debounce_time -1; + arrow->reflected_time=self->reflected_time; + + gi.CreateEffect(arrow, FX_M_EFFECTS, 0, - Arrow->avelocity, + arrow->avelocity, "bv", FX_ASS_DAGGER, - Arrow->velocity); + arrow->velocity); - G_LinkMissile(Arrow); + G_LinkMissile(arrow); G_SetToFree(self); - gi.CreateEffect(&Arrow->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", vel); + gi.CreateEffect(arrow, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", vel); - return(Arrow); + return (arrow); } @@ -339,28 +339,28 @@ void assassinDaggerTouch (edict_t *self, edict_t *other, cplane_t *plane, csurfa } // create the guts of the dagger -void create_assassin_dagger(edict_t *Arrow) +void create_assassin_dagger(edict_t *arrow) { - Arrow->movetype=MOVETYPE_FLYMISSILE; - Arrow->solid=SOLID_BBOX; - Arrow->classname="Assassin_Dagger"; - Arrow->touch=assassinDaggerTouch; - Arrow->gravity = 0.0f; - Arrow->clipmask=MASK_SHOT; - Arrow->s.effects |= EF_CAMERA_NO_CLIP; - Arrow->svflags |= SVF_ALWAYS_SEND; - VectorSet(Arrow->s.scale, 0.5, 0.5, 0.5); - Arrow->think = G_FreeEdict;//ssithraArrowThink; + arrow->movetype = MOVETYPE_FLYMISSILE; + arrow->solid=SOLID_BBOX; + arrow->classname="Assassin_Dagger"; + arrow->touch=assassinDaggerTouch; + arrow->gravity = 0.0f; + arrow->clipmask=MASK_SHOT; + arrow->s.effects |= EF_CAMERA_NO_CLIP; + arrow->svflags |= SVF_ALWAYS_SEND; + VectorSet(arrow->s.scale, 0.5, 0.5, 0.5); + arrow->think = G_FreeEdict;//ssithraArrowThink; - VectorSet(Arrow->mins, -1.0, -1.0, -1.0); - VectorSet(Arrow->maxs, 1.0, 1.0, 1.0); + VectorSet(arrow->mins, -1.0, -1.0, -1.0); + VectorSet(arrow->maxs, 1.0, 1.0, 1.0); } void assassinThrowDagger(edict_t *self, float right_ofs) {//fixme; adjust for up/down vec3_t Forward,check_lead, right, enemy_pos, enemy_dir;//, up; - edict_t *Arrow; - float enemy_dist, eta;//, spoo_arc; + edict_t *arrow; + float enemy_dist, eta;//, spoo_arc; // if(self->s.fmnodeinfo[MESH__RIGHTARM].flags&FMNI_NO_DRAW) @@ -369,72 +369,72 @@ void assassinThrowDagger(edict_t *self, float right_ofs) // gi.sound(self,CHAN_WEAPON,Sounds[SND_ARROW1],1,ATTN_NORM,0); self->monsterinfo.attack_finished = level.time + 0.4; - Arrow = G_Spawn(); + arrow = G_Spawn(); - create_assassin_dagger(Arrow); + create_assassin_dagger(arrow); - Arrow->reflect_debounce_time = MAX_REFLECT; - Arrow->nextthink=level.time+3; - Arrow->enemy=self->enemy; - Arrow->owner=self; + arrow->reflect_debounce_time = MAX_REFLECT; + arrow->nextthink=level.time+3; + arrow->enemy=self->enemy; + arrow->owner=self; VectorCopy(self->enemy->s.origin, enemy_pos); enemy_pos[2] += self->enemy->viewheight; AngleVectors(self->s.angles, Forward, right, NULL); - VectorCopy(self->s.origin, Arrow->s.origin); - Arrow->s.origin[2] += 8; - VectorMA (Arrow->s.origin, 8, Forward, Arrow->s.origin); - VectorMA (Arrow->s.origin, right_ofs, right, Arrow->s.origin); - VectorCopy(self->movedir, Arrow->movedir); - VectoAngles (Forward, Arrow->s.angles); + VectorCopy(self->s.origin, arrow->s.origin); + arrow->s.origin[2] += 8; + VectorMA (arrow->s.origin, 8, Forward, arrow->s.origin); + VectorMA (arrow->s.origin, right_ofs, right, arrow->s.origin); + VectorCopy(self->movedir, arrow->movedir); + VectoAngles (Forward, arrow->s.angles); - extrapolateFiredir (self, Arrow->s.origin, ASSASSIN_DAGGER_SPEED, self->enemy, 0.3, check_lead); + extrapolateFiredir (self, arrow->s.origin, ASSASSIN_DAGGER_SPEED, self->enemy, 0.3, check_lead); - VectorSubtract(enemy_pos, Arrow->s.origin, enemy_dir); + VectorSubtract(enemy_pos, arrow->s.origin, enemy_dir); enemy_dist = VectorNormalize(enemy_dir); if(Vec3IsZero(check_lead)) { if(DotProduct(enemy_dir, Forward)>0.3) - VectorScale(enemy_dir, ASSASSIN_DAGGER_SPEED, Arrow->velocity); + VectorScale(enemy_dir, ASSASSIN_DAGGER_SPEED, arrow->velocity); else - VectorScale(Forward, ASSASSIN_DAGGER_SPEED, Arrow->velocity); + VectorScale(Forward, ASSASSIN_DAGGER_SPEED, arrow->velocity); } else { - VectorScale(check_lead, ASSASSIN_DAGGER_SPEED, Arrow->velocity); + VectorScale(check_lead, ASSASSIN_DAGGER_SPEED, arrow->velocity); } - VectorCopy(Arrow->velocity, Arrow->movedir); - VectorNormalize(Arrow->movedir); - VectoAngles(Arrow->movedir, Arrow->s.angles); - Arrow->s.angles[PITCH] = -90; + VectorCopy(arrow->velocity, arrow->movedir); + VectorNormalize(arrow->movedir); + VectoAngles(arrow->movedir, arrow->s.angles); + arrow->s.angles[PITCH] = -90; eta = enemy_dist / ASSASSIN_DAGGER_SPEED;//eta // gi.dprintf("ETA: %f\n", eta); //ideally, spin @1110 degrees in 1 sec - Arrow->avelocity[PITCH] = -1/eta * (360*3 +30 + flrand(-10,10)); -// gi.dprintf("avel: %f\n", Arrow->avelocity[PITCH]); -// gi.dprintf("final rotation: %f\n", Arrow->avelocity[PITCH]*eta); -// gi.dprintf("final angle: %f\n", anglemod(Arrow->s.angles[PITCH]+Arrow->avelocity[PITCH]*eta)); + arrow->avelocity[PITCH] = -1/eta * (360*3 +30 + flrand(-10,10)); +// gi.dprintf("avel: %f\n", arrow->avelocity[PITCH]); +// gi.dprintf("final rotation: %f\n", arrow->avelocity[PITCH]*eta); +// gi.dprintf("final angle: %f\n", anglemod(arrow->s.angles[PITCH]+arrow->avelocity[PITCH]*eta)); /* //doesn't make desired effect if(right_ofs>0) - Arrow->s.angles[ROLL] = flrand(0, 35); + arrow->s.angles[ROLL] = flrand(0, 35); else if(right_ofs<0) - Arrow->s.angles[ROLL] = flrand(-35, 0); + arrow->s.angles[ROLL] = flrand(-35, 0); */ - gi.CreateEffect(&Arrow->s, + gi.CreateEffect(arrow, FX_M_EFFECTS, 0, - Arrow->avelocity, + arrow->avelocity, "bv", FX_ASS_DAGGER, - Arrow->velocity); + arrow->velocity); - G_LinkMissile(Arrow); + G_LinkMissile(arrow); } /*------------------------------------------------------------------------- @@ -2185,7 +2185,7 @@ void assassinSmoke(edict_t *self) VectorCopy(self->s.origin, pos); pos[2]+=self->mins[2]; gi.CreateEffect(NULL, FX_TPORTSMOKE, 0, pos, "");//, "db", hitangles, 5); - //gi.CreateEffect(&self->s, FX_DUST_PUFF, CEF_OWNERS_ORIGIN, self->s.origin, NULL); + //gi.CreateEffect(self, FX_DUST_PUFF, CEF_OWNERS_ORIGIN, self->s.origin, NULL); } void assassinGone(edict_t *self) diff --git a/src/game/monster/beast/beast.c b/src/game/monster/beast/beast.c index aa59d2f7f..defc251b9 100644 --- a/src/game/monster/beast/beast.c +++ b/src/game/monster/beast/beast.c @@ -266,7 +266,7 @@ void tbeast_blocked (edict_t *self, trace_t *trace) if(stop) { - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_QUAKE, 0, vec3_origin, @@ -770,7 +770,7 @@ void tbeast_footstep (edict_t *self) VectorSet(up, flrand(-20, 20), flrand(-20, 20), flrand(20, 100)); gi.CreateEffect(NULL, FX_OGLE_HITPUFF, 0, pos, "v", up); - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_QUAKE, 0, vec3_origin, @@ -997,7 +997,7 @@ void tbeast_land(edict_t *self) // self->gravity = 1.0; - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_QUAKE, 0, vec3_origin, @@ -1426,9 +1426,9 @@ void tbeast_toy_ofs(edict_t *self, float ofsf, float ofsr, float ofsu) if(flrand(0,1)<0.5) { if(self->targetEnt->materialtype == MAT_INSECT) - gi.CreateEffect(&self->targetEnt->s, FX_BLOOD, CEF_FLAG8, self->targetEnt->s.origin, "ub", blooddir, 200); + gi.CreateEffect(self->targetEnt, FX_BLOOD, CEF_FLAG8, self->targetEnt->s.origin, "ub", blooddir, 200); else - gi.CreateEffect(&self->targetEnt->s, FX_BLOOD, 0, self->targetEnt->s.origin, "ub", blooddir, 200); + gi.CreateEffect(self->targetEnt, FX_BLOOD, 0, self->targetEnt->s.origin, "ub", blooddir, 200); } } @@ -2081,7 +2081,7 @@ void tbeast_fake_impact(edict_t *self, trace_t *trace, qboolean crush) self->takedamage = DAMAGE_NO; } } - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_QUAKE, 0, vec3_origin, diff --git a/src/game/monster/chicken/chicken.c b/src/game/monster/chicken/chicken.c index c145d2f14..c626f23f0 100644 --- a/src/game/monster/chicken/chicken.c +++ b/src/game/monster/chicken/chicken.c @@ -154,7 +154,7 @@ void chicken_death(edict_t *self, G_Message_t *msg) gi.sound (self, CHAN_BODY, sounds[SND_DIE], 1, ATTN_NORM, 0); self->deadflag = DEAD_DEAD; BecomeDebris(self); - gi.CreateEffect(&self->s, FX_CHICKEN_EXPLODE, CEF_OWNERS_ORIGIN, NULL, "" ); + gi.CreateEffect(self, FX_CHICKEN_EXPLODE, CEF_OWNERS_ORIGIN, NULL, "" ); } @@ -211,7 +211,7 @@ void MorphChickenOut(edict_t *self) // do the teleport sound gi.sound(newent,CHAN_WEAPON,gi.soundindex("weapons/teleport.wav"),1,ATTN_NORM,0); // do the teleport effect - gi.CreateEffect(&newent->s, FX_PLAYER_TELEPORT_IN, CEF_OWNERS_ORIGIN, NULL, "" ); + gi.CreateEffect(newent, FX_PLAYER_TELEPORT_IN, CEF_OWNERS_ORIGIN, NULL, "" ); G_FreeEdict(self); } } @@ -229,7 +229,7 @@ void chicken_check (edict_t *self) return; // make that pretty effect around us - gi.CreateEffect(&self->s, FX_PLAYER_TELEPORT_OUT, CEF_OWNERS_ORIGIN, NULL, "" ); + gi.CreateEffect(self, FX_PLAYER_TELEPORT_OUT, CEF_OWNERS_ORIGIN, NULL, "" ); // deal with the existing chicken self->think = MorphChickenOut; diff --git a/src/game/monster/elflord/elflord.c b/src/game/monster/elflord/elflord.c index 87ae71ced..93c6c4053 100644 --- a/src/game/monster/elflord/elflord.c +++ b/src/game/monster/elflord/elflord.c @@ -149,13 +149,13 @@ void elford_Attack( edict_t *self ) gi.linkentity(projectile); - gi.CreateEffect( &projectile->s, - FX_CWATCHER, - CEF_OWNERS_ORIGIN, - projectile->s.origin, - "bv", - CW_STAR, - self->s.origin); + gi.CreateEffect(projectile, + FX_CWATCHER, + CEF_OWNERS_ORIGIN, + projectile->s.origin, + "bv", + CW_STAR, + self->s.origin); projectile->isBlocking = projectile->bounced = projectile->isBlocked = elflord_projectile_blocked; } @@ -202,13 +202,13 @@ void elflord_StartBeam(edict_t *self) gi.linkentity(beam); - gi.CreateEffect( &beam->s, - FX_CWATCHER, - CEF_OWNERS_ORIGIN, - beam->s.origin, - "bv", - CW_BEAM, - self->pos2); + gi.CreateEffect(beam, + FX_CWATCHER, + CEF_OWNERS_ORIGIN, + beam->s.origin, + "bv", + CW_BEAM, + self->pos2); gi.sound(self, CHAN_VOICE, sounds[SND_BEAM], 0.5, ATTN_NONE, 0); diff --git a/src/game/monster/fish/fish.c b/src/game/monster/fish/fish.c index 5bd97d2c6..9c8bad0de 100644 --- a/src/game/monster/fish/fish.c +++ b/src/game/monster/fish/fish.c @@ -451,7 +451,7 @@ void fish_think (edict_t *self) void fish_under_water_wake (edict_t *self) { - gi.CreateEffect(&self->s, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, self->s.origin, "bv", FX_UNDER_WATER_WAKE, vec3_origin); + gi.CreateEffect(self, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, self->s.origin, "bv", FX_UNDER_WATER_WAKE, vec3_origin); } void fish_swim_sound (edict_t *self, float fast) @@ -799,7 +799,7 @@ void fish_dead(edict_t *self) self->nextthink = level.time + 0.1; // stop the fish making bubbles - gi.RemoveEffects(&self->s, FX_WATER_BUBBLE); + gi.RemoveEffects(self, FX_WATER_BUBBLE); if (self->PersistantCFX) { gi.RemovePersistantEffect(self->PersistantCFX, REMOVE_FISH); @@ -1186,7 +1186,7 @@ void SP_monster_fish (edict_t *self) Vec3ScaleAssign(AVG_VEC3T(self->s.scale), self->maxs); // give us the bubble spawner - self->PersistantCFX = gi.CreatePersistantEffect(&self->s, + self->PersistantCFX = gi.CreatePersistantEffect(self, FX_WATER_BUBBLE, CEF_OWNERS_ORIGIN | CEF_BROADCAST, NULL, diff --git a/src/game/monster/gkrokon/gkrokon.c b/src/game/monster/gkrokon/gkrokon.c index 2be1b8baa..710bce7bf 100644 --- a/src/game/monster/gkrokon/gkrokon.c +++ b/src/game/monster/gkrokon/gkrokon.c @@ -102,7 +102,7 @@ edict_t *GkrokonSpooReflect(edict_t *self, edict_t *other, vec3_t vel) gi.linkentity(Spoo); - gi.CreateEffect(&Spoo->s, + gi.CreateEffect(Spoo, FX_SPOO, CEF_OWNERS_ORIGIN, Spoo->s.origin, @@ -164,7 +164,7 @@ void GkrokonSpooTouch(edict_t *self,edict_t *Other,cplane_t *Plane,csurface_t *S T_DamageRadius(self, self->owner, self, 5.0, self->dmg, self->dmg/4, DAMAGE_NO_KNOCKBACK|DAMAGE_ATTACKER_IMMUNE,MOD_DIED); - gi.RemoveEffects(&self->s, 0); + gi.RemoveEffects(self, 0); if(IsDecalApplicable(self, Other, self->s.origin, Surface, Plane, planeDir)) { @@ -235,7 +235,7 @@ void GkrokonSpoo(edict_t *self) gi.sound(Spoo,CHAN_WEAPON,sounds[SND_SPOO],1,ATTN_NORM,0); - gi.CreateEffect(&Spoo->s, + gi.CreateEffect(Spoo, FX_SPOO, CEF_OWNERS_ORIGIN, Spoo->s.origin, diff --git a/src/game/monster/gorgon/gorgon.c b/src/game/monster/gorgon/gorgon.c index c9bbdc755..b73744533 100644 --- a/src/game/monster/gorgon/gorgon.c +++ b/src/game/monster/gorgon/gorgon.c @@ -1652,9 +1652,9 @@ void gorgon_toy_ofs(edict_t *self, float ofsf, float ofsr, float ofsu) if(flrand(0,1)<0.5) { if(self->enemy->materialtype == MAT_INSECT) - gi.CreateEffect(&self->enemy->s, FX_BLOOD, CEF_FLAG8, self->enemy->s.origin, "ub", blooddir, 200); + gi.CreateEffect(self->enemy, FX_BLOOD, CEF_FLAG8, self->enemy->s.origin, "ub", blooddir, 200); else - gi.CreateEffect(&self->enemy->s, FX_BLOOD, 0, self->enemy->s.origin, "ub", blooddir, 200); + gi.CreateEffect(self->enemy, FX_BLOOD, 0, self->enemy->s.origin, "ub", blooddir, 200); } } @@ -2014,7 +2014,7 @@ void gorgon_prethink (edict_t *self) } else { - gi.RemoveEffects (&self->s, FX_M_EFFECTS); + gi.RemoveEffects(self, FX_M_EFFECTS); self->gravity = 1.0f; self->svflags &= ~SVF_TAKE_NO_IMPACT_DMG; if(AVG_VEC3T(self->s.scale) > 0.5) diff --git a/src/game/monster/harpy/harpy.c b/src/game/monster/harpy/harpy.c index 871eb620b..d2689d3ac 100644 --- a/src/game/monster/harpy/harpy.c +++ b/src/game/monster/harpy/harpy.c @@ -210,7 +210,7 @@ void harpy_take_head(edict_t *self, edict_t *victim, int BodyPart, int frame, in head->s.origin[2] += 100; - gi.CreateEffect(&head->s,//owner + gi.CreateEffect(head,//owner FX_BODYPART,//type flags,//can't mess with this, sends only 1st byte and effects message head->s.origin,//spot, @@ -638,7 +638,7 @@ void move_harpy_tumble(edict_t *self) if ( (self->groundentity != NULL) || (trace.fraction != 1) || (trace.startsolid) || (trace.allsolid) || (self->monsterinfo.jump_time < level.time) ) { - gi.CreateEffect(&self->s, FX_DUST_PUFF, CEF_OWNERS_ORIGIN, self->s.origin, NULL); + gi.CreateEffect(self, FX_DUST_PUFF, CEF_OWNERS_ORIGIN, self->s.origin, NULL); VectorCopy(self->s.angles, self->movedir); harpy_death_noise(self); diff --git a/src/game/monster/imp/imp.c b/src/game/monster/imp/imp.c index 141f20af3..666feb1e6 100644 --- a/src/game/monster/imp/imp.c +++ b/src/game/monster/imp/imp.c @@ -332,7 +332,7 @@ void move_imp_tumble(edict_t *self) if (self->groundentity != NULL || self->monsterinfo.jump_time < level.time) { - gi.CreateEffect(&self->s, FX_DUST_PUFF, CEF_OWNERS_ORIGIN, self->s.origin, NULL); + gi.CreateEffect(self, FX_DUST_PUFF, CEF_OWNERS_ORIGIN, self->s.origin, NULL); VectorCopy(self->s.angles, self->movedir); imp_death_noise(self); @@ -1136,7 +1136,7 @@ void FireFizzle (edict_t *self) gi.sound (self, CHAN_BODY, sounds[SND_FIZZLE], 1, ATTN_NORM, 0); VectorSet(dir, flrand(0, 1),flrand(0, 1), flrand(0.5, 1)); VectorNormalize(dir); - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_ENVSMOKE, CEF_BROADCAST,self->s.origin, "bdbbb",irand(1,3),dir,irand(1,2),irand(3, 4),irand(1,2)); @@ -1189,7 +1189,7 @@ edict_t *ImpFireballReflect(edict_t *self, edict_t *other, vec3_t vel) fireball->reflected_time=self->reflected_time; fireball->ideal_yaw = self->ideal_yaw; - gi.CreateEffect(&fireball->s, + gi.CreateEffect(fireball, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, NULL, @@ -1201,7 +1201,7 @@ edict_t *ImpFireballReflect(edict_t *self, edict_t *other, vec3_t vel) G_SetToFree(self); - gi.CreateEffect(&fireball->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", vel); + gi.CreateEffect(fireball, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", vel); return(fireball); } @@ -1251,7 +1251,7 @@ void fireball_blocked( edict_t *self, trace_t *trace ) gi.sound(self, CHAN_BODY, sounds[SND_FBHIT], 1, ATTN_NORM, 0); - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, self->s.origin, @@ -1309,7 +1309,7 @@ void imp_fireball (edict_t *self) VectorNormalize(proj->movedir); VectoAngles(proj->movedir, proj->s.angles); - gi.CreateEffect(&proj->s, + gi.CreateEffect(proj, FX_M_EFFECTS,//just so I don't have to make a new FX_ id CEF_OWNERS_ORIGIN, NULL, diff --git a/src/game/monster/morcalavin/morcalavin.c b/src/game/monster/morcalavin/morcalavin.c index 14cea8347..557cea9ba 100644 --- a/src/game/monster/morcalavin/morcalavin.c +++ b/src/game/monster/morcalavin/morcalavin.c @@ -150,7 +150,7 @@ void morcalavin_big_shot( edict_t *self ) gi.linkentity(proj); //Create the effect - gi.CreateEffect(&proj->s, + gi.CreateEffect(proj, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, proj->s.origin, @@ -187,7 +187,7 @@ void morcalavin_proj_track( edict_t *self ) //Timeout? if (self->monsterinfo.attack_finished < level.time) { - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_HP_MISSILE, CEF_OWNERS_ORIGIN, self->s.origin, @@ -294,7 +294,7 @@ void morcalavin_tracking_projectile ( edict_t *self, float pitch, float yaw, flo gi.sound (self, CHAN_AUTO, sounds[SND_HOMING], 1, ATTN_NORM, 0); - gi.CreateEffect(&proj->s, + gi.CreateEffect(proj, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, NULL, @@ -331,7 +331,7 @@ void morcalavin_proj2_blocked( edict_t *self, trace_t *trace ) exp = HPMISSILE1_EXPLODE; - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_HP_MISSILE, CEF_OWNERS_ORIGIN, self->s.origin, @@ -394,7 +394,7 @@ void morcalavin_proj3_blocked( edict_t *self, trace_t *trace ) exp = HPMISSILE1_EXPLODE; - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_HP_MISSILE, CEF_OWNERS_ORIGIN, self->s.origin, @@ -606,7 +606,7 @@ void morcalavin_start_missile(edict_t *self) gi.linkentity(proj); //Create the effect - gi.CreateEffect(&proj->s, + gi.CreateEffect(proj, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, proj->s.origin, @@ -654,7 +654,7 @@ void morcalavin_proj1_blocked( edict_t *self, trace_t *trace ) exp = HPMISSILE1_EXPLODE; - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_HP_MISSILE, CEF_OWNERS_ORIGIN, self->s.origin, @@ -681,7 +681,7 @@ void morcalavin_proj1_blocked( edict_t *self, trace_t *trace ) T_Damage( trace->ent, self, self->owner, hitDir, self->s.origin, trace->plane.normal, damage, 0, DAMAGE_SPELL | DAMAGE_NO_KNOCKBACK,MOD_DIED ); } - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_HP_MISSILE, CEF_OWNERS_ORIGIN, self->s.origin, @@ -768,7 +768,7 @@ void morcalavin_taunt_shot(edict_t *self) gi.sound (self, CHAN_AUTO, sounds[SND_HOMING], 1, ATTN_NORM, 0); - gi.CreateEffect(&proj->s, + gi.CreateEffect(proj, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, NULL, @@ -965,7 +965,7 @@ void beam_blocked( edict_t *self, trace_t *trace ) Vec3ScaleAssign(proj->ideal_yaw,proj->velocity); VectoAngles(proj->velocity, proj->s.angles); - gi.CreateEffect(&proj->s, + gi.CreateEffect(proj, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, NULL, @@ -996,7 +996,7 @@ void beam_blocked( edict_t *self, trace_t *trace ) gi.sound(self, CHAN_WEAPON, gi.soundindex("monsters/seraph/guard/spellhit.wav"), 1, ATTN_NORM, 0); - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, self->s.origin, @@ -1052,7 +1052,7 @@ void morcalavin_beam( edict_t *self) gi.sound(self, CHAN_WEAPON, gi.soundindex("monsters/seraph/guard/spell.wav"), 1, ATTN_NORM, 0); //TODO: Spawn a muzzle flash - gi.CreateEffect(&proj->s, + gi.CreateEffect(proj, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, vec3_origin, @@ -1103,7 +1103,7 @@ void morcalavin_beam2( edict_t *self) gi.sound(self, CHAN_WEAPON, gi.soundindex("monsters/seraph/guard/spell.wav"), 1, ATTN_NORM, 0); //TODO: Spawn a muzzle flash - gi.CreateEffect(&proj->s, + gi.CreateEffect(proj, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, vec3_origin, @@ -1376,7 +1376,7 @@ void mork_ai_run (edict_t *self, float dist) else { /* - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_M_EFFECTS, 0, vec3_origin, diff --git a/src/game/monster/mssithra/mssithra.c b/src/game/monster/mssithra/mssithra.c index 31acad54f..7ee6ea9b6 100644 --- a/src/game/monster/mssithra/mssithra.c +++ b/src/game/monster/mssithra/mssithra.c @@ -327,7 +327,7 @@ edict_t *MssithraAlphaArrowReflect(edict_t *self, edict_t *other, vec3_t vel) G_LinkMissile(arrow); - gi.CreateEffect(&arrow->s, + gi.CreateEffect(arrow, FX_M_EFFECTS, CEF_OWNERS_ORIGIN | CEF_FLAG6, NULL, @@ -337,7 +337,7 @@ edict_t *MssithraAlphaArrowReflect(edict_t *self, edict_t *other, vec3_t vel) G_SetToFree(self); - gi.CreateEffect(&arrow->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", vel); + gi.CreateEffect(arrow, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", vel); return(arrow);; } @@ -407,7 +407,7 @@ void mssithraArrow(edict_t *self) {//fixme; adjust for up/down vec3_t Forward, targ_pos; vec3_t Right, fire_spot, fire_dir;// , up; - edict_t *Arrow; + edict_t *arrow; float spread; int num_shots = 3; @@ -440,13 +440,13 @@ void mssithraArrow(edict_t *self) while(num_shots) { - Arrow = G_Spawn(); + arrow = G_Spawn(); - create_ssithra_arrow(Arrow); - Arrow->reflect_debounce_time = MAX_REFLECT; + create_ssithra_arrow(arrow); + arrow->reflect_debounce_time = MAX_REFLECT; - VectorCopy(fire_spot,Arrow->s.origin); - VectorCopy(self->movedir,Arrow->movedir); + VectorCopy(fire_spot, arrow->s.origin); + VectorCopy(self->movedir, arrow->movedir); //Increase the spread for lower levels switch((int)skill->value) @@ -482,28 +482,28 @@ void mssithraArrow(edict_t *self) break; } - VectorAdd(fire_dir, Right, Arrow->movedir); - VectorNormalize(Arrow->movedir); - VectorScale(Arrow->movedir,MSSITHRA_ARROW_SPEED,Arrow->velocity); + VectorAdd(fire_dir, Right, arrow->movedir); + VectorNormalize(arrow->movedir); + VectorScale(arrow->movedir, MSSITHRA_ARROW_SPEED, arrow->velocity); - VectoAngles(Arrow->velocity, Arrow->s.angles); - Arrow->s.angles[YAW] += 90; + VectoAngles(arrow->velocity, arrow->s.angles); + arrow->s.angles[YAW] += 90; - Arrow->owner=self; - Arrow->enemy=self->enemy; + arrow->owner=self; + arrow->enemy=self->enemy; - gi.CreateEffect(&Arrow->s, + gi.CreateEffect(arrow, FX_M_EFFECTS, CEF_OWNERS_ORIGIN | CEF_FLAG6, NULL, "bv", FX_MSSITHRA_ARROW, - Arrow->velocity); + arrow->velocity); - G_LinkMissile(Arrow); + G_LinkMissile(arrow); - Arrow->nextthink=level.time+5; - Arrow->think=G_FreeEdict;//mssithraArrowThink; + arrow->nextthink = level.time+5; + arrow->think = G_FreeEdict;//mssithraArrowThink; num_shots--; } diff --git a/src/game/monster/plagueelf/plagueelf.c b/src/game/monster/plagueelf/plagueelf.c index ce2db2bc3..6dff64422 100644 --- a/src/game/monster/plagueelf/plagueelf.c +++ b/src/game/monster/plagueelf/plagueelf.c @@ -580,7 +580,7 @@ void plagueElfSpellTouch (edict_t *self, edict_t *Other, cplane_t *Plane, csurfa make_pe_spell_reflect(self,Spell); - gi.CreateEffect(&Spell->s, + gi.CreateEffect(Spell, FX_PE_SPELL, CEF_OWNERS_ORIGIN, NULL, @@ -703,7 +703,7 @@ void plagueElf_spell(edict_t *self) else Spell->red_rain_count = FX_PE_MAKE_SPELL; - gi.CreateEffect(&Spell->s, + gi.CreateEffect(Spell, FX_PE_SPELL, CEF_OWNERS_ORIGIN, NULL, @@ -776,7 +776,7 @@ void plagueElf_c_spell(edict_t *self) else Spell->red_rain_count = FX_PE_MAKE_SPELL; - gi.CreateEffect(&Spell->s, + gi.CreateEffect(Spell, FX_PE_SPELL, CEF_OWNERS_ORIGIN, NULL, @@ -1370,7 +1370,7 @@ void plagueElf_pause (edict_t *self) void pelf_land(edict_t *self) { gi.sound(self, CHAN_BODY, gi.soundindex("misc/land.wav"), 1, ATTN_NORM, 0); - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_DUST_PUFF, CEF_OWNERS_ORIGIN, self->s.origin, diff --git a/src/game/monster/plaguessithra/plaguessithra.c b/src/game/monster/plaguessithra/plaguessithra.c index 1d0c9b39f..d72095846 100644 --- a/src/game/monster/plaguessithra/plaguessithra.c +++ b/src/game/monster/plaguessithra/plaguessithra.c @@ -1200,7 +1200,7 @@ void ssithraSplit (edict_t *self, int BodyPart) VectorScale(dir, 40.0, dir); //Why doesn't this work? - gi.CreateEffect(&self->s, FX_BLOOD, 0, p1, "ub", dir, 20); + gi.CreateEffect(self, FX_BLOOD, 0, p1, "ub", dir, 20); VectorAdd(self->s.origin,p2,p2); SprayDebris(self,p2, 6,200); @@ -2051,49 +2051,49 @@ void ssithraSwipe (edict_t *self) } // the arrow needs to bounce -void make_arrow_reflect(edict_t *self, edict_t *Arrow) +void make_arrow_reflect(edict_t *self, edict_t *arrow) { - create_ssith_arrow(Arrow); - Arrow->s.modelindex = self->s.modelindex; - VectorCopy(self->s.origin, Arrow->s.origin); - Arrow->owner = self->owner; - Arrow->enemy = self->enemy; + create_ssith_arrow(arrow); + arrow->s.modelindex = self->s.modelindex; + VectorCopy(self->s.origin, arrow->s.origin); + arrow->owner = self->owner; + arrow->enemy = self->enemy; - Arrow->touch=self->touch; - Arrow->nextthink=self->nextthink; - Arrow->think=G_FreeEdict; - Arrow->health = self->health; + arrow->touch = self->touch; + arrow->nextthink = self->nextthink; + arrow->think = G_FreeEdict; + arrow->health = self->health; - Create_rand_relect_vect(self->velocity, Arrow->velocity); + Create_rand_relect_vect(self->velocity, arrow->velocity); - VectoAngles(Arrow->velocity, Arrow->s.angles); - Arrow->s.angles[YAW]+=90; + VectoAngles(arrow->velocity, arrow->s.angles); + arrow->s.angles[YAW] += 90; - Vec3ScaleAssign(SSITHRA_SPOO_SPEED/2,Arrow->velocity); + Vec3ScaleAssign(SSITHRA_SPOO_SPEED/2,arrow->velocity); - G_LinkMissile(Arrow); + G_LinkMissile(arrow); } void ssithraAlphaArrowTouch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surface) { float damage; vec3_t normal; - edict_t *Arrow; + edict_t *arrow; // are we reflecting ? if(EntReflecting(other, true, true)) { - Arrow = G_Spawn(); + arrow = G_Spawn(); - make_arrow_reflect(self,Arrow); + make_arrow_reflect(self, arrow); - gi.CreateEffect(&Arrow->s, + gi.CreateEffect(arrow, FX_SSITHRA_ARROW, CEF_OWNERS_ORIGIN, NULL, "bv", FX_SS_MAKE_ARROW2, - Arrow->velocity); + arrow->velocity); G_SetToFree(self); @@ -2140,7 +2140,7 @@ void ssithraArrowTouch (edict_t *self,edict_t *Other,cplane_t *Plane,csurface_t { float damage; vec3_t normal; - edict_t *Arrow; + edict_t *arrow; if(Surface&&(Surface->flags&SURF_SKY)) { @@ -2150,9 +2150,9 @@ void ssithraArrowTouch (edict_t *self,edict_t *Other,cplane_t *Plane,csurface_t if(EntReflecting(Other, true, true)) { - Arrow = G_Spawn(); + arrow = G_Spawn(); - make_arrow_reflect(self,Arrow); + make_arrow_reflect(self, arrow); gi.CreateEffect( NULL, FX_M_EFFECTS, @@ -2162,13 +2162,13 @@ void ssithraArrowTouch (edict_t *self,edict_t *Other,cplane_t *Plane,csurface_t FX_MSSITHRA_EXPLODE, self->movedir); /* - gi.CreateEffect(&Arrow->s, + gi.CreateEffect(arrow, FX_SSITHRA_ARROW, CEF_OWNERS_ORIGIN, NULL, "bv", FX_SS_MAKE_ARROW, - Arrow->velocity); + arrow->velocity); */ G_SetToFree(self); @@ -2267,63 +2267,63 @@ void ssithraDuckArrowTouch (edict_t *self,edict_t *other,cplane_t *plane,csurfac } } -void create_ssith_arrow(edict_t *Arrow) +void create_ssith_arrow(edict_t *arrow) { - Arrow->movetype = MOVETYPE_FLYMISSILE; - Arrow->solid = SOLID_BBOX; - Arrow->classname = "Ssithra_Arrow"; - Arrow->touch = ssithraArrowTouch; - Arrow->enemy = NULL; - Arrow->clipmask = MASK_SHOT; - VectorSet(Arrow->s.scale, 0.75, 0.75, 0.75); - Arrow->s.effects |= EF_CAMERA_NO_CLIP; - Arrow->svflags |= SVF_ALWAYS_SEND; - Arrow->s.modelindex = gi.modelindex("models/objects/exarrow/tris.fm"); + arrow->movetype = MOVETYPE_FLYMISSILE; + arrow->solid = SOLID_BBOX; + arrow->classname = "Ssithra_Arrow"; + arrow->touch = ssithraArrowTouch; + arrow->enemy = NULL; + arrow->clipmask = MASK_SHOT; + VectorSet(arrow->s.scale, 0.75, 0.75, 0.75); + arrow->s.effects |= EF_CAMERA_NO_CLIP; + arrow->svflags |= SVF_ALWAYS_SEND; + arrow->s.modelindex = gi.modelindex("models/objects/exarrow/tris.fm"); } void ssithraDoArrow(edict_t *self, float z_offs) { vec3_t Forward,check_lead, right, enemy_dir; - edict_t *Arrow; + edict_t *arrow; if(self->s.fmnodeinfo[MESH__RIGHTARM].flags&FMNI_NO_DRAW) return; gi.sound(self,CHAN_WEAPON,Sounds[SND_ARROW1],1,ATTN_NORM,0); self->monsterinfo.attack_finished = level.time + 0.4; - Arrow = G_Spawn(); + arrow = G_Spawn(); - create_ssith_arrow(Arrow); + create_ssith_arrow(arrow); if(self->spawnflags & MSF_SSITHRA_ALPHA) - Arrow->touch=ssithraArrowTouch; + arrow->touch=ssithraArrowTouch; else - Arrow->touch=ssithraArrowTouch; + arrow->touch=ssithraArrowTouch; - Arrow->owner=self; - Arrow->enemy=self->enemy; + arrow->owner=self; + arrow->enemy=self->enemy; - Arrow->health = 0; // tell the touch function what kind of arrow we are; + arrow->health = 0; // tell the touch function what kind of arrow we are; AngleVectors(self->s.angles, Forward, right, NULL); - VectorCopy(self->s.origin,Arrow->s.origin); - VectorMA(Arrow->s.origin, 16, Forward, Arrow->s.origin); - VectorMA(Arrow->s.origin, -4, right, Arrow->s.origin); - Arrow->s.origin[2] += 16; + VectorCopy(self->s.origin,arrow->s.origin); + VectorMA(arrow->s.origin, 16, Forward, arrow->s.origin); + VectorMA(arrow->s.origin, -4, right, arrow->s.origin); + arrow->s.origin[2] += 16; - VectorCopy(self->movedir,Arrow->movedir); - VectoAngles(Forward,Arrow->s.angles); + VectorCopy(self->movedir,arrow->movedir); + VectoAngles(Forward,arrow->s.angles); VectorClear(check_lead); if(skill->value > 1) { - extrapolateFiredir(self, Arrow->s.origin, + extrapolateFiredir(self, arrow->s.origin, SSITHRA_SPOO_SPEED, self->enemy, 0.3, check_lead); } else { - VectorSubtract(self->enemy->s.origin, Arrow->s.origin, enemy_dir); + VectorSubtract(self->enemy->s.origin, arrow->s.origin, enemy_dir); VectorNormalize(enemy_dir); if(DotProduct(enemy_dir, Forward) >= 0.3) { @@ -2333,37 +2333,37 @@ void ssithraDoArrow(edict_t *self, float z_offs) if(Vec3IsZero(check_lead)) { - VectorScale(Forward,SSITHRA_SPOO_SPEED,Arrow->velocity); + VectorScale(Forward,SSITHRA_SPOO_SPEED,arrow->velocity); } else { - VectorScale(check_lead,SSITHRA_SPOO_SPEED,Arrow->velocity); + VectorScale(check_lead,SSITHRA_SPOO_SPEED,arrow->velocity); } - VectorCopy(Arrow->velocity, Arrow->movedir); - VectorNormalize(Arrow->movedir); - VectoAngles(Arrow->movedir, Arrow->s.angles); - Arrow->s.angles[PITCH] = anglemod(Arrow->s.angles[PITCH] * -1); - Arrow->s.angles[YAW] += 90; + VectorCopy(arrow->velocity, arrow->movedir); + VectorNormalize(arrow->movedir); + VectoAngles(arrow->movedir, arrow->s.angles); + arrow->s.angles[PITCH] = anglemod(arrow->s.angles[PITCH] * -1); + arrow->s.angles[YAW] += 90; - gi.CreateEffect(&Arrow->s, + gi.CreateEffect(arrow, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, - Arrow->s.origin, + arrow->s.origin, "bv", FX_MSSITHRA_ARROW, - Arrow->velocity); + arrow->velocity); - G_LinkMissile(Arrow); + G_LinkMissile(arrow); - Arrow->nextthink=level.time+3; - Arrow->think=G_FreeEdict;//ssithraArrowThink; + arrow->nextthink=level.time+3; + arrow->think=G_FreeEdict;//ssithraArrowThink; } void ssithraDoDuckArrow(edict_t *self, float z_offs) { vec3_t Forward,check_lead, right, enemy_dir; - edict_t *Arrow; + edict_t *arrow; if(self->s.fmnodeinfo[MESH__RIGHTARM].flags&FMNI_NO_DRAW) return; @@ -2371,38 +2371,38 @@ void ssithraDoDuckArrow(edict_t *self, float z_offs) gi.sound(self, CHAN_WEAPON, Sounds[SND_ARROW_FIRE] , 1, ATTN_NORM, 0); self->monsterinfo.attack_finished = level.time + 0.4; - Arrow = G_Spawn(); + arrow = G_Spawn(); - create_ssith_arrow(Arrow); + create_ssith_arrow(arrow); - Arrow->touch=ssithraDuckArrowTouch; + arrow->touch=ssithraDuckArrowTouch; - Arrow->owner=self; - Arrow->enemy=self->enemy; + arrow->owner=self; + arrow->enemy=self->enemy; - Arrow->health = 0; // tell the touch function what kind of arrow we are; + arrow->health = 0; // tell the touch function what kind of arrow we are; AngleVectors(self->s.angles, Forward, right, NULL); - VectorCopy(self->s.origin,Arrow->s.origin); - VectorMA(Arrow->s.origin, 12 * AVG_VEC3T(self->s.scale), Forward, Arrow->s.origin); - VectorMA(Arrow->s.origin, 4 * AVG_VEC3T(self->s.scale), right, Arrow->s.origin); - Arrow->s.origin[2] += z_offs; + VectorCopy(self->s.origin,arrow->s.origin); + VectorMA(arrow->s.origin, 12 * AVG_VEC3T(self->s.scale), Forward, arrow->s.origin); + VectorMA(arrow->s.origin, 4 * AVG_VEC3T(self->s.scale), right, arrow->s.origin); + arrow->s.origin[2] += z_offs; - VectorSet(Arrow->s.scale, 1.5, 1.5, 1.5); + VectorSet(arrow->s.scale, 1.5, 1.5, 1.5); - VectorCopy(self->movedir,Arrow->movedir); - VectoAngles(Forward,Arrow->s.angles); + VectorCopy(self->movedir,arrow->movedir); + VectoAngles(Forward,arrow->s.angles); VectorClear(check_lead); if(skill->value > 1) { - extrapolateFiredir(self, Arrow->s.origin, + extrapolateFiredir(self, arrow->s.origin, SSITHRA_SPOO_SPEED, self->enemy, 0.3, check_lead); } else { - VectorSubtract(self->enemy->s.origin, Arrow->s.origin, enemy_dir); + VectorSubtract(self->enemy->s.origin, arrow->s.origin, enemy_dir); VectorNormalize(enemy_dir); if(DotProduct(enemy_dir, Forward) >= 0.3) { @@ -2412,31 +2412,31 @@ void ssithraDoDuckArrow(edict_t *self, float z_offs) if(Vec3IsZero(check_lead)) { - VectorScale(Forward,SSITHRA_SPOO_SPEED*1.5,Arrow->velocity); + VectorScale(Forward,SSITHRA_SPOO_SPEED*1.5,arrow->velocity); } else { - VectorScale(check_lead,SSITHRA_SPOO_SPEED*1.5,Arrow->velocity); + VectorScale(check_lead,SSITHRA_SPOO_SPEED*1.5,arrow->velocity); } - VectorCopy(Arrow->velocity, Arrow->movedir); - VectorNormalize(Arrow->movedir); - VectoAngles(Arrow->movedir, Arrow->s.angles); - Arrow->s.angles[PITCH] = anglemod(Arrow->s.angles[PITCH] * -1); - Arrow->s.angles[YAW] += 90; + VectorCopy(arrow->velocity, arrow->movedir); + VectorNormalize(arrow->movedir); + VectoAngles(arrow->movedir, arrow->s.angles); + arrow->s.angles[PITCH] = anglemod(arrow->s.angles[PITCH] * -1); + arrow->s.angles[YAW] += 90; - gi.CreateEffect(&Arrow->s, + gi.CreateEffect(arrow, FX_M_EFFECTS, CEF_OWNERS_ORIGIN | CEF_FLAG6, - Arrow->s.origin, + arrow->s.origin, "bv", FX_MSSITHRA_ARROW, - Arrow->velocity); + arrow->velocity); - G_LinkMissile(Arrow); + G_LinkMissile(arrow); - Arrow->nextthink=level.time+5; - Arrow->think=ssithraArrowExplode; + arrow->nextthink=level.time+5; + arrow->think=ssithraArrowExplode; } void ssithraStartDuckArrow(edict_t *self) @@ -2485,7 +2485,7 @@ void ssithraArrow(edict_t *self) void ssithraPanicArrow(edict_t *self) {//fixme; adjust for up/down vec3_t Forward,firedir;//, up; - edict_t *Arrow; + edict_t *arrow; if(self->s.fmnodeinfo[MESH__RIGHTARM].flags&FMNI_NO_DRAW) { @@ -2497,40 +2497,40 @@ void ssithraPanicArrow(edict_t *self) // gi.dprintf("Ssithra fire panic arrow\n"); gi.sound(self,CHAN_WEAPON,Sounds[SND_ARROW2],1,ATTN_NORM,0); self->monsterinfo.attack_finished = level.time + 0.4; - Arrow = G_Spawn(); + arrow = G_Spawn(); -// Arrow->s.modelindex=gi.modelindex("models/objects/projectiles/sitharrow/tris.fm"); +// arrow->s.modelindex=gi.modelindex("models/objects/projectiles/sitharrow/tris.fm"); - create_ssith_arrow(Arrow); + create_ssith_arrow(arrow); - Arrow->owner=self; + arrow->owner=self; - Arrow->health = 1; // tell the touch function what kind of arrow we are; + arrow->health = 1; // tell the touch function what kind of arrow we are; VectorAdd(self->s.angles,self->v_angle_ofs,firedir); AngleVectors(firedir,Forward,NULL,NULL); - VectorCopy(self->s.origin,Arrow->s.origin); - VectorMA(Arrow->s.origin,12,Forward,Arrow->s.origin); - VectorCopy(self->movedir,Arrow->movedir); - VectoAngles(Forward,Arrow->s.angles); + VectorCopy(self->s.origin,arrow->s.origin); + VectorMA(arrow->s.origin,12,Forward,arrow->s.origin); + VectorCopy(self->movedir,arrow->movedir); + VectoAngles(Forward,arrow->s.angles); - VectorScale(Forward,SSITHRA_SPOO_SPEED,Arrow->velocity); + VectorScale(Forward,SSITHRA_SPOO_SPEED,arrow->velocity); - VectoAngles(Arrow->velocity, Arrow->s.angles); - Arrow->s.angles[YAW]+=90; + VectoAngles(arrow->velocity, arrow->s.angles); + arrow->s.angles[YAW]+=90; //fixme: redo these- make them look like squid ink? - gi.CreateEffect(&Arrow->s, + gi.CreateEffect(arrow, FX_SSITHRA_ARROW, CEF_OWNERS_ORIGIN, NULL, "bv", FX_SS_MAKE_ARROW, - Arrow->velocity); + arrow->velocity); - G_LinkMissile(Arrow); + G_LinkMissile(arrow); - Arrow->nextthink=level.time+3; - Arrow->think=G_FreeEdict;//ssithraArrowThink; + arrow->nextthink=level.time+3; + arrow->think=G_FreeEdict;//ssithraArrowThink; } void ssithra_water_shoot (edict_t *self) diff --git a/src/game/monster/priestess/priestess.c b/src/game/monster/priestess/priestess.c index 947005f54..2e8e3a4bf 100644 --- a/src/game/monster/priestess/priestess.c +++ b/src/game/monster/priestess/priestess.c @@ -334,7 +334,7 @@ void priestess_proj1_think( edict_t *self ) { gi.sound (self, CHAN_BODY, sounds[SND_BALLHIT], 1, ATTN_NORM, 0); - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_HP_MISSILE, CEF_OWNERS_ORIGIN, self->s.origin, @@ -385,7 +385,7 @@ priestess_proj2_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int da { gi.sound (self, CHAN_AUTO, sounds[SND_BUGHIT], 1, ATTN_NORM, 0); - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_HP_MISSILE, CEF_OWNERS_ORIGIN, self->s.origin, @@ -408,7 +408,7 @@ void priestess_proj2_think( edict_t *self ) { gi.sound (self, CHAN_AUTO, sounds[SND_BUGHIT], 1, ATTN_NORM, 0); - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_HP_MISSILE, CEF_OWNERS_ORIGIN, self->s.origin, @@ -477,7 +477,7 @@ void priestess_proj1_blocked( edict_t *self, trace_t *trace ) break; } - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_HP_MISSILE, CEF_OWNERS_ORIGIN, self->s.origin, @@ -532,7 +532,7 @@ void priestess_proj1_blocked( edict_t *self, trace_t *trace ) T_Damage( trace->ent, self, self->owner, hitDir, self->s.origin, trace->plane.normal, damage, 0, DAMAGE_SPELL | DAMAGE_NO_KNOCKBACK,MOD_DIED ); } - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_HP_MISSILE, CEF_OWNERS_ORIGIN, self->s.origin, @@ -693,7 +693,7 @@ void priestess_fire1( edict_t *self, float pitch_ofs, float yaw_ofs, float roll_ if (!irand(0,10)) proj->think = priestess_proj1_drunken; - gi.CreateEffect(&proj->s, + gi.CreateEffect(proj, FX_HP_MISSILE, CEF_OWNERS_ORIGIN, NULL, @@ -754,7 +754,7 @@ void priestess_fire2( edict_t *self, float pitch_ofs, float yaw_ofs, float roll_ gi.sound (self, CHAN_AUTO, sounds[SND_HOMINGATK], 1, ATTN_NORM, 0); - gi.CreateEffect(&proj->s, + gi.CreateEffect(proj, FX_HP_MISSILE, CEF_OWNERS_ORIGIN, proj->s.origin, @@ -827,7 +827,7 @@ void priestess_fire3( edict_t *self, float pitch_ofs, float yaw_ofs, float roll_ gi.sound (self, CHAN_AUTO, sounds[SND_BUGS], 1, ATTN_NORM, 0); - gi.CreateEffect(&proj->s, + gi.CreateEffect(proj, FX_HP_MISSILE, CEF_OWNERS_ORIGIN, startPos, @@ -1444,7 +1444,7 @@ void priestess_dead( edict_t *self ) gi.RemovePersistantEffect(self->PersistantCFX, REMOVE_PRIESTESS); self->PersistantCFX = 0; } - gi.RemoveEffects(&self->s, 0); + gi.RemoveEffects(self, 0); gi.linkentity(self); @@ -1672,7 +1672,7 @@ void SP_monster_high_priestess (edict_t *self) MG_InitMoods( self ); //Setup her reference points - self->PersistantCFX = gi.CreatePersistantEffect(&self->s, + self->PersistantCFX = gi.CreatePersistantEffect(self, FX_HP_STAFF, CEF_OWNERS_ORIGIN | CEF_BROADCAST, vec3_origin, diff --git a/src/game/monster/seraph/seraph_guard.c b/src/game/monster/seraph/seraph_guard.c index 1c3559fcc..cbee651f6 100644 --- a/src/game/monster/seraph/seraph_guard.c +++ b/src/game/monster/seraph/seraph_guard.c @@ -115,7 +115,7 @@ void guard_beam_blocked( edict_t *self, trace_t *trace ) Vec3ScaleAssign(proj->ideal_yaw,proj->velocity); VectoAngles(proj->velocity, proj->s.angles); - gi.CreateEffect(&proj->s, + gi.CreateEffect(proj, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, NULL, @@ -144,7 +144,7 @@ void guard_beam_blocked( edict_t *self, trace_t *trace ) gi.sound(self, CHAN_WEAPON, gi.soundindex("monsters/seraph/guard/spellhit.wav"), 1, ATTN_NORM, 0); - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, self->s.origin, @@ -201,7 +201,7 @@ void guard_beam( edict_t *self) gi.sound(self, CHAN_WEAPON, gi.soundindex("monsters/seraph/guard/spell.wav"), 1, ATTN_NORM, 0); - gi.CreateEffect(&proj->s, + gi.CreateEffect(proj, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, vec3_origin, diff --git a/src/game/monster/spreader/spreader.c b/src/game/monster/spreader/spreader.c index 387ff2fac..d245085e3 100644 --- a/src/game/monster/spreader/spreader.c +++ b/src/game/monster/spreader/spreader.c @@ -232,7 +232,7 @@ void spreader_dead(edict_t *self) gas->svflags |= SVF_ALWAYS_SEND; gas->s.effects=EF_MARCUS_FLAG1; - gi.CreateEffect(&gas->s, FX_PLAGUEMIST, CEF_OWNERS_ORIGIN, offset, "vb", spraydir, 100);//sprayorg, not offset? + gi.CreateEffect(gas, FX_PLAGUEMIST, CEF_OWNERS_ORIGIN, offset, "vb", spraydir, 100);//sprayorg, not offset? } M_EndDeath(self); @@ -1013,7 +1013,7 @@ void spreaderTakeOff (edict_t *self) gas->svflags |= SVF_ALWAYS_SEND; gas->s.effects=EF_MARCUS_FLAG1; - gi.CreateEffect(&gas->s, FX_PLAGUEMISTEXPLODE, CEF_OWNERS_ORIGIN, self->pos1, "b", 70); + gi.CreateEffect(gas, FX_PLAGUEMISTEXPLODE, CEF_OWNERS_ORIGIN, self->pos1, "b", 70); gi.sound(self, CHAN_VOICE, sounds[SND_PAIN], 1, ATTN_NORM, 0); gi.sound(self, CHAN_WEAPON, sounds[SND_SPRAYSTART], 1, ATTN_NORM, 0); @@ -1173,7 +1173,7 @@ void spreaderFlyLoop (edict_t *self) void spreader_land(edict_t *self) { gi.sound(self, CHAN_BODY, gi.soundindex("misc/land.wav"), 1, ATTN_NORM, 0); - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_DUST_PUFF, CEF_OWNERS_ORIGIN, self->s.origin, diff --git a/src/game/monster/spreader/spreadermist.c b/src/game/monster/spreader/spreadermist.c index 1957a51ed..d13719edf 100644 --- a/src/game/monster/spreader/spreadermist.c +++ b/src/game/monster/spreader/spreadermist.c @@ -236,7 +236,7 @@ static void spreader_grenade_bounce ( edict_t *self, trace_t *trace ) gas->svflags |= SVF_ALWAYS_SEND; gas->s.effects = EF_MARCUS_FLAG1; */ - gi.CreateEffect(&self->s, FX_PLAGUEMIST, CEF_OWNERS_ORIGIN, self->s.origin, "vb", vel, 50); + gi.CreateEffect(self, FX_PLAGUEMIST, CEF_OWNERS_ORIGIN, self->s.origin, "vb", vel, 50); spreader_grenade_explode (self); } @@ -284,7 +284,7 @@ static void spreader_grenade_touch (edict_t *self, edict_t *other, cplane_t *pla gas->svflags |= SVF_ALWAYS_SEND; gas->s.effects = EF_MARCUS_FLAG1; */ - gi.CreateEffect(&self->s, FX_PLAGUEMIST, CEF_OWNERS_ORIGIN, self->s.origin, "vb", vel, 50); + gi.CreateEffect(self, FX_PLAGUEMIST, CEF_OWNERS_ORIGIN, self->s.origin, "vb", vel, 50); spreader_grenade_explode (self); diff --git a/src/game/monster/tcheckrik/tcheckrik.c b/src/game/monster/tcheckrik/tcheckrik.c index bc4427c4b..ad6aaeefb 100644 --- a/src/game/monster/tcheckrik/tcheckrik.c +++ b/src/game/monster/tcheckrik/tcheckrik.c @@ -270,7 +270,7 @@ void insectCut (edict_t *self, float attacktype) T_Damage (trace.ent, self, self, dir, trace.endpos, vec3_origin, damage, damage*2, DAMAGE_DISMEMBER,MOD_DIED); -/* gi.CreateEffect(&self->s, +/* gi.CreateEffect(self, FX_I_EFFECTS, 0, vec3_origin, @@ -400,7 +400,7 @@ void insect_death(edict_t *self, G_Message_t *msg) if(self->deadflag == DEAD_DEAD) //Dead but still being hit return; - gi.RemoveEffects(&self->s, FX_I_EFFECTS); + gi.RemoveEffects(self, FX_I_EFFECTS); self->s.effects |= EF_DISABLE_EXTRA_FX; self->deadflag = DEAD_DEAD; @@ -720,7 +720,7 @@ void insectSpell(edict_t *self, float whichspell) void insectReleaseSpell (edict_t *self) { - gi.RemoveEffects(&self->s, FX_I_EFFECTS); + gi.RemoveEffects(self, FX_I_EFFECTS); self->s.effects |= EF_DISABLE_EXTRA_FX | EF_MARCUS_FLAG1; self->damage_debounce_time = true; } @@ -1154,7 +1154,7 @@ void insect_pain(edict_t *self, G_Message_t *msg) if(!force_damage&&flrand(0,self->health)>damage) return; - gi.RemoveEffects(&self->s, FX_I_EFFECTS); + gi.RemoveEffects(self, FX_I_EFFECTS); self->s.effects |= EF_DISABLE_EXTRA_FX; //sound insect_random_pain_sound(self); @@ -1732,7 +1732,7 @@ void SP_monster_tcheckrik_male (edict_t *self) G_QPostMessage(self,MSG_STAND,PRI_DIRECTIVE, NULL); } - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_I_EFFECTS, CEF_OWNERS_ORIGIN, vec3_origin, @@ -1884,7 +1884,7 @@ void SP_monster_tcheckrik_female (edict_t *self) self->monsterinfo.aiflags |= AI_NO_MELEE; - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_I_EFFECTS, CEF_OWNERS_ORIGIN, vec3_origin, diff --git a/src/game/monster/tcheckrik/tcheckrik_spells.c b/src/game/monster/tcheckrik/tcheckrik_spells.c index 4cc5e45e6..03d50552c 100644 --- a/src/game/monster/tcheckrik/tcheckrik_spells.c +++ b/src/game/monster/tcheckrik/tcheckrik_spells.c @@ -97,7 +97,7 @@ static void InsectStaffTouch(edict_t *self,edict_t *Other,cplane_t *Plane,csurfa G_LinkMissile(InsectStaff); - gi.CreateEffect(&InsectStaff->s, + gi.CreateEffect(InsectStaff, FX_I_EFFECTS, CEF_OWNERS_ORIGIN, vec3_origin, @@ -148,7 +148,7 @@ static void InsectStaffTouch(edict_t *self,edict_t *Other,cplane_t *Plane,csurfa { gi.sound(self, CHAN_BODY, gi.soundindex("monsters/imp/fbfire.wav"), 1, ATTN_NORM, 0); - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_M_EFFECTS, CEF_OWNERS_ORIGIN, self->s.origin, @@ -207,7 +207,7 @@ void SpellCastInsectStaff(edict_t *Caster,vec3_t StartPos,vec3_t AimAngles,vec3_ Vec3ScaleAssign(2, InsectStaff->velocity); InsectStaff->dmg *= 2; InsectStaff->count = 1; - gi.CreateEffect(&InsectStaff->s, + gi.CreateEffect(InsectStaff, FX_M_EFFECTS,//just so I don't have to make a new FX_ id CEF_OWNERS_ORIGIN, NULL, @@ -218,7 +218,7 @@ void SpellCastInsectStaff(edict_t *Caster,vec3_t StartPos,vec3_t AimAngles,vec3_ else { InsectStaff->count = 0; - gi.CreateEffect(&InsectStaff->s, + gi.CreateEffect(InsectStaff, FX_I_EFFECTS, CEF_OWNERS_ORIGIN, vec3_origin, @@ -246,7 +246,7 @@ static void GlobeOfOuchinessGrowThink(edict_t *self) if(self->owner->s.effects&EF_DISABLE_EXTRA_FX) { - gi.RemoveEffects(&self->s,0); + gi.RemoveEffects(self,0); G_FreeEdict(self); return; } @@ -346,7 +346,7 @@ void SpellCastGlobeOfOuchiness(edict_t *Caster,vec3_t StartPos,vec3_t AimAngles, VectorSet(tempvec, (float)(Caster->s.number), 0, 0); - gi.CreateEffect(&Globe->s, + gi.CreateEffect(Globe, FX_I_EFFECTS, CEF_OWNERS_ORIGIN, vec3_origin, @@ -354,7 +354,7 @@ void SpellCastGlobeOfOuchiness(edict_t *Caster,vec3_t StartPos,vec3_t AimAngles, FX_I_GLOBE, tempvec); - gi.CreateEffect(&Globe->s, + gi.CreateEffect(Globe, FX_I_EFFECTS, CEF_OWNERS_ORIGIN, vec3_origin, @@ -428,7 +428,7 @@ edict_t *SpearProjReflect(edict_t *self, edict_t *other, vec3_t vel) spearproj->red_rain_count = self->red_rain_count; if (spearproj->health == 1) { - gi.CreateEffect(&spearproj->s, + gi.CreateEffect(spearproj, FX_I_EFFECTS, CEF_OWNERS_ORIGIN, NULL, @@ -438,7 +438,7 @@ edict_t *SpearProjReflect(edict_t *self, edict_t *other, vec3_t vel) } else { - gi.CreateEffect(&spearproj->s, + gi.CreateEffect(spearproj, FX_I_EFFECTS, CEF_OWNERS_ORIGIN, vec3_origin, @@ -518,7 +518,7 @@ static void SpearProjTouch(edict_t *self, edict_t *other, cplane_t *plane, csurf if(self->count) { - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_I_EFFECTS, makeScorch, vec3_origin, @@ -528,7 +528,7 @@ static void SpearProjTouch(edict_t *self, edict_t *other, cplane_t *plane, csurf } else { - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_I_EFFECTS, makeScorch, vec3_origin, @@ -671,7 +671,7 @@ void SpellCastInsectSpear(edict_t *caster, vec3_t StartPos, vec3_t AimAngles, in spearproj->health = 1; // To indicate the homing projectile spearproj->red_rain_count = 1; - gi.CreateEffect(&spearproj->s, + gi.CreateEffect(spearproj, FX_I_EFFECTS, CEF_OWNERS_ORIGIN, NULL, @@ -682,7 +682,7 @@ void SpellCastInsectSpear(edict_t *caster, vec3_t StartPos, vec3_t AimAngles, in else { spearproj->count = 0; - gi.CreateEffect(&spearproj->s, + gi.CreateEffect(spearproj, FX_I_EFFECTS, CEF_OWNERS_ORIGIN, vec3_origin, diff --git a/src/game/player/client.c b/src/game/player/client.c index 46c5e525b..1c9d95c6d 100644 --- a/src/game/player/client.c +++ b/src/game/player/client.c @@ -218,7 +218,7 @@ SpawnBleeder(edict_t *self, edict_t *other, vec3_t bleed_dir, vec3_t bleed_spot) bleeder->think = BleederThink; bleeder->nextthink = level.time + 0.1; //when refpoints on arms and head in for corvus, do this: -/* gi.CreateEffect(&self->s., +/* gi.CreateEffect(self., FX_LINKEDBLOOD, 0, self->s.origin, @@ -889,15 +889,15 @@ void player_leader_effect(void) if (ent->client->resp.score == score && ent->inuse) { if (!ent->Leader_PersistantCFX) - ent->Leader_PersistantCFX = gi.CreatePersistantEffect - (&ent->s, FX_SHOW_LEADER, CEF_BROADCAST|CEF_OWNERS_ORIGIN, NULL, "" ); + ent->Leader_PersistantCFX = gi.CreatePersistantEffect( + ent, FX_SHOW_LEADER, CEF_BROADCAST|CEF_OWNERS_ORIGIN, NULL, "" ); } // if not, then if we have the effect, remove it else if (ent->Leader_PersistantCFX) { gi.RemovePersistantEffect(ent->Leader_PersistantCFX, REMOVE_LEADER); - gi.RemoveEffects(&ent->s, FX_SHOW_LEADER); + gi.RemoveEffects(ent, FX_SHOW_LEADER); ent->Leader_PersistantCFX =0; } @@ -1193,7 +1193,7 @@ player_die(edict_t *self, edict_t *inflictor, edict_t *attacker, if (self->client->Meteors[i]->PersistantCFX) { gi.RemovePersistantEffect(self->client->Meteors[i]->PersistantCFX, REMOVE_METEOR); - gi.RemoveEffects(&self->s, FX_SPELL_METEORBARRIER+i); + gi.RemoveEffects(self, FX_SPELL_METEORBARRIER+i); self->client->Meteors[i]->PersistantCFX = 0; } G_SetToFree(self->client->Meteors[i]); @@ -1206,12 +1206,12 @@ player_die(edict_t *self, edict_t *inflictor, edict_t *attacker, // Create a persistant FX_REMOVE_EFFECTS effect - this is a special hack. If we just created // a regular FX_REMOVE_EFFECTS effect, it will overwrite the next FX_PLAYER_PERSISTANT sent // out. Luverly jubberly!!! - gi.CreatePersistantEffect(&self->s,FX_REMOVE_EFFECTS,CEF_BROADCAST|CEF_OWNERS_ORIGIN,NULL,"s",0); + gi.CreatePersistantEffect(self,FX_REMOVE_EFFECTS,CEF_BROADCAST|CEF_OWNERS_ORIGIN,NULL,"s",0); // Get rid of all the stuff set up in PlayerFirstSeenInit... - gi.RemoveEffects(&self->s, FX_SHADOW); - gi.RemoveEffects(&self->s, FX_WATER_PARTICLES); - gi.RemoveEffects(&self->s, FX_CROSSHAIR); + gi.RemoveEffects(self, FX_SHADOW); + gi.RemoveEffects(self, FX_WATER_PARTICLES); + gi.RemoveEffects(self, FX_CROSSHAIR); // Remove any shrine effects we have going. PlayerKillShrineFX(self); @@ -1897,7 +1897,7 @@ respawn(edict_t *self) // a regular FX_REMOVE_EFFECTS effect, it will overwrite the next FX_PLAYER_PERSISTANT sent // out. Luverly jubberly!!! - gi.CreatePersistantEffect(&self->s,FX_REMOVE_EFFECTS,CEF_BROADCAST|CEF_OWNERS_ORIGIN,NULL,"s",0); + gi.CreatePersistantEffect(self,FX_REMOVE_EFFECTS,CEF_BROADCAST|CEF_OWNERS_ORIGIN,NULL,"s",0); if(deathmatch->value) { @@ -1920,7 +1920,7 @@ respawn(edict_t *self) // Add a teleportation effect. - 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); // Hold in place briefly. @@ -2060,7 +2060,7 @@ void SpawnInitialPlayerEffects(edict_t *ent) // Don't need to keep track of this persistant effect, since its started but never stopped. // jmarshall - this doesn't seem to be used anywhere? - //gi.CreatePersistantEffect(&ent->s, FX_PLAYER_PERSISTANT, + //gi.CreatePersistantEffect(ent, FX_PLAYER_PERSISTANT, // CEF_BROADCAST | CEF_OWNERS_ORIGIN, NULL, ""); // jmarshall end @@ -2660,7 +2660,7 @@ PutClientInServer(edict_t *ent) // Just in case we were on fire when we died. - gi.RemoveEffects(&ent->s, FX_FIRE_ON_ENTITY); + gi.RemoveEffects(ent, FX_FIRE_ON_ENTITY); // Make us invincible for a few seconds after spawn. @@ -2728,7 +2728,7 @@ ClientBeginDeathmatch(edict_t *ent) // level. gi.sound(ent,CHAN_WEAPON,gi.soundindex("weapons/teleport.wav"),1,ATTN_NORM,0); - gi.CreateEffect(&ent->s, FX_PLAYER_TELEPORT_IN, CEF_OWNERS_ORIGIN, ent->s.origin, NULL); + gi.CreateEffect(ent, FX_PLAYER_TELEPORT_IN, CEF_OWNERS_ORIGIN, ent->s.origin, NULL); G_BroadcastObituary(PRINT_HIGH, GM_ENTERED, ent->s.number, 0); /* make sure all view stuff is valid */ @@ -2814,7 +2814,7 @@ ClientBegin(edict_t *ent) // level. gi.sound(ent,CHAN_WEAPON,gi.soundindex("weapons/teleport.wav"),1,ATTN_NORM,0); - gi.CreateEffect(&ent->s, FX_PLAYER_TELEPORT_IN, CEF_OWNERS_ORIGIN, ent->s.origin, NULL); + gi.CreateEffect(ent, FX_PLAYER_TELEPORT_IN, CEF_OWNERS_ORIGIN, ent->s.origin, NULL); G_BroadcastObituary (PRINT_HIGH, GM_ENTERED, ent->s.number, 0); } } @@ -3238,14 +3238,14 @@ ClientDisconnect(edict_t *ent) // Send teleport effect. - gi.CreateEffect(&ent->s, FX_PLAYER_TELEPORT_OUT, CEF_OWNERS_ORIGIN, ent->s.origin, NULL); + gi.CreateEffect(ent, FX_PLAYER_TELEPORT_OUT, CEF_OWNERS_ORIGIN, ent->s.origin, NULL); // Clean up after leaving. if (ent->Leader_PersistantCFX) { gi.RemovePersistantEffect(ent->Leader_PersistantCFX, REMOVE_LEADER_CLIENT); - gi.RemoveEffects(&ent->s, FX_SHOW_LEADER); + gi.RemoveEffects(ent, FX_SHOW_LEADER); ent->Leader_PersistantCFX =0; } diff --git a/src/game/player/funcs.c b/src/game/player/funcs.c index cfa791d91..9cf845cca 100644 --- a/src/game/player/funcs.c +++ b/src/game/player/funcs.c @@ -974,7 +974,7 @@ void PlayerChickenDeath(edict_t *self) //gi.sound (self, CHAN_BODY, sounds[SND_GIB], 1, ATTN_NORM, 0); self->deadflag = DEAD_DEAD; self->client->playerinfo.deadflag = DEAD_DEAD; - gi.CreateEffect(&self->s, FX_CHICKEN_EXPLODE, CEF_OWNERS_ORIGIN, NULL, "" ); + gi.CreateEffect(self, FX_CHICKEN_EXPLODE, CEF_OWNERS_ORIGIN, NULL, "" ); // fix that respawning bug self->morph_timer = level.time -1; diff --git a/src/game/player/library/p_actions.c b/src/game/player/library/p_actions.c index ff90defab..56e861ebc 100644 --- a/src/game/player/library/p_actions.c +++ b/src/game/player/library/p_actions.c @@ -899,7 +899,7 @@ void PlayerActionWeaponChange(playerinfo_t *playerinfo, float value) if(!playerinfo->isclient) { playerinfo->G_CreateEffect(EFFECT_PRED_ID3, - playerinfo->G_GetEntityStatePtr((edict_t *)playerinfo->self), + playerinfo->self, FX_STAFF_CREATEPOOF, CEF_OWNERS_ORIGIN, NULL, @@ -918,7 +918,7 @@ void PlayerActionWeaponChange(playerinfo_t *playerinfo, float value) if(!playerinfo->isclient) playerinfo->G_CreateEffect(EFFECT_PRED_ID4, - playerinfo->G_GetEntityStatePtr((edict_t *)playerinfo->self), + playerinfo->self, FX_STAFF_CREATEPOOF, CEF_OWNERS_ORIGIN|CEF_FLAG6, NULL, @@ -1192,7 +1192,7 @@ void PlayerActionStartStaffGlow(playerinfo_t *playerinfo, float value) 0); playerinfo->G_CreateEffect(EFFECT_PRED_ID7, - (entity_state_t *)playerinfo->self, // jmarshall: I think this is right. + playerinfo->self, // jmarshall: I think this is right. FX_STAFF_CREATE, flags, NULL, @@ -1321,7 +1321,7 @@ void PlayerActionEndStaffGlow(playerinfo_t *playerinfo, float value) } playerinfo->G_CreateEffect(EFFECT_PRED_ID8, - playerinfo->G_GetEntityStatePtr((edict_t *)playerinfo->self), + playerinfo->self, FX_STAFF_REMOVE, flags, NULL, @@ -3691,7 +3691,7 @@ void SpawnDustPuff(playerinfo_t *playerinfo, float dist) { if(!playerinfo->isclient) playerinfo->G_CreateEffect(EFFECT_PRED_ID10, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_DUST_PUFF, CEF_OWNERS_ORIGIN, playerinfo->origin, diff --git a/src/game/player/library/p_animactor.c b/src/game/player/library/p_animactor.c index d1bbda581..23a2b3e44 100644 --- a/src/game/player/library/p_animactor.c +++ b/src/game/player/library/p_animactor.c @@ -179,7 +179,7 @@ void TurnOffPlayerEffects(playerinfo_t *playerinfo) { if(!playerinfo->isclient) playerinfo->G_RemoveEffects(EFFECT_PRED_ID26, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_SPELLHANDS); else playerinfo->CL_RemoveEffects(EFFECT_PRED_ID26, @@ -195,7 +195,7 @@ void TurnOffPlayerEffects(playerinfo_t *playerinfo) { if(!playerinfo->isclient) playerinfo->G_RemoveEffects(EFFECT_PRED_ID27, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_WEAPON_REDRAINGLOW); else playerinfo->CL_RemoveEffects(EFFECT_PRED_ID27, @@ -212,7 +212,7 @@ void TurnOffPlayerEffects(playerinfo_t *playerinfo) { if(!playerinfo->isclient) playerinfo->G_RemoveEffects(EFFECT_PRED_ID28, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_FIREHANDS); else playerinfo->CL_RemoveEffects(EFFECT_PRED_ID28, @@ -229,7 +229,7 @@ void TurnOffPlayerEffects(playerinfo_t *playerinfo) { if(!playerinfo->isclient) playerinfo->G_RemoveEffects(EFFECT_PRED_ID29, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_STAFF); else playerinfo->CL_RemoveEffects(EFFECT_PRED_ID29, @@ -783,7 +783,7 @@ void PlayerFallingDamage(playerinfo_t *playerinfo) if(!playerinfo->isclient) playerinfo->G_CreateEffect(EFFECT_PRED_ID11, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_FOOTSTEP, CEF_OWNERS_ORIGIN, playerinfo->origin, @@ -812,7 +812,7 @@ void PlayerFallingDamage(playerinfo_t *playerinfo) if(!playerinfo->isclient) playerinfo->G_CreateEffect(EFFECT_PRED_ID12, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_FALLSHORT, CEF_OWNERS_ORIGIN, playerinfo->origin, diff --git a/src/game/player/library/p_chicken.c b/src/game/player/library/p_chicken.c index 7d1a67034..6cee5b366 100644 --- a/src/game/player/library/p_chicken.c +++ b/src/game/player/library/p_chicken.c @@ -246,7 +246,7 @@ void PlayerChickenCheckFlap (playerinfo_t *playerinfo) if(!playerinfo->isclient) playerinfo->G_CreateEffect(EFFECT_PRED_ID13, - playerinfo->G_GetEntityStatePtr((edict_t *)playerinfo->self), + playerinfo->self, FX_CHICKEN_EXPLODE, CEF_OWNERS_ORIGIN | CEF_FLAG6, NULL, @@ -278,7 +278,7 @@ void PlayerChickenFlap (playerinfo_t *playerinfo) if(!playerinfo->isclient) playerinfo->G_CreateEffect(EFFECT_PRED_ID14, - (entity_state_t *)playerinfo->self, // jmarshall: believe this is right. + playerinfo->self, // jmarshall: believe this is right. FX_CHICKEN_EXPLODE, CEF_OWNERS_ORIGIN | CEF_FLAG6, NULL, diff --git a/src/game/player/library/p_ctrl.c b/src/game/player/library/p_ctrl.c index 80159ce7f..d33733777 100644 --- a/src/game/player/library/p_ctrl.c +++ b/src/game/player/library/p_ctrl.c @@ -245,7 +245,7 @@ void PlayerIntLand(playerinfo_t *playerinfo, float landspeed) if(playerinfo->waterlevel == 0) if(!playerinfo->isclient) playerinfo->G_CreateEffect(EFFECT_PRED_ID15, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_DUST_PUFF, CEF_OWNERS_ORIGIN, playerinfo->origin, diff --git a/src/game/player/library/p_main.c b/src/game/player/library/p_main.c index e47210140..0f9d0b763 100644 --- a/src/game/player/library/p_main.c +++ b/src/game/player/library/p_main.c @@ -39,7 +39,7 @@ PlayerClearEffects(playerinfo_t *playerinfo) // Remove all special effects from the player. if(!playerinfo->isclient) playerinfo->G_RemoveEffects(EFFECT_PRED_ID30, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_REMOVE_EFFECTS); else playerinfo->CL_RemoveEffects(EFFECT_PRED_ID30, @@ -761,7 +761,7 @@ PlayerSetHandFX(playerinfo_t *playerinfo, int handfx, int lifetime) lifetime = 4; // .4 seconds is normal fireball throw time. if(!playerinfo->isclient) playerinfo->G_CreateEffect(EFFECT_PRED_ID16, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_SPELLHANDS, CEF_OWNERS_ORIGIN, NULL, @@ -783,7 +783,7 @@ PlayerSetHandFX(playerinfo_t *playerinfo, int handfx, int lifetime) lifetime = 6; // .6 seconds is normal fireball throw time if(!playerinfo->isclient) playerinfo->G_CreateEffect(EFFECT_PRED_ID17, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_SPELLHANDS, CEF_OWNERS_ORIGIN|CEF_FLAG8, NULL, @@ -804,7 +804,7 @@ PlayerSetHandFX(playerinfo_t *playerinfo, int handfx, int lifetime) lifetime = 11; // 1.1 seconds is normal fireball throw time if(!playerinfo->isclient) playerinfo->G_CreateEffect(EFFECT_PRED_ID19, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_FIREHANDS, CEF_OWNERS_ORIGIN|CEF_FLAG6, NULL, @@ -836,7 +836,7 @@ PlayerSetHandFX(playerinfo_t *playerinfo, int handfx, int lifetime) if(!playerinfo->isclient) { playerinfo->G_CreateEffect(EFFECT_PRED_ID20, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_STAFF, CEF_OWNERS_ORIGIN, NULL, @@ -864,7 +864,7 @@ PlayerSetHandFX(playerinfo_t *playerinfo, int handfx, int lifetime) playerinfo->effects |= EF_TRAILS_ENABLED; // Set up for hand trails if(!playerinfo->isclient) playerinfo->G_CreateEffect(EFFECT_PRED_ID18, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_SPELLHANDS, CEF_OWNERS_ORIGIN|CEF_FLAG6|CEF_FLAG7, NULL, @@ -885,7 +885,7 @@ PlayerSetHandFX(playerinfo_t *playerinfo, int handfx, int lifetime) if(!playerinfo->isclient) { playerinfo->G_CreateEffect(EFFECT_PRED_ID21, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_WEAPON_REDRAINGLOW, CEF_OWNERS_ORIGIN, NULL, @@ -908,7 +908,7 @@ PlayerSetHandFX(playerinfo_t *playerinfo, int handfx, int lifetime) playerinfo->effects |= EF_TRAILS_ENABLED; // Set up for hand trails if(!playerinfo->isclient) playerinfo->G_CreateEffect(EFFECT_PRED_ID22, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_WEAPON_REDRAINGLOW, CEF_OWNERS_ORIGIN | CEF_FLAG6, NULL, @@ -929,7 +929,7 @@ PlayerSetHandFX(playerinfo_t *playerinfo, int handfx, int lifetime) playerinfo->effects |= EF_TRAILS_ENABLED; // Set up for hand trails if(!playerinfo->isclient) playerinfo->G_CreateEffect(EFFECT_PRED_ID23, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_FIREHANDS, CEF_OWNERS_ORIGIN, NULL, @@ -949,7 +949,7 @@ PlayerSetHandFX(playerinfo_t *playerinfo, int handfx, int lifetime) playerinfo->effects |= EF_TRAILS_ENABLED; // Set up for hand trails if(!playerinfo->isclient) playerinfo->G_CreateEffect(EFFECT_PRED_ID24, - playerinfo->G_GetEntityStatePtr(playerinfo->self), + playerinfo->self, FX_FIREHANDS, CEF_OWNERS_ORIGIN, NULL, diff --git a/src/game/player/library/p_types.h b/src/game/player/library/p_types.h index 52fa46554..8091c6e44 100644 --- a/src/game/player/library/p_types.h +++ b/src/game/player/library/p_types.h @@ -486,10 +486,10 @@ typedef struct playerinfo_s // Server (game) function callbacks (approximating functionality of client-side function callbacks). void (*G_L_Sound)(edict_t *entity,int sound_num); - void (*G_Sound)(byte EventId,float leveltime,edict_t *entity,int channel,int sound_num,float volume,float attenuation,float timeofs); + void (*G_Sound)(byte EventId,float leveltime, edict_t *entity,int channel,int sound_num,float volume,float attenuation,float timeofs); trace_t (*G_Trace)(vec3_t start,vec3_t mins,vec3_t maxs,vec3_t end,edict_t *passent,int contentmask); - void (*G_CreateEffect)(byte EventId,entity_state_t *state,int type,int flags,vec3_t origin,char *format,...); - void (*G_RemoveEffects)(byte Eventid,entity_state_t *state,int type); + void (*G_CreateEffect)(byte EventId, edict_t *state, int type, int flags, vec3_t origin, char *format,...); + void (*G_RemoveEffects)(byte Eventid, edict_t *state, int type); // Server (game) function callbacks that have no client side equivalent. diff --git a/src/game/player/weapon.c b/src/game/player/weapon.c index f7e283f93..64516c711 100644 --- a/src/game/player/weapon.c +++ b/src/game/player/weapon.c @@ -58,7 +58,7 @@ extern void SpellCastPhoenix(edict_t *Caster,vec3_t StartPos,vec3_t AimAngles,ve extern void SpellCastHellstaff(edict_t *Caster,vec3_t StartPos,vec3_t AimAngles,vec3_t AimDir); static void Weapon_CalcStartPos(vec3_t OriginToLowerJoint,vec3_t OriginToUpperJoint, - vec3_t DefaultStartPos,vec3_t ActualStartPos,edict_t *Caster); + vec3_t DefaultStartPos,vec3_t ActualStartPos, edict_t *caster); extern void AlertMonsters (edict_t *self, edict_t *enemy, float lifetime, qboolean ignore_shadows); // ************************************************************************************************ @@ -74,7 +74,7 @@ extern void AlertMonsters (edict_t *self, edict_t *enemy, float lifetime, qboole // ************************************************************************************************* static void Weapon_CalcStartPos(vec3_t OriginToLowerJoint,vec3_t OriginToUpperJoint, - vec3_t DefaultStartPos,vec3_t ActualStartPos,edict_t *Caster) + vec3_t DefaultStartPos,vec3_t ActualStartPos, edict_t *caster) { matrix3_t LowerRotationMatrix,UpperRotationMatrix; vec3_t LowerbackJointAngles,UpperbackJointAngles, @@ -84,19 +84,19 @@ static void Weapon_CalcStartPos(vec3_t OriginToLowerJoint,vec3_t OriginToUpperJo // Get matrices corresponding to the current angles of the upper and lower back joints. - LowerbackJointAngles[PITCH]=GetJointAngle(Caster->s.rootJoint+CORVUS_LOWERBACK,PITCH); - LowerbackJointAngles[YAW]=GetJointAngle(Caster->s.rootJoint+CORVUS_LOWERBACK,YAW); - LowerbackJointAngles[ROLL]=GetJointAngle(Caster->s.rootJoint+CORVUS_LOWERBACK,ROLL); + LowerbackJointAngles[PITCH]=GetJointAngle(caster->s.rootJoint+CORVUS_LOWERBACK,PITCH); + LowerbackJointAngles[YAW]=GetJointAngle(caster->s.rootJoint+CORVUS_LOWERBACK,YAW); + LowerbackJointAngles[ROLL]=GetJointAngle(caster->s.rootJoint+CORVUS_LOWERBACK,ROLL); Matrix3FromAngles(LowerbackJointAngles,LowerRotationMatrix); - UpperbackJointAngles[PITCH]=GetJointAngle(Caster->s.rootJoint+CORVUS_UPPERBACK,PITCH); - UpperbackJointAngles[YAW]=GetJointAngle(Caster->s.rootJoint+CORVUS_UPPERBACK,YAW); - UpperbackJointAngles[ROLL]=GetJointAngle(Caster->s.rootJoint+CORVUS_UPPERBACK,ROLL); + UpperbackJointAngles[PITCH]=GetJointAngle(caster->s.rootJoint+CORVUS_UPPERBACK,PITCH); + UpperbackJointAngles[YAW]=GetJointAngle(caster->s.rootJoint+CORVUS_UPPERBACK,YAW); + UpperbackJointAngles[ROLL]=GetJointAngle(caster->s.rootJoint+CORVUS_UPPERBACK,ROLL); Matrix3FromAngles(UpperbackJointAngles,UpperRotationMatrix); // Get vector from player model's origin to upper joint. - VectorAdd(Caster->s.origin,OriginToUpperJoint,UpperJoint); + VectorAdd(caster->s.origin,OriginToUpperJoint,UpperJoint); // Get vector from lower joint to upper joint. @@ -104,8 +104,8 @@ static void Weapon_CalcStartPos(vec3_t OriginToLowerJoint,vec3_t OriginToUpperJo // Get vector from upper joint to the default flying-fist's start position. - AngleVectors(Caster->s.angles,Forward,Right,Up); - VectorMA(Caster->s.origin,DefaultStartPos[0],Right,StartPos); + AngleVectors(caster->s.angles,Forward,Right,Up); + VectorMA(caster->s.origin,DefaultStartPos[0],Right,StartPos); VectorMA(StartPos,DefaultStartPos[1],Forward,StartPos); VectorMA(StartPos,DefaultStartPos[2],Up,StartPos); VectorSubtract(StartPos,UpperJoint,StartPos); @@ -122,7 +122,7 @@ static void Weapon_CalcStartPos(vec3_t OriginToLowerJoint,vec3_t OriginToUpperJo // Finally, add on the model's origin to give the correct start position for the flying-fist. - VectorAdd(StartPos,Caster->s.origin,StartPos); + VectorAdd(StartPos,caster->s.origin,StartPos); VectorCopy(StartPos,ActualStartPos); } @@ -183,7 +183,7 @@ int sworddamage[STAFF_LEVEL_MAX][2] = { SWORD_POWER2_DMG_MIN, SWORD_POWER2_DMG_MAX }, // STAFF_LEVEL_POWER2 }; -void WeaponThink_SwordStaff(edict_t *Caster,char *Format,...) +void WeaponThink_SwordStaff(edict_t *caster, char *Format, ...) { va_list Marker; char CurrentChar; @@ -197,8 +197,8 @@ void WeaponThink_SwordStaff(edict_t *Caster,char *Format,...) trace_t trace; - assert(Caster->client); - playerinfo = &Caster->client->playerinfo; + assert(caster->client); + playerinfo = &caster->client->playerinfo; assert(playerinfo); powerlevel = playerinfo->pers.stafflevel; @@ -223,37 +223,37 @@ void WeaponThink_SwordStaff(edict_t *Caster,char *Format,...) locid=va_arg(Marker,int); va_end(Marker); - AngleVectors(Caster->client->aimangles, fwd, right, up); + AngleVectors(caster->client->aimangles, fwd, right, up); // Set up the area to check. VectorCopy(swordpositions[locid], atkpos); - VectorMA(Caster->s.origin, atkpos[0], fwd, endpos); + VectorMA(caster->s.origin, atkpos[0], fwd, endpos); VectorMA(endpos, -atkpos[1], right, endpos); VectorMA(endpos, atkpos[2], up, endpos); // Now if we are the first attack of this sweep (1, 5, 9, 13), starting in solid means a hit. If not, then we must avoid startsolid entities. if ((locid & 0x03) == 0x01) { // First check of the swing. - Caster->client->lastentityhit = NULL; + caster->client->lastentityhit = NULL; VectorCopy(endpos, startpos); } else { VectorCopy(swordpositions[locid-1], atkpos); - VectorMA(Caster->s.origin, atkpos[0], fwd, startpos); + VectorMA(caster->s.origin, atkpos[0], fwd, startpos); VectorMA(startpos, -atkpos[1], right, startpos); VectorMA(startpos, atkpos[2], up, startpos); } - startpos[2] += Caster->viewheight; - endpos[2] += Caster->viewheight; + startpos[2] += caster->viewheight; + endpos[2] += caster->viewheight; // For showing where the sword attacks are. // gi.CreateEffect(NULL, FX_TEST_BBOX, 0, endpos, "fff", maxs[0], mins[2], maxs[2]); - VectorCopy(endpos, Caster->client->laststaffpos); - Caster->client->laststaffuse = level.time; + VectorCopy(endpos, caster->client->laststaffpos); + caster->client->laststaffuse = level.time; - trace = gi.trace(startpos, mins, maxs, endpos, Caster, MASK_PLAYERSOLID|CONTENTS_DEADMONSTER); + trace = gi.trace(startpos, mins, maxs, endpos, caster, MASK_PLAYERSOLID|CONTENTS_DEADMONSTER); if(level.fighting_beast) { edict_t *ent; @@ -264,12 +264,12 @@ void WeaponThink_SwordStaff(edict_t *Caster,char *Format,...) if (trace.ent && trace.ent->takedamage) { - if (!trace.startsolid || trace.ent != Caster->client->lastentityhit) + if (!trace.startsolid || trace.ent != caster->client->lastentityhit) { if (playerinfo->advancedstaff && trace.ent->client && trace.ent->client->playerinfo.block_timer >= level.time) { // Crimminy, what if they're blocking? // Check angle - VectorSubtract(Caster->s.origin, trace.ent->s.origin, hitdir); + VectorSubtract(caster->s.origin, trace.ent->s.origin, hitdir); VectorNormalize(hitdir); VectoAngles(hitdir, hitangles); diffangles[YAW] = hitangles[YAW] - trace.ent->client->aimangles[YAW]; @@ -303,20 +303,20 @@ void WeaponThink_SwordStaff(edict_t *Caster,char *Format,...) hitdir); } - AlertMonsters (Caster, Caster, 1, true); + AlertMonsters(caster, caster, 1, true); switch(irand(1,3)) { case 1: - gi.sound(Caster, CHAN_AUTO, gi.soundindex("weapons/ArmorRic1.wav"), 1, ATTN_NORM, 0); + gi.sound(caster, CHAN_AUTO, gi.soundindex("weapons/ArmorRic1.wav"), 1, ATTN_NORM, 0); break; case 2: - gi.sound(Caster, CHAN_AUTO, gi.soundindex("weapons/ArmorRic2.wav"), 1, ATTN_NORM, 0); + gi.sound(caster, CHAN_AUTO, gi.soundindex("weapons/ArmorRic2.wav"), 1, ATTN_NORM, 0); break; case 3: - gi.sound(Caster, CHAN_AUTO, gi.soundindex("weapons/ArmorRic3.wav"), 1, ATTN_NORM, 0); + gi.sound(caster, CHAN_AUTO, gi.soundindex("weapons/ArmorRic3.wav"), 1, ATTN_NORM, 0); break; } - Caster->client->lastentityhit = trace.ent; + caster->client->lastentityhit = trace.ent; // Now we're in trouble, go into the attack recoil... switch((locid-1)>>2) @@ -382,21 +382,21 @@ void WeaponThink_SwordStaff(edict_t *Caster,char *Format,...) hitdir); } - AlertMonsters (Caster, Caster, 1, true); + AlertMonsters (caster, caster, 1, true); switch(irand(1,3)) { case 1: - gi.sound(Caster, CHAN_AUTO, gi.soundindex("weapons/ArmorRic1.wav"), 1, ATTN_NORM, 0); + gi.sound(caster, CHAN_AUTO, gi.soundindex("weapons/ArmorRic1.wav"), 1, ATTN_NORM, 0); break; case 2: - gi.sound(Caster, CHAN_AUTO, gi.soundindex("weapons/ArmorRic2.wav"), 1, ATTN_NORM, 0); + gi.sound(caster, CHAN_AUTO, gi.soundindex("weapons/ArmorRic2.wav"), 1, ATTN_NORM, 0); break; case 3: - gi.sound(Caster, CHAN_AUTO, gi.soundindex("weapons/ArmorRic3.wav"), 1, ATTN_NORM, 0); + gi.sound(caster, CHAN_AUTO, gi.soundindex("weapons/ArmorRic3.wav"), 1, ATTN_NORM, 0); break; } - Caster->client->lastentityhit = trace.ent; - trace.ent->client->lastentityhit = Caster; + caster->client->lastentityhit = trace.ent; + trace.ent->client->lastentityhit = caster; // Now we're in trouble, go into the attack recoil... switch((locid-1)>>2) @@ -437,7 +437,7 @@ void WeaponThink_SwordStaff(edict_t *Caster,char *Format,...) } } - if (CanDamage (trace.ent, Caster)) + if (CanDamage (trace.ent, caster)) { VectorSubtract(endpos, startpos, hitdir); VectorNormalize2(hitdir, hitdir); @@ -465,7 +465,7 @@ void WeaponThink_SwordStaff(edict_t *Caster,char *Format,...) break; } - if(Caster->client) + if(caster->client) { if(playerinfo->flags & PLAYER_FLAG_NO_LARM) { @@ -488,20 +488,20 @@ void WeaponThink_SwordStaff(edict_t *Caster,char *Format,...) break; } - T_Damage (trace.ent, Caster, Caster, fwd, trace.endpos, hitdir, damage, damage*4, dflags,MOD_STAFF); + T_Damage (trace.ent, caster, caster, fwd, trace.endpos, hitdir, damage, damage*4, dflags,MOD_STAFF); // If we hit a monster, stick a trail of blood on the staff... if (trace.ent->svflags & SVF_MONSTER) { if(trace.ent->materialtype == MAT_INSECT)//yellow blood - gi.CreateEffect(&Caster->s, FX_LINKEDBLOOD, CEF_FLAG8|CEF_OWNERS_ORIGIN, NULL, "bb", 30, CORVUS_BLADE); + gi.CreateEffect(caster, FX_LINKEDBLOOD, CEF_FLAG8|CEF_OWNERS_ORIGIN, NULL, "bb", 30, CORVUS_BLADE); else - gi.CreateEffect(&Caster->s, FX_LINKEDBLOOD, CEF_OWNERS_ORIGIN, NULL, "bb", 30, CORVUS_BLADE); + gi.CreateEffect(caster, FX_LINKEDBLOOD, CEF_OWNERS_ORIGIN, NULL, "bb", 30, CORVUS_BLADE); } if (trace.ent->svflags & SVF_MONSTER || trace.ent->client) { - Caster->s.effects |= EF_BLOOD_ENABLED; + caster->s.effects |= EF_BLOOD_ENABLED; playerinfo->effects |= EF_BLOOD_ENABLED; } @@ -509,7 +509,7 @@ void WeaponThink_SwordStaff(edict_t *Caster,char *Format,...) switch (powerlevel) { case STAFF_LEVEL_BASIC: - gi.sound(Caster,CHAN_AUTO,gi.soundindex("weapons/staffhit.wav"),1,ATTN_NORM,0); + gi.sound(caster, CHAN_AUTO,gi.soundindex("weapons/staffhit.wav"),1,ATTN_NORM,0); break; case STAFF_LEVEL_POWER1: @@ -521,7 +521,7 @@ void WeaponThink_SwordStaff(edict_t *Caster,char *Format,...) trace.plane.normal, powerlevel); - gi.sound(Caster,CHAN_AUTO,gi.soundindex("weapons/staffhit_2.wav"),1,ATTN_NORM,0); + gi.sound(caster, CHAN_AUTO,gi.soundindex("weapons/staffhit_2.wav"),1,ATTN_NORM,0); break; case STAFF_LEVEL_POWER2: @@ -533,17 +533,17 @@ void WeaponThink_SwordStaff(edict_t *Caster,char *Format,...) trace.plane.normal, powerlevel); - gi.sound(Caster,CHAN_AUTO,gi.soundindex("weapons/staffhit_3.wav"),1,ATTN_NORM,0); + gi.sound(caster, CHAN_AUTO,gi.soundindex("weapons/staffhit_3.wav"),1,ATTN_NORM,0); break; } - Caster->client->lastentityhit = trace.ent; + caster->client->lastentityhit = trace.ent; } } } else if (trace.fraction < 1.0 || trace.startsolid) { // Hit a wall or such... - if (Caster->client->lastentityhit == NULL && Vec3NotZero(trace.plane.normal)) + if (caster->client->lastentityhit == NULL && Vec3NotZero(trace.plane.normal)) { // Don't do sparks if already hit something VectoAngles(trace.plane.normal, hitangles); @@ -566,10 +566,10 @@ void WeaponThink_SwordStaff(edict_t *Caster,char *Format,...) hitdir); } - AlertMonsters (Caster, Caster, 1, true); - gi.sound(Caster, CHAN_AUTO, gi.soundindex("weapons/staffhitwall.wav"), 1, ATTN_NORM, 0); + AlertMonsters (caster, caster, 1, true); + gi.sound(caster, CHAN_AUTO, gi.soundindex("weapons/staffhitwall.wav"), 1, ATTN_NORM, 0); - Caster->client->lastentityhit = WALL_ENTITY; + caster->client->lastentityhit = WALL_ENTITY; } } } @@ -578,7 +578,7 @@ void WeaponThink_SwordStaff(edict_t *Caster,char *Format,...) // WeaponThink_FlyingFist // ---------------------- // ************************************************************************************************ -void WeaponThink_FlyingFist(edict_t *Caster,char *Format,...) +void WeaponThink_FlyingFist(edict_t *caster, char *Format, ...) { vec3_t OriginToLowerJoint={0.945585,2.26076,0.571354}, OriginToUpperJoint={1.80845,2.98912,3.27800}, @@ -588,19 +588,19 @@ void WeaponThink_FlyingFist(edict_t *Caster,char *Format,...) // Set up the Magic-missile's starting position and aiming angles then cast the spell. - Weapon_CalcStartPos(OriginToLowerJoint,OriginToUpperJoint,DefaultStartPos,StartPos,Caster); + Weapon_CalcStartPos(OriginToLowerJoint, OriginToUpperJoint, DefaultStartPos, StartPos, caster); - AngleVectors(Caster->client->aimangles,Forward,NULL,NULL); + AngleVectors(caster->client->aimangles,Forward,NULL,NULL); - StartPos[2] += Caster->viewheight - 14.0; - SpellCastFlyingFist(Caster,StartPos,Caster->client->aimangles,Forward,0.0); + StartPos[2] += caster->viewheight - 14.0; + SpellCastFlyingFist(caster, StartPos,caster->client->aimangles,Forward,0.0); // Take off mana, but if there is none, then fire a wimpy fizzle-weapon. - if (Caster->client->playerinfo.pers.inventory.Items[Caster->client->playerinfo.weap_ammo_index] > 0) + if (caster->client->playerinfo.pers.inventory.Items[caster->client->playerinfo.weap_ammo_index] > 0) { if (!(deathmatch->value && ((int)dmflags->value & DF_INFINITE_MANA))) - Caster->client->playerinfo.pers.inventory.Items[Caster->client->playerinfo.weap_ammo_index] -= - Caster->client->playerinfo.pers.weapon->quantity; + caster->client->playerinfo.pers.inventory.Items[caster->client->playerinfo.weap_ammo_index] -= + caster->client->playerinfo.pers.weapon->quantity; } } @@ -706,7 +706,7 @@ void WeaponThink_MagicMissileSpread(edict_t *caster,char *format,...) // ------------------------------- // ************************************************************************************************ -void WeaponThink_SphereOfAnnihilation(edict_t *Caster,char *Format,...) +void WeaponThink_SphereOfAnnihilation(edict_t *caster, char *Format, ...) { va_list Marker; float *ReleaseFlagsPtr; @@ -726,17 +726,17 @@ void WeaponThink_SphereOfAnnihilation(edict_t *Caster,char *Format,...) // Set up the Sphere-of-annihilation's aiming angles then cast the spell. - AngleVectors(Caster->client->aimangles,Forward,NULL,NULL); + AngleVectors(caster->client->aimangles,Forward,NULL,NULL); - SpellCastSphereOfAnnihilation(Caster, + SpellCastSphereOfAnnihilation(caster, NULL, - Caster->client->aimangles, //v_angle, + caster->client->aimangles, //v_angle, Forward, 0.0, ReleaseFlagsPtr); if (!deathmatch->value || (deathmatch->value && !((int)dmflags->value & DF_INFINITE_MANA))) - Caster->client->playerinfo.pers.inventory.Items[Caster->client->playerinfo.weap_ammo_index]-= Caster->client->playerinfo.pers.weapon->quantity; + caster->client->playerinfo.pers.inventory.Items[caster->client->playerinfo.weap_ammo_index]-= caster->client->playerinfo.pers.weapon->quantity; } // ************************************************************************************************ diff --git a/src/game/spell/bluering.c b/src/game/spell/bluering.c index 7d72d0ddb..2a1c5e1f8 100644 --- a/src/game/spell/bluering.c +++ b/src/game/spell/bluering.c @@ -206,7 +206,7 @@ void RingThink(edict_t *self) ent->owner = self->owner; // Do a nasty looking blast at the impact point - gi.CreateEffect(&ent->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", ent->velocity); + gi.CreateEffect(ent, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", ent->velocity); } } @@ -246,13 +246,13 @@ void RingThink(edict_t *self) // Formula for knockback: 1 to 0 (center to outside) * KNOCKBACK_SCALE + KNOCKBACK_BASE // This total is multiplied by (MASS_FACTOR / mass). (If mass > 200, less, if < 200, more) -void SpellCastBlueRing(edict_t *Caster, vec3_t StartPos, vec3_t AimAngles, vec3_t AimDir, float value) +void SpellCastBlueRing(edict_t *caster, vec3_t StartPos, vec3_t AimAngles, vec3_t AimDir, float value) { edict_t *newent; // create the actual effect entity newent = G_Spawn(); - newent->owner = Caster; + newent->owner = caster; newent->solid = SOLID_NOT; newent->svflags |= SVF_NOCLIENT; newent->movetype = MOVETYPE_NONE; @@ -261,11 +261,11 @@ void SpellCastBlueRing(edict_t *Caster, vec3_t StartPos, vec3_t AimAngles, vec3_ newent->think = RingThink; newent->count = RING_THINKS; newent->timestamp = level.time; - VectorCopy(Caster->s.origin, newent->s.origin); + VectorCopy(caster->s.origin, newent->s.origin); gi.linkentity(newent); // fire off a special effect. - gi.CreateEffect(&Caster->s, FX_SPELL_BLUERING, CEF_OWNERS_ORIGIN, 0, ""); + gi.CreateEffect(caster, FX_SPELL_BLUERING, CEF_OWNERS_ORIGIN, 0, ""); } // end diff --git a/src/game/spell/flyingfist.c b/src/game/spell/flyingfist.c index b65364bb9..b650ff2af 100644 --- a/src/game/spell/flyingfist.c +++ b/src/game/spell/flyingfist.c @@ -91,14 +91,14 @@ edict_t *FlyingFistReflect(edict_t *self, edict_t *other, vec3_t vel) G_LinkMissile(flyingfist); // create new trails for the new missile - gi.CreateEffect(&flyingfist->s, FX_WEAPON_FLYINGFIST, CEF_OWNERS_ORIGIN | CEF_FLAG6, NULL, + gi.CreateEffect(flyingfist, FX_WEAPON_FLYINGFIST, CEF_OWNERS_ORIGIN | CEF_FLAG6, NULL, "t", flyingfist->velocity); // kill the existing missile, since its a pain in the ass to modify it so the physics won't screw it. G_SetToFree(self); // Do a nasty looking blast at the impact point - gi.CreateEffect(&flyingfist->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", flyingfist->velocity); + gi.CreateEffect(flyingfist, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", flyingfist->velocity); return(flyingfist); } @@ -295,6 +295,6 @@ void SpellCastFlyingFist(edict_t *caster, vec3_t startpos, vec3_t aimangles, vec } // Spawn effect after it has been determined it has not started in wall // This is so it won`t try to remove it before it exists - gi.CreateEffect(&flyingfist->s, FX_WEAPON_FLYINGFIST, CEF_OWNERS_ORIGIN | flags, NULL, + gi.CreateEffect(flyingfist, FX_WEAPON_FLYINGFIST, CEF_OWNERS_ORIGIN | flags, NULL, "t", flyingfist->velocity); } diff --git a/src/game/spell/hellstaff.c b/src/game/spell/hellstaff.c index 3016d9003..78258a75a 100644 --- a/src/game/spell/hellstaff.c +++ b/src/game/spell/hellstaff.c @@ -58,7 +58,7 @@ edict_t *HellboltReflect(edict_t *self, edict_t *other, vec3_t vel) VectorNormalize2(vel, hellbolt->movedir); VectoAngles(hellbolt->movedir, hellbolt->s.angles); G_LinkMissile(hellbolt); - gi.CreateEffect(&hellbolt->s, FX_WEAPON_HELLBOLT, CEF_OWNERS_ORIGIN|CEF_FLAG6, NULL, "t", hellbolt->velocity); + gi.CreateEffect(hellbolt, FX_WEAPON_HELLBOLT, CEF_OWNERS_ORIGIN|CEF_FLAG6, NULL, "t", hellbolt->velocity); // kill the existing missile, since its a pain in the ass to modify it so the physics won't screw it. G_SetToFree(self); @@ -66,7 +66,7 @@ edict_t *HellboltReflect(edict_t *self, edict_t *other, vec3_t vel) // Do a nasty looking blast at the impact point // only do this rarely, since we hit alot. if (!(irand(0,10))) - gi.CreateEffect(&hellbolt->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", hellbolt->velocity); + gi.CreateEffect(hellbolt, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", hellbolt->velocity); return(hellbolt); } @@ -119,7 +119,7 @@ static void HellboltTouch(edict_t *self, edict_t *other, cplane_t *plane, csurfa { makeScorch = CEF_FLAG6; } - gi.CreateEffect(&self->s, FX_WEAPON_HELLBOLTEXPLODE, CEF_OWNERS_ORIGIN | makeScorch, NULL, "d", self->movedir); + gi.CreateEffect(self, FX_WEAPON_HELLBOLTEXPLODE, CEF_OWNERS_ORIGIN | makeScorch, NULL, "d", self->movedir); G_SetToFree(self); } @@ -337,7 +337,7 @@ void SpellCastHellstaff(edict_t *caster, vec3_t loc, vec3_t aimangles, vec3_t un HellboltTouch(hellbolt, trace.ent, &trace.plane, trace.surface); return; } - gi.CreateEffect(&hellbolt->s, FX_WEAPON_HELLBOLT, CEF_OWNERS_ORIGIN, NULL, "t", hellbolt->velocity); + gi.CreateEffect(hellbolt, FX_WEAPON_HELLBOLT, CEF_OWNERS_ORIGIN, NULL, "t", hellbolt->velocity); } } // end diff --git a/src/game/spell/magicmissile.c b/src/game/spell/magicmissile.c index 94996cfcc..728032853 100644 --- a/src/game/spell/magicmissile.c +++ b/src/game/spell/magicmissile.c @@ -68,7 +68,7 @@ edict_t *MagicMissileReflect(edict_t *self, edict_t *other, vec3_t vel) shortyaw = (short)(magicmissile->s.angles[YAW]*(65536.0/360.0)); shortpitch = (short)(magicmissile->s.angles[PITCH]*(65536.0/360.0)); - gi.CreateEffect(&magicmissile->s, + gi.CreateEffect(magicmissile, FX_WEAPON_MAGICMISSILE, CEF_OWNERS_ORIGIN|CEF_FLAG6, 0, @@ -79,7 +79,7 @@ edict_t *MagicMissileReflect(edict_t *self, edict_t *other, vec3_t vel) G_SetToFree(self); // Do a nasty looking blast at the impact point - gi.CreateEffect(&magicmissile->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", magicmissile->velocity); + gi.CreateEffect(magicmissile, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", magicmissile->velocity); return(magicmissile); } @@ -153,7 +153,7 @@ static void MagicMissileTouch(edict_t *self,edict_t *Other,cplane_t *Plane,csurf { makeScorch = CEF_FLAG6; } - gi.CreateEffect(&self->s, FX_WEAPON_MAGICMISSILEEXPLODE, CEF_OWNERS_ORIGIN | makeScorch, self->s.origin, "d", self->movedir); + gi.CreateEffect(self, FX_WEAPON_MAGICMISSILEEXPLODE, CEF_OWNERS_ORIGIN | makeScorch, self->s.origin, "d", self->movedir); gi.sound(self, CHAN_WEAPON, gi.soundindex("weapons/MagicMissileHit.wav"), 2, ATTN_NORM, 0); G_SetToFree(self); @@ -182,29 +182,29 @@ void create_magic(edict_t *MagicMissile) // SpellCastMagicMissile // **************************************************************************** -void SpellCastMagicMissile(edict_t *Caster,vec3_t StartPos,vec3_t AimAngles,vec3_t AimDir) +void SpellCastMagicMissile(edict_t *caster,vec3_t StartPos,vec3_t AimAngles,vec3_t AimDir) { - edict_t *MagicMissile; + edict_t *magicmissile; trace_t trace; vec3_t TempVec; short shortyaw, shortpitch; // Spawn the magic-missile. - MagicMissile=G_Spawn(); + magicmissile = G_Spawn(); - VectorNormalize2(AimDir, MagicMissile->movedir); - VectorMA(StartPos,1.0,AimDir,MagicMissile->s.origin); + VectorNormalize2(AimDir, magicmissile->movedir); + VectorMA(StartPos,1.0,AimDir, magicmissile->s.origin); - create_magic(MagicMissile); - MagicMissile->owner=Caster; - MagicMissile->reflect_debounce_time = MAX_REFLECT; - G_LinkMissile(MagicMissile); + create_magic(magicmissile); + magicmissile->owner = caster; + magicmissile->reflect_debounce_time = MAX_REFLECT; + G_LinkMissile(magicmissile); - trace = gi.trace(Caster->s.origin, MagicMissile->mins, MagicMissile->maxs, MagicMissile->s.origin, Caster, MASK_PLAYERSOLID); + trace = gi.trace(caster->s.origin, magicmissile->mins, magicmissile->maxs, magicmissile->s.origin, caster, MASK_PLAYERSOLID); if (trace.startsolid) { - MagicMissileTouch(MagicMissile, trace.ent, &trace.plane, trace.surface); + MagicMissileTouch(magicmissile, trace.ent, &trace.plane, trace.surface); return; } @@ -212,41 +212,41 @@ void SpellCastMagicMissile(edict_t *Caster,vec3_t StartPos,vec3_t AimAngles,vec3 // a) Lies in a 45 degree degree horizontal, 180 degree vertical cone from my facing. // b) Lies within 0 to 1000 meters of myself. // c) Is visible (i.e. LOS exists from the missile to myself). - MagicMissile->enemy = FindNearestVisibleActorInFrustum(MagicMissile, + magicmissile->enemy = FindNearestVisibleActorInFrustum(magicmissile, AimAngles, 0.0, 1000.0, ANGLE_30, ANGLE_180, SVF_MONSTER, - MagicMissile->s.origin, + magicmissile->s.origin, NULL, NULL); - if(MagicMissile->enemy) + if(magicmissile->enemy) { - VectorCopy(MagicMissile->s.origin,TempVec); - VectorSubtract(MagicMissile->enemy->s.origin,TempVec,TempVec); + VectorCopy(magicmissile->s.origin, TempVec); + VectorSubtract(magicmissile->enemy->s.origin, TempVec, TempVec); - TempVec[0]+=(MagicMissile->enemy->mins[0]+MagicMissile->enemy->maxs[0])/2.0; - TempVec[1]+=(MagicMissile->enemy->mins[1]+MagicMissile->enemy->maxs[1])/2.0; - TempVec[2]+=(MagicMissile->enemy->mins[2]+MagicMissile->enemy->maxs[2])/2.0; + TempVec[0]+=(magicmissile->enemy->mins[0] + magicmissile->enemy->maxs[0])/2.0; + TempVec[1]+=(magicmissile->enemy->mins[1] + magicmissile->enemy->maxs[1])/2.0; + TempVec[2]+=(magicmissile->enemy->mins[2] + magicmissile->enemy->maxs[2])/2.0; VectorNormalize(TempVec); - VectoAngles(TempVec,MagicMissile->s.angles); + VectoAngles(TempVec, magicmissile->s.angles); // The pitch is flipped in these? - MagicMissile->s.angles[PITCH] = -MagicMissile->s.angles[PITCH]; - VectorScale(TempVec,MAGICMISSILE_SPEED,MagicMissile->velocity); + magicmissile->s.angles[PITCH] = -magicmissile->s.angles[PITCH]; + VectorScale(TempVec, MAGICMISSILE_SPEED, magicmissile->velocity); } else { - VectorScale(AimDir,MAGICMISSILE_SPEED,MagicMissile->velocity); - VectorCopy(AimAngles,MagicMissile->s.angles); + VectorScale(AimDir,MAGICMISSILE_SPEED, magicmissile->velocity); + VectorCopy(AimAngles, magicmissile->s.angles); } - shortyaw = (short)(MagicMissile->s.angles[YAW]*(65536.0/360.0)); - shortpitch = (short)(MagicMissile->s.angles[PITCH]*(65536.0/360.0)); + shortyaw = (short)(magicmissile->s.angles[YAW]*(65536.0/360.0)); + shortpitch = (short)(magicmissile->s.angles[PITCH]*(65536.0/360.0)); - gi.CreateEffect(&MagicMissile->s, + gi.CreateEffect(magicmissile, FX_WEAPON_MAGICMISSILE, CEF_OWNERS_ORIGIN, 0, @@ -254,8 +254,8 @@ void SpellCastMagicMissile(edict_t *Caster,vec3_t StartPos,vec3_t AimAngles,vec3 shortyaw, shortpitch); - MagicMissile->think=MagicMissileThink2; - MagicMissile->nextthink=level.time+0.1; + magicmissile->think = MagicMissileThink2; + magicmissile->nextthink = level.time + 0.1; } @@ -303,7 +303,7 @@ static void MagicMissileThink1(edict_t *self) shortyaw = (short)(self->s.angles[YAW]*(65536.0/360.0)); shortpitch = (short)(self->s.angles[PITCH]*(65536.0/360.0)); - gi.CreateEffect(&self->s, + gi.CreateEffect(self, FX_WEAPON_MAGICMISSILE, CEF_OWNERS_ORIGIN, 0, diff --git a/src/game/spell/meteorbarrier.c b/src/game/spell/meteorbarrier.c index 14b83ac20..45389ffaf 100644 --- a/src/game/spell/meteorbarrier.c +++ b/src/game/spell/meteorbarrier.c @@ -63,7 +63,7 @@ static void MeteorBarrierDie(edict_t *self, int Flags) if (self->PersistantCFX) { gi.RemovePersistantEffect(self->PersistantCFX, REMOVE_METEOR); - gi.RemoveEffects(&self->owner->s, FX_SPELL_METEORBARRIER+self->health); + gi.RemoveEffects(self->owner, FX_SPELL_METEORBARRIER+self->health); self->PersistantCFX = 0; } @@ -197,7 +197,7 @@ edict_t *MeteorBarrierReflect(edict_t *self, edict_t *other, vec3_t vel) if (self->PersistantCFX) { gi.RemovePersistantEffect(self->PersistantCFX, REMOVE_METEOR); - gi.RemoveEffects(&self->owner->s, FX_SPELL_METEORBARRIER+self->health); + gi.RemoveEffects(self->owner, FX_SPELL_METEORBARRIER+self->health); self->PersistantCFX = 0; } @@ -205,13 +205,13 @@ edict_t *MeteorBarrierReflect(edict_t *self, edict_t *other, vec3_t vel) Meteor->owner->client->Meteors[Meteor->health] = Meteor; // create a client effect for this new meteor - gi.CreateEffect(&Meteor->s, FX_SPELL_METEORBARRIER_TRAVEL, CEF_BROADCAST|CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(Meteor, FX_SPELL_METEORBARRIER_TRAVEL, CEF_BROADCAST|CEF_OWNERS_ORIGIN, NULL, ""); // kill the existing missile, since its a pain in the ass to modify it so the physics won't screw it. G_SetToFree(self); // Do a nasty looking blast at the impact point - gi.CreateEffect(&Meteor->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", Meteor->velocity); + gi.CreateEffect(Meteor, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", Meteor->velocity); return(Meteor); } @@ -311,13 +311,13 @@ static void MeteorBarrierSearchThink(edict_t *self) } gi.sound(self,CHAN_BODY,gi.soundindex("weapons/MeteorBarrierSeek.wav"),1,ATTN_NORM,0); - gi.CreateEffect(&self->s, FX_SPELL_METEORBARRIER_TRAVEL, CEF_BROADCAST|CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(self, FX_SPELL_METEORBARRIER_TRAVEL, CEF_BROADCAST|CEF_OWNERS_ORIGIN, NULL, ""); // remove the persistant effect from the persistant effect list if (self->PersistantCFX) { gi.RemovePersistantEffect(self->PersistantCFX, REMOVE_METEOR); - gi.RemoveEffects(&self->owner->s, FX_SPELL_METEORBARRIER+self->health); + gi.RemoveEffects(self->owner, FX_SPELL_METEORBARRIER+self->health); self->PersistantCFX = 0; } @@ -397,7 +397,7 @@ void create_meteor(edict_t *Meteor) // Spawn the meteors -void SpellCastMeteorBarrier(edict_t *Caster,vec3_t StartPos,vec3_t AimAngles,vec3_t AimDir,float Value) +void SpellCastMeteorBarrier(edict_t *caster,vec3_t StartPos,vec3_t AimAngles,vec3_t AimDir,float Value) { int I, cast; edict_t *Meteor; @@ -408,27 +408,27 @@ void SpellCastMeteorBarrier(edict_t *Caster,vec3_t StartPos,vec3_t AimAngles,vec for(I = 0; I < 4; I++) { // If my caster is a player, then make sure they only have one instance of me active, then - if(Caster->client) + if(caster->client) { - if(Caster->client->Meteors[I]) + if(caster->client->Meteors[I]) continue; } // enough mana to do this ? - if (Caster->client->playerinfo.pers.inventory.Items[Caster->client->playerinfo.def_ammo_index] < Caster->client->playerinfo.pers.defence->quantity) + if (caster->client->playerinfo.pers.inventory.Items[caster->client->playerinfo.def_ammo_index] < caster->client->playerinfo.pers.defence->quantity) break; // decrement our mana if (!deathmatch->value || (deathmatch->value && !((int)dmflags->value & DF_INFINITE_MANA))) - Caster->client->playerinfo.pers.inventory.Items[Caster->client->playerinfo.def_ammo_index] -= Caster->client->playerinfo.pers.defence->quantity; + caster->client->playerinfo.pers.inventory.Items[caster->client->playerinfo.def_ammo_index] -= caster->client->playerinfo.pers.defence->quantity; cast = true; Meteor = G_Spawn(); Meteor->svflags |= SVF_NOCLIENT; - if(Caster->client) + if(caster->client) { - Caster->client->Meteors[I] = Meteor; + caster->client->Meteors[I] = Meteor; } VectorCopy(StartPos, Meteor->s.origin); @@ -439,19 +439,19 @@ void SpellCastMeteorBarrier(edict_t *Caster,vec3_t StartPos,vec3_t AimAngles,vec Meteor->count = 0; Meteor->random = 0; // Lifetime count Meteor->solid = SOLID_NOT; - Meteor->owner = Caster; - Caster->client->playerinfo.meteor_count |= 1<owner = caster; + caster->client->playerinfo.meteor_count |= 1<PersistantCFX = gi.CreatePersistantEffect(&Caster->s, FX_SPELL_METEORBARRIER+I, CEF_BROADCAST|CEF_OWNERS_ORIGIN|(I<<5), NULL, "" ); + Meteor->PersistantCFX = gi.CreatePersistantEffect(caster, FX_SPELL_METEORBARRIER+I, CEF_BROADCAST|CEF_OWNERS_ORIGIN|(I<<5), NULL, "" ); } if(cast) { - gi.sound(Caster,CHAN_WEAPON,gi.soundindex("weapons/MeteorBarrierCast.wav"),1,ATTN_NORM,0); - Caster->s.sound = gi.soundindex("weapons/MeteorBarrierAmbient.wav"); - Caster->s.sound_data = (255 & ENT_VOL_MASK) | ATTN_NORM; + gi.sound(caster,CHAN_WEAPON,gi.soundindex("weapons/MeteorBarrierCast.wav"),1,ATTN_NORM,0); + caster->s.sound = gi.soundindex("weapons/MeteorBarrierAmbient.wav"); + caster->s.sound_data = (255 & ENT_VOL_MASK) | ATTN_NORM; } } // end diff --git a/src/game/spell/morph.c b/src/game/spell/morph.c index 73eeaf721..475debe44 100644 --- a/src/game/spell/morph.c +++ b/src/game/spell/morph.c @@ -94,7 +94,7 @@ void MorphFadeOut(edict_t *self) newent->s.color[3] = 255; newent->morph_timer = MORPH_TELE_TIME; newent->think = MorphFadeIn; - gi.CreateEffect(&newent->s, FX_PLAYER_TELEPORT_IN, CEF_OWNERS_ORIGIN|CEF_FLAG6, NULL, "" ); + gi.CreateEffect(newent, FX_PLAYER_TELEPORT_IN, CEF_OWNERS_ORIGIN|CEF_FLAG6, NULL, "" ); // do the teleport sound gi.sound(newent,CHAN_WEAPON,gi.soundindex("weapons/teleport.wav"),1,ATTN_NORM,0); @@ -188,7 +188,7 @@ void reset_morph_to_elf(edict_t *ent) // SpawnInitialPlayerEffects(ent); // draw the teleport splash at the destination - gi.CreateEffect(&ent->s, FX_PLAYER_TELEPORT_IN, CEF_BROADCAST|CEF_OWNERS_ORIGIN|CEF_FLAG6, ent->s.origin, ""); + gi.CreateEffect(ent, FX_PLAYER_TELEPORT_IN, CEF_BROADCAST|CEF_OWNERS_ORIGIN|CEF_FLAG6, ent->s.origin, ""); // restart the loop and tell us next time we aren't de-materialising ent->client->tele_count = TELE_TIME; @@ -240,7 +240,7 @@ void MorphChickenToPlayer(edict_t *self) self->client->tele_dest[0] = self->client->tele_dest[1] = self->client->tele_dest[2] = 0; // draw the teleport splash at the teleport source - gi.CreateEffect(&self->s, FX_PLAYER_TELEPORT_OUT, CEF_OWNERS_ORIGIN |CEF_FLAG6, NULL, "" ); + gi.CreateEffect(self, FX_PLAYER_TELEPORT_OUT, CEF_OWNERS_ORIGIN |CEF_FLAG6, NULL, "" ); // do the teleport sound gi.sound(self,CHAN_WEAPON,gi.soundindex("weapons/teleport.wav"),1,ATTN_NORM,0); @@ -357,7 +357,7 @@ void Perform_Morph(edict_t *self) playerExport->PlayerAnimSetLowerSeq(&self->client->playerinfo, ASEQ_STAND); // draw the teleport splash at the destination - gi.CreateEffect(&self->s, FX_PLAYER_TELEPORT_IN, CEF_BROADCAST|CEF_OWNERS_ORIGIN|CEF_FLAG6, self->s.origin, ""); + gi.CreateEffect(self, FX_PLAYER_TELEPORT_IN, CEF_BROADCAST|CEF_OWNERS_ORIGIN|CEF_FLAG6, self->s.origin, ""); // restart the loop and tell us next time we aren't de-materialising self->client->tele_count = TELE_TIME; @@ -416,7 +416,7 @@ void MorphPlayerToChicken(edict_t *self, edict_t *caster) self->morph_timer = level.time + MORPH_DUR; // draw the teleport splash at the teleport source - gi.CreateEffect(&self->s, FX_PLAYER_TELEPORT_OUT, CEF_OWNERS_ORIGIN | CEF_FLAG6, NULL, ""); + gi.CreateEffect(self, FX_PLAYER_TELEPORT_OUT, CEF_OWNERS_ORIGIN | CEF_FLAG6, NULL, ""); // do the teleport sound gi.sound(self,CHAN_WEAPON,gi.soundindex("weapons/teleport.wav"),1,ATTN_NORM,0); @@ -475,7 +475,7 @@ void MorphPlayerToChicken2(edict_t *self, edict_t *caster) self->morph_timer = level.time + MORPH_DUR; // draw the teleport splash at the teleport source - gi.CreateEffect(&self->s, FX_PLAYER_TELEPORT_OUT, CEF_OWNERS_ORIGIN | CEF_FLAG6, NULL, ""); + gi.CreateEffect(self, FX_PLAYER_TELEPORT_OUT, CEF_OWNERS_ORIGIN | CEF_FLAG6, NULL, ""); // do the teleport sound gi.sound(self,CHAN_WEAPON,gi.soundindex("weapons/teleport.wav"),1,ATTN_NORM,0); @@ -501,13 +501,13 @@ edict_t *MorphReflect(edict_t *self, edict_t *other, vec3_t vel) G_LinkMissile(morph); yaw = Q_ftol((morph->s.angles[YAW]/6.2831) * 255.0); pitch = Q_ftol((morph->s.angles[PITCH]/6.2831) * 255.0); - gi.CreateEffect(&morph->s, FX_SPELL_MORPHMISSILE, CEF_OWNERS_ORIGIN|CEF_FLAG6, NULL, "bb", yaw,pitch); + gi.CreateEffect(morph, FX_SPELL_MORPHMISSILE, CEF_OWNERS_ORIGIN|CEF_FLAG6, NULL, "bb", yaw,pitch); // kill the existing missile, since its a pain in the ass to modify it so the physics won't screw it. G_SetToFree(self); // Do a nasty looking blast at the impact point - gi.CreateEffect(&morph->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", morph->velocity); + gi.CreateEffect(morph, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", morph->velocity); return(morph); } @@ -567,7 +567,7 @@ void MorphMissileTouch(edict_t *self, edict_t *other, cplane_t *plane, csurface_ other->morph_timer = MORPH_TELE_TIME; other->enemy = self->owner; VectorClear(other->velocity); - gi.CreateEffect(&other->s, FX_PLAYER_TELEPORT_OUT, CEF_OWNERS_ORIGIN|CEF_FLAG6, NULL, "" ); + gi.CreateEffect(other, FX_PLAYER_TELEPORT_OUT, CEF_OWNERS_ORIGIN|CEF_FLAG6, NULL, "" ); } else MorphPlayerToChicken(other, self->owner); @@ -638,7 +638,7 @@ void create_morph(edict_t *morph) // SpellCastMorph // **************************************************************************** -void SpellCastMorph(edict_t *Caster, vec3_t StartPos, vec3_t AimAngles, vec3_t unused, float value) +void SpellCastMorph(edict_t *caster, vec3_t StartPos, vec3_t AimAngles, vec3_t unused, float value) { edict_t *morph; int i; @@ -669,7 +669,7 @@ void SpellCastMorph(edict_t *Caster, vec3_t StartPos, vec3_t AimAngles, vec3_t u create_morph(morph); morph->reflect_debounce_time = MAX_REFLECT; - morph->owner = Caster; + morph->owner = caster; G_LinkMissile(morph); // if we are the first effect, calculate our yaw @@ -683,7 +683,7 @@ void SpellCastMorph(edict_t *Caster, vec3_t StartPos, vec3_t AimAngles, vec3_t u } // create the client effect that gets seen on screen - gi.CreateEffect(&Caster->s, FX_SPELL_MORPHMISSILE_INITIAL, CEF_OWNERS_ORIGIN, NULL, "bssssss", + gi.CreateEffect(caster, FX_SPELL_MORPHMISSILE_INITIAL, CEF_OWNERS_ORIGIN, NULL, "bssssss", yaw, morpharray[0], morpharray[1], diff --git a/src/game/spell/phoenix.c b/src/game/spell/phoenix.c index c44083686..5d572b88a 100644 --- a/src/game/spell/phoenix.c +++ b/src/game/spell/phoenix.c @@ -39,7 +39,7 @@ edict_t *PhoenixMissileReflect(edict_t *self, edict_t *other, vec3_t vel) VectorCopy(vel, phoenix->velocity); G_LinkMissile(phoenix); - gi.CreateEffect(&phoenix->s, FX_WEAPON_PHOENIXMISSILE, CEF_OWNERS_ORIGIN | (phoenix->health << 5) | CEF_FLAG8, NULL, "t", phoenix->velocity); + gi.CreateEffect(phoenix, FX_WEAPON_PHOENIXMISSILE, CEF_OWNERS_ORIGIN | (phoenix->health << 5) | CEF_FLAG8, NULL, "t", phoenix->velocity); // kill the existing missile, since its a pain in the ass to modify it so the physics won't screw it. G_SetToFree(self); @@ -50,7 +50,7 @@ edict_t *PhoenixMissileReflect(edict_t *self, edict_t *other, vec3_t vel) self->s.sound = 0; // Do a nasty looking blast at the impact point - gi.CreateEffect(&phoenix->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", phoenix->velocity); + gi.CreateEffect(phoenix, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", phoenix->velocity); return(phoenix); } @@ -120,13 +120,13 @@ void PhoenixMissileTouch(edict_t *self, edict_t *other, cplane_t *plane, csurfac VectorNormalize2(self->velocity,self->movedir); // Start the explosion if (plane->normal) - gi.CreateEffect(&self->s, FX_WEAPON_PHOENIXEXPLODE, CEF_BROADCAST |(self->health << 5)| makeScorch, self->s.origin, "td", plane->normal, self->movedir); + gi.CreateEffect(self, FX_WEAPON_PHOENIXEXPLODE, CEF_BROADCAST |(self->health << 5)| makeScorch, self->s.origin, "td", plane->normal, self->movedir); else - gi.CreateEffect(&self->s, FX_WEAPON_PHOENIXEXPLODE, CEF_BROADCAST |(self->health << 5)| makeScorch, self->s.origin, "td", self->movedir, self->movedir); + gi.CreateEffect(self, FX_WEAPON_PHOENIXEXPLODE, CEF_BROADCAST |(self->health << 5)| makeScorch, self->s.origin, "td", self->movedir, self->movedir); VectorClear(self->velocity); // Turn off the client effect - gi.RemoveEffects(&self->s, FX_WEAPON_PHOENIXMISSILE); + gi.RemoveEffects(self, FX_WEAPON_PHOENIXMISSILE); G_SetToFree(self); } @@ -225,7 +225,7 @@ void SpellCastPhoenix(edict_t *Caster, vec3_t StartPos, vec3_t AimAngles, vec3_t PhoenixMissileTouch(phoenix, trace.ent, &trace.plane, trace.surface); return; } - gi.CreateEffect(&phoenix->s, FX_WEAPON_PHOENIXMISSILE, CEF_OWNERS_ORIGIN|(phoenix->health<<5), NULL, "t", phoenix->velocity); + gi.CreateEffect(phoenix, FX_WEAPON_PHOENIXMISSILE, CEF_OWNERS_ORIGIN|(phoenix->health<<5), NULL, "t", phoenix->velocity); } // end diff --git a/src/game/spell/powerup.c b/src/game/spell/powerup.c index 329c348d7..1c5ed4fbf 100644 --- a/src/game/spell/powerup.c +++ b/src/game/spell/powerup.c @@ -10,37 +10,38 @@ #include "../header/g_itemstats.h" -void SpellCastPowerup(edict_t *Caster, vec3_t StartPos, vec3_t AimAngles, vec3_t AimDir, float value) +void +SpellCastPowerup(edict_t *caster, vec3_t StartPos, vec3_t AimAngles, vec3_t AimDir, float value) { - assert(Caster->client); + assert(caster->client); // Kill any tomes that may already be out there for this player. - gi.RemoveEffects(&Caster->s, FX_TOME_OF_POWER); + gi.RemoveEffects(caster, FX_TOME_OF_POWER); // if we are a chicken, lets make us a player again - if (Caster->flags & FL_CHICKEN) + if (caster->flags & FL_CHICKEN) { - Caster->morph_timer = level.time - 0.1; + caster->morph_timer = level.time - 0.1; } else { // add some time in on the timer for the powerup - Caster->client->playerinfo.powerup_timer = level.time + POWERUP_DURATION; + caster->client->playerinfo.powerup_timer = level.time + POWERUP_DURATION; // turn on the light at the client effect end through client flags that are passed down - Caster->s.effects |= EF_POWERUP_ENABLED; - Caster->client->playerinfo.effects |= EF_POWERUP_ENABLED; + caster->s.effects |= EF_POWERUP_ENABLED; + caster->client->playerinfo.effects |= EF_POWERUP_ENABLED; // create the tome of power - gi.CreateEffect(&Caster->s, FX_TOME_OF_POWER, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(caster, FX_TOME_OF_POWER, CEF_OWNERS_ORIGIN, NULL, ""); } // start up the shrine powerup effect -// gi.CreateEffect(&Caster->s, FX_SHRINE_POWERUP, CEF_OWNERS_ORIGIN, NULL, ""); +// gi.CreateEffect(caster, FX_SHRINE_POWERUP, CEF_OWNERS_ORIGIN, NULL, ""); // do the SHRINE sound - gi.sound(Caster, CHAN_ITEM,gi.soundindex("items/shrine5.wav"),1,ATTN_NORM,0); + gi.sound(caster, CHAN_ITEM,gi.soundindex("items/shrine5.wav"),1,ATTN_NORM,0); } // end diff --git a/src/game/spell/redrain.c b/src/game/spell/redrain.c index d1935ff9a..fa77c1d94 100644 --- a/src/game/spell/redrain.c +++ b/src/game/spell/redrain.c @@ -21,7 +21,7 @@ void create_redarrow(edict_t *redarrow); void RedRainRemove(edict_t *self) { - gi.RemoveEffects(&self->s, 0); + gi.RemoveEffects(self, 0); G_SetToFree(self); } @@ -126,7 +126,7 @@ void RedRainThink(edict_t *self) gi.sound(victim,CHAN_WEAPON,gi.soundindex("weapons/Lightning.wav"),1,ATTN_NORM,0); // Do a nasty looking blast at the impact point - gi.CreateEffect(&victim->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN | CEF_FLAG7, NULL, "t", diffpos); + gi.CreateEffect(victim, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN | CEF_FLAG7, NULL, "t", diffpos); if(!(EntReflecting(victim, true, true))) { @@ -209,14 +209,14 @@ edict_t *RedRainMissileReflect(edict_t *self, edict_t *other, vec3_t vel) redarrow->reflect_debounce_time = self->reflect_debounce_time -1; redarrow->reflected_time=self->reflected_time; G_LinkMissile(redarrow); - gi.CreateEffect(&redarrow->s, FX_WEAPON_REDRAINMISSILE, + gi.CreateEffect(redarrow, FX_WEAPON_REDRAINMISSILE, CEF_OWNERS_ORIGIN|(redarrow->health<<5)|CEF_FLAG8, NULL, "t", redarrow->velocity); // kill the existing missile, since its a pain in the ass to modify it so the physics won't screw it. G_SetToFree(self); // Do a nasty looking blast at the impact point - gi.CreateEffect(&redarrow->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", redarrow->velocity); + gi.CreateEffect(redarrow, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", redarrow->velocity); return(redarrow); } @@ -332,14 +332,14 @@ void RedRainMissileTouch(edict_t *self, edict_t *other, cplane_t *plane, csurfac // Start the red rain // Send along the health as a flag, to indicate if powered up. - gi.CreateEffect(&damagearea->s, FX_WEAPON_REDRAIN, CEF_BROADCAST|(self->health<<5), org, ""); + gi.CreateEffect(damagearea, FX_WEAPON_REDRAIN, CEF_BROADCAST|(self->health<<5), org, ""); // gi.sound(damagearea, CHAN_VOICE, gi.soundindex("weapons/RedRainFall.wav"), 2, ATTN_NORM,0); damagearea->s.sound = gi.soundindex("weapons/RedRainFall.wav"); damagearea->s.sound_data = (255 & ENT_VOL_MASK) | ATTN_NORM; // Turn off the client effect - gi.RemoveEffects(&self->s, FX_WEAPON_REDRAINMISSILE); + gi.RemoveEffects(self, FX_WEAPON_REDRAINMISSILE); G_SetToFree(self); } @@ -384,7 +384,7 @@ void create_redarrow(edict_t *redarrow) // SpellCastRedRain // **************************************************************************** -void SpellCastRedRain(edict_t *Caster, vec3_t StartPos, vec3_t AimAngles, vec3_t unused, float value) +void SpellCastRedRain(edict_t *caster, vec3_t StartPos, vec3_t AimAngles, vec3_t unused, float value) { edict_t *redarrow; trace_t trace; @@ -393,9 +393,9 @@ void SpellCastRedRain(edict_t *Caster, vec3_t StartPos, vec3_t AimAngles, vec3_t redarrow = G_Spawn(); - Caster->red_rain_count++; + caster->red_rain_count++; // health indicates a level of powerup - if (Caster->client->playerinfo.powerup_timer > level.time) + if (caster->client->playerinfo.powerup_timer > level.time) { // Shoot powered up red rain. redarrow->health = 1; powerup=true; @@ -410,14 +410,14 @@ void SpellCastRedRain(edict_t *Caster, vec3_t StartPos, vec3_t AimAngles, vec3_t //Check ahead first to see if it's going to hit anything at this angle AngleVectors(AimAngles, forward, NULL, NULL); VectorMA(StartPos, RED_ARROW_SPEED, forward, endpos); - trace = gi.trace(StartPos, vec3_origin, vec3_origin, endpos, Caster, MASK_MONSTERSOLID); - if(trace.ent && ok_to_autotarget(Caster, trace.ent)) + trace = gi.trace(StartPos, vec3_origin, vec3_origin, endpos, caster, MASK_MONSTERSOLID); + if(trace.ent && ok_to_autotarget(caster, trace.ent)) {//already going to hit a valid target at this angle- so don't autotarget VectorScale(forward, RED_ARROW_SPEED, redarrow->velocity); } else {//autotarget current enemy - GetAimVelocity(Caster->enemy, redarrow->s.origin, RED_ARROW_SPEED, AimAngles, redarrow->velocity); + GetAimVelocity(caster->enemy, redarrow->s.origin, RED_ARROW_SPEED, AimAngles, redarrow->velocity); } VectorNormalize2(redarrow->velocity, dir); // naughty naughty - this requires a normalised vector @@ -426,29 +426,29 @@ void SpellCastRedRain(edict_t *Caster, vec3_t StartPos, vec3_t AimAngles, vec3_t create_redarrow(redarrow); redarrow->reflect_debounce_time = MAX_REFLECT; - redarrow->owner = Caster; + redarrow->owner = caster; G_LinkMissile(redarrow); - gi.RemoveEffects(&Caster->s, FX_WEAPON_REDRAINGLOW); + gi.RemoveEffects(caster, FX_WEAPON_REDRAINGLOW); if (powerup) { // Play powerup firing sound - gi.sound(Caster, CHAN_WEAPON, gi.soundindex("weapons/RedRainPowerFire.wav"), 1, ATTN_NORM, 0); + gi.sound(caster, CHAN_WEAPON, gi.soundindex("weapons/RedRainPowerFire.wav"), 1, ATTN_NORM, 0); } else { // Player normal red rain firing sound - gi.sound(Caster, CHAN_WEAPON, gi.soundindex("weapons/RedRainFire.wav"), 1, ATTN_NORM, 0); + gi.sound(caster, CHAN_WEAPON, gi.soundindex("weapons/RedRainFire.wav"), 1, ATTN_NORM, 0); } // remove the bow ready sound - Caster->s.sound = 0; + caster->s.sound = 0; // Trace from the player's origin because then if we hit a wall, the effect won't be inside it... - trace = gi.trace(Caster->s.origin, redarrow->mins, redarrow->maxs, redarrow->s.origin, Caster, MASK_PLAYERSOLID); + trace = gi.trace(caster->s.origin, redarrow->mins, redarrow->maxs, redarrow->s.origin, caster, MASK_PLAYERSOLID); if (trace.startsolid || trace.fraction < .99) { if (trace.startsolid) - VectorCopy(Caster->s.origin, redarrow->s.origin); + VectorCopy(caster->s.origin, redarrow->s.origin); else VectorCopy(trace.endpos, redarrow->s.origin); RedRainMissileTouch(redarrow, trace.ent, &trace.plane, trace.surface); @@ -458,12 +458,12 @@ void SpellCastRedRain(edict_t *Caster, vec3_t StartPos, vec3_t AimAngles, vec3_t // Create the missile and trail effect only if we successfully launch the missile if (powerup) { // Magenta trail - gi.CreateEffect(&redarrow->s, FX_WEAPON_REDRAINMISSILE, CEF_OWNERS_ORIGIN|CEF_FLAG6, + gi.CreateEffect(redarrow, FX_WEAPON_REDRAINMISSILE, CEF_OWNERS_ORIGIN|CEF_FLAG6, NULL, "t", redarrow->velocity); } else { // Red trail - gi.CreateEffect(&redarrow->s, FX_WEAPON_REDRAINMISSILE, CEF_OWNERS_ORIGIN, + gi.CreateEffect(redarrow, FX_WEAPON_REDRAINMISSILE, CEF_OWNERS_ORIGIN, NULL, "t", redarrow->velocity); } } diff --git a/src/game/spell/ripper.c b/src/game/spell/ripper.c index adea5b271..85aae251d 100644 --- a/src/game/spell/ripper.c +++ b/src/game/spell/ripper.c @@ -210,7 +210,7 @@ static void RipperImpact(edict_t *caster, edict_t *other, vec3_t startpos, vec3_ // little and make things more confusing than they are...) // Currently this sends 29 bytes plus the entity it's attached to. // This is down from (12 plus the entity) times eight, plus another effect for impact, plus another for the trail. - gi.CreateEffect(&ripper->s, FX_WEAPON_RIPPEREXPLODE, CEF_OWNERS_ORIGIN, NULL, "vbssssssss", + gi.CreateEffect(ripper, FX_WEAPON_RIPPEREXPLODE, CEF_OWNERS_ORIGIN, NULL, "vbssssssss", startpos, byaw, ballarray[0], diff --git a/src/game/spell/shield.c b/src/game/spell/shield.c index 1d7720fe0..1323ebdcf 100644 --- a/src/game/spell/shield.c +++ b/src/game/spell/shield.c @@ -19,7 +19,7 @@ void SpellCastShield(edict_t *caster,vec3_t startpos,vec3_t aimangles,vec3_t aim caster->client->playerinfo.shield_timer = level.time + (float)SHIELD_DURATION; // Start the lightning effect. - caster->PersistantCFX = gi.CreatePersistantEffect(&caster->s, FX_SPELL_LIGHTNINGSHIELD, CEF_OWNERS_ORIGIN|CEF_BROADCAST, NULL, ""); + caster->PersistantCFX = gi.CreatePersistantEffect(caster, FX_SPELL_LIGHTNINGSHIELD, CEF_OWNERS_ORIGIN|CEF_BROADCAST, NULL, ""); gi.sound(caster,CHAN_WEAPON,gi.soundindex("weapons/Shield.wav"),1,ATTN_NORM,0); caster->s.sound = gi.soundindex("weapons/ShieldIdle.wav"); @@ -80,7 +80,7 @@ void SpellLightningShieldAttack(edict_t *self) self->s.origin, "vbb", found->s.origin, (byte)SHIELD_LIGHTNING_WIDTH, (byte)0); // Do a nasty looking blast at the impact point - gi.CreateEffect(&found->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", dir); + gi.CreateEffect(found, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", dir); gi.sound(self, CHAN_WEAPON, gi.soundindex("weapons/ShieldAttack.wav"), 2, ATTN_NORM,0); diff --git a/src/game/spell/sphereofannihlation.c b/src/game/spell/sphereofannihlation.c index 96aadf656..ebb3830b4 100644 --- a/src/game/spell/sphereofannihlation.c +++ b/src/game/spell/sphereofannihlation.c @@ -31,9 +31,9 @@ #define SPHERE_RADIUS 2.0 -static void SphereOfAnnihilationGrowThink(edict_t *Self); -static void SphereOfAnnihilationTouch(edict_t *Self,edict_t *Other,cplane_t *Plane,csurface_t *Surface); -static void SphereWatcherGrowThink(edict_t *Self); +static void SphereOfAnnihilationGrowThink(edict_t *self); +static void SphereOfAnnihilationTouch(edict_t *self,edict_t *Other,cplane_t *Plane,csurface_t *Surface); +static void SphereWatcherGrowThink(edict_t *self); static void SphereWatcherTouch(edict_t *self, edict_t *Other, cplane_t *Plane, csurface_t *surface); extern void AlertMonsters (edict_t *self, edict_t *enemy, float lifetime, qboolean ignore_shadows); @@ -43,33 +43,33 @@ void create_sphere(edict_t *Sphere); // SphereOfAnnihilationGrowThink // **************************************************************************** -static void SphereOfAnnihilationGrowThink(edict_t *Self) +static void SphereOfAnnihilationGrowThink(edict_t *self) { vec3_t Forward, Up, endpos; trace_t trace; - if (Self->owner->client) - AngleVectors(Self->owner->client->aimangles,Forward,NULL,Up); + if (self->owner->client) + AngleVectors(self->owner->client->aimangles,Forward,NULL,Up); else - AngleVectors(Self->owner->s.angles,Forward,NULL,Up); + AngleVectors(self->owner->s.angles,Forward,NULL,Up); // NOTE: 'edict_t'->combattarget is used as a pointer to a 'qboolean' which flags // whether or not I have been released. Would like a dedicated value in the 'edict_t' but this // is unlikely to happen, sooooo... // if we have released, or we are dead, or a chicken, release the sphere - if(*(qboolean *)Self->combattarget && !(Self->owner->deadflag & (DEAD_DYING|DEAD_DEAD)) - && (Self->owner->client && !(Self->owner->client->playerinfo.edictflags & FL_CHICKEN)) && - (!(Self->owner->client->playerinfo.flags & PLAYER_FLAG_KNOCKDOWN))) + if(*(qboolean *)self->combattarget && !(self->owner->deadflag & (DEAD_DYING|DEAD_DEAD)) + && (self->owner->client && !(self->owner->client->playerinfo.edictflags & FL_CHICKEN)) && + (!(self->owner->client->playerinfo.flags & PLAYER_FLAG_KNOCKDOWN))) { - if (Self->count < SPHERE_MAX_CHARGES) + if (self->count < SPHERE_MAX_CHARGES) { float scale; - Self->count++; - scale = SPHERE_INIT_SCALE + (SPHERE_SCALE_PER_CHARGE * Self->count); - VectorSet(Self->s.scale, scale, scale, scale); + self->count++; + scale = SPHERE_INIT_SCALE + (SPHERE_SCALE_PER_CHARGE * self->count); + VectorSet(self->s.scale, scale, scale, scale); } else { @@ -77,76 +77,76 @@ static void SphereOfAnnihilationGrowThink(edict_t *Self) float scale; scale = SPHERE_MAX_SCALE + flrand(0, SPHERE_SCALE_PULSE); - VectorSet(Self->s.scale, scale, scale, scale); + VectorSet(self->s.scale, scale, scale, scale); } // detect if we have teleported, since we need to move with the player if thats so - if(Self->owner->client) + if(self->owner->client) { - VectorCopy(Self->owner->s.origin, Self->s.origin); - Self->s.origin[0] += Forward[0]*20.0; - Self->s.origin[1] += Forward[1]*20.0; - Self->s.origin[2] += Self->owner->viewheight-5.0; + VectorCopy(self->owner->s.origin, self->s.origin); + self->s.origin[0] += Forward[0]*20.0; + self->s.origin[1] += Forward[1]*20.0; + self->s.origin[2] += self->owner->viewheight-5.0; } - Self->nextthink=level.time+0.1; + self->nextthink=level.time+0.1; } else { vec3_t angles; // My caster has released me, so I am now a missile and I will fly like the wind. - Self->svflags &= ~SVF_NOCLIENT; + self->svflags &= ~SVF_NOCLIENT; - Self->s.effects&=~EF_MARCUS_FLAG1; + self->s.effects&=~EF_MARCUS_FLAG1; - VectorCopy(Self->owner->movedir,Self->movedir); + VectorCopy(self->owner->movedir,self->movedir); //FIXME: Need to get rid of the 'client' reference so that anything can cast this spell. //Check ahead first to see if it's going to hit anything at this angle - if(Self->owner->client) - VectorCopy(Self->owner->client->aimangles, angles); + if(self->owner->client) + VectorCopy(self->owner->client->aimangles, angles); else - VectorCopy(Self->owner->s.angles, angles); + VectorCopy(self->owner->s.angles, angles); AngleVectors(angles, Forward, NULL, NULL); - VectorMA(Self->s.origin, SPHERE_FLY_SPEED, Forward, endpos); - trace = gi.trace(Self->s.origin, vec3_origin, vec3_origin, endpos, Self->owner, MASK_MONSTERSOLID); - if(trace.ent && ok_to_autotarget(Self->owner, trace.ent)) + VectorMA(self->s.origin, SPHERE_FLY_SPEED, Forward, endpos); + trace = gi.trace(self->s.origin, vec3_origin, vec3_origin, endpos, self->owner, MASK_MONSTERSOLID); + if(trace.ent && ok_to_autotarget(self->owner, trace.ent)) {//already going to hit a valid target at this angle- so don't autotarget - VectorScale(Forward, SPHERE_FLY_SPEED, Self->velocity); + VectorScale(Forward, SPHERE_FLY_SPEED, self->velocity); } else {//autotarget current enemy - GetAimVelocity(Self->owner->enemy, Self->s.origin, SPHERE_FLY_SPEED, Self->owner->client->aimangles, Self->velocity); + GetAimVelocity(self->owner->enemy, self->s.origin, SPHERE_FLY_SPEED, self->owner->client->aimangles, self->velocity); } - VectorNormalize2(Self->velocity, Self->movedir); + VectorNormalize2(self->velocity, self->movedir); - Self->movetype=MOVETYPE_FLYMISSILE; - Self->solid=SOLID_BBOX; - Self->health=0; - Self->dmg = SPHERE_DAMAGE; - Self->dmg_radius = SPHERE_RADIUS_MIN + (SPHERE_RADIUS_PER_CHARGE * Self->count); - Self->touch=SphereOfAnnihilationTouch; - Self->think=NULL; + self->movetype=MOVETYPE_FLYMISSILE; + self->solid=SOLID_BBOX; + self->health=0; + self->dmg = SPHERE_DAMAGE; + self->dmg_radius = SPHERE_RADIUS_MIN + (SPHERE_RADIUS_PER_CHARGE * self->count); + self->touch=SphereOfAnnihilationTouch; + self->think=NULL; - VectorSet(Self->mins, -SPHERE_RADIUS, -SPHERE_RADIUS, -SPHERE_RADIUS); - VectorSet(Self->maxs, SPHERE_RADIUS, SPHERE_RADIUS, SPHERE_RADIUS); + VectorSet(self->mins, -SPHERE_RADIUS, -SPHERE_RADIUS, -SPHERE_RADIUS); + VectorSet(self->maxs, SPHERE_RADIUS, SPHERE_RADIUS, SPHERE_RADIUS); - Self->s.sound = 0; - gi.sound(Self,CHAN_WEAPON,gi.soundindex("weapons/SphereFire.wav"),1,ATTN_NORM,0); + self->s.sound = 0; + gi.sound(self,CHAN_WEAPON,gi.soundindex("weapons/SphereFire.wav"),1,ATTN_NORM,0); - trace = gi.trace(Self->s.origin, vec3_origin, vec3_origin, Self->s.origin, Self->owner, MASK_PLAYERSOLID); + trace = gi.trace(self->s.origin, vec3_origin, vec3_origin, self->s.origin, self->owner, MASK_PLAYERSOLID); if (trace.startsolid) { - SphereOfAnnihilationTouch(Self, trace.ent, &trace.plane, trace.surface); + SphereOfAnnihilationTouch(self, trace.ent, &trace.plane, trace.surface); return; } } } -static void SpherePowerLaserThink(edict_t *Self) +static void SpherePowerLaserThink(edict_t *self) { vec3_t shootDir; trace_t tr; @@ -164,10 +164,10 @@ static void SpherePowerLaserThink(edict_t *Self) int flags=CEF_FLAG7; int damage; - VectorCopy(Self->s.origin, startPos); - traceBuddy = Self; + VectorCopy(self->s.origin, startPos); + traceBuddy = self; sphere_dist = 2048.0; - VectorCopy(Self->s.angles,aimangles); + VectorCopy(self->s.angles,aimangles); AngleVectors(aimangles, shootDir, NULL, NULL); VectorMA(startPos, 12, shootDir, startPos); do @@ -198,7 +198,7 @@ static void SpherePowerLaserThink(edict_t *Self) VectorSubtract(tr.endpos, startPos, tempVect); traceDist = VectorLength(tempVect); gi.CreateEffect(NULL, FX_WEAPON_SPHEREPOWER, 0, startPos, "xbb", - shootDir, (byte)(AVG_VEC3T(Self->s.scale) * 7.5), (byte)(traceDist/8)); + shootDir, (byte)(AVG_VEC3T(self->s.scale) * 7.5), (byte)(traceDist/8)); // re-constitute aimangle aimangles[1] += flrand(160,200); @@ -208,12 +208,12 @@ static void SpherePowerLaserThink(edict_t *Self) } else { - if (tr.ent->fire_timestamp < Self->fire_timestamp) + if (tr.ent->fire_timestamp < self->fire_timestamp) { damage = SPHERE_DAMAGE; - T_Damage(tr.ent, Self, Self->owner, shootDir, tr.endpos, shootDir, + T_Damage(tr.ent, self, self->owner, shootDir, tr.endpos, shootDir, damage, damage, DAMAGE_SPELL, MOD_P_SPHERE); - tr.ent->fire_timestamp = Self->fire_timestamp; + tr.ent->fire_timestamp = self->fire_timestamp; } } } @@ -236,53 +236,53 @@ static void SpherePowerLaserThink(edict_t *Self) traceDist = VectorLength(tempVect); // decide if a decal is appropriate or not - if (Self->health==2) + if (self->health==2) flags|=CEF_FLAG8; - if(IsDecalApplicable(Self, tr.ent, Self->s.origin, tr.surface, &tr.plane, planedir)) + if(IsDecalApplicable(self, tr.ent, self->s.origin, tr.surface, &tr.plane, planedir)) flags|=CEF_FLAG6; gi.CreateEffect(NULL, FX_WEAPON_SPHEREPOWER, flags, startPos, "xbb", - shootDir, (byte)(AVG_VEC3T(Self->s.scale) * 7.5), (byte)(traceDist/8)); + shootDir, (byte)(AVG_VEC3T(self->s.scale) * 7.5), (byte)(traceDist/8)); - if (--Self->count <= 0) - G_SetToFree(Self); + if (--self->count <= 0) + G_SetToFree(self); else - Self->nextthink = level.time + 0.1; + self->nextthink = level.time + 0.1; } -static void SpherePowerLaserTouch(edict_t *Self,edict_t *Other,cplane_t *Plane, csurface_t *Surface) +static void SpherePowerLaserTouch(edict_t *self,edict_t *Other,cplane_t *Plane, csurface_t *Surface) { - G_SetToFree(Self); + G_SetToFree(self); } -static void SphereOfAnnihilationGrowThinkPower(edict_t *Self) +static void SphereOfAnnihilationGrowThinkPower(edict_t *self) { vec3_t Forward, Right, Up; edict_t *laser; - if (Self->owner->client) - AngleVectors(Self->owner->client->aimangles,Forward,Right,Up); + if (self->owner->client) + AngleVectors(self->owner->client->aimangles,Forward,Right,Up); else - AngleVectors(Self->owner->s.angles,Forward,Right,Up); + AngleVectors(self->owner->s.angles,Forward,Right,Up); // NOTE: 'edict_t'->combattarget is used as a pointer to a 'qboolean' which flags // whether or not I have been released. Would like a dedicated value in the 'edict_t' but this // is unlikely to happen, sooooo... - if(*(qboolean *)Self->combattarget && !(Self->owner->deadflag & (DEAD_DYING|DEAD_DEAD)) - && (Self->owner->client && !(Self->owner->client->playerinfo.edictflags & FL_CHICKEN)) && - (!(Self->owner->client->playerinfo.flags & PLAYER_FLAG_KNOCKDOWN))) + if(*(qboolean *)self->combattarget && !(self->owner->deadflag & (DEAD_DYING|DEAD_DEAD)) + && (self->owner->client && !(self->owner->client->playerinfo.edictflags & FL_CHICKEN)) && + (!(self->owner->client->playerinfo.flags & PLAYER_FLAG_KNOCKDOWN))) { - if (Self->count < SPHERE_MAX_CHARGES) + if (self->count < SPHERE_MAX_CHARGES) { float scale; - Self->count++; - scale = SPHERE_INIT_SCALE + (SPHERE_SCALE_PER_CHARGE * Self->count); - VectorSet(Self->s.scale, scale, scale, scale); + self->count++; + scale = SPHERE_INIT_SCALE + (SPHERE_SCALE_PER_CHARGE * self->count); + VectorSet(self->s.scale, scale, scale, scale); } else { @@ -290,30 +290,30 @@ static void SphereOfAnnihilationGrowThinkPower(edict_t *Self) float scale; scale = SPHERE_MAX_SCALE + flrand(0, SPHERE_SCALE_PULSE); - VectorSet(Self->s.scale, scale, scale, scale); + VectorSet(self->s.scale, scale, scale, scale); } // detect if we have teleported, since we need to move with the player if thats so - if(Self->owner->client) + if(self->owner->client) { - VectorCopy(Self->owner->s.origin, Self->s.origin); - Self->s.origin[0] += Forward[0] * 20.0; - Self->s.origin[1] += Forward[1] * 20.0; - Self->s.origin[2] += Self->owner->viewheight-5.0; + VectorCopy(self->owner->s.origin, self->s.origin); + self->s.origin[0] += Forward[0] * 20.0; + self->s.origin[1] += Forward[1] * 20.0; + self->s.origin[2] += self->owner->viewheight-5.0; } - Self->nextthink=level.time+0.1; + self->nextthink=level.time+0.1; } else { laser = G_Spawn(); - laser->owner = Self->owner; - laser->count = Self->count-SPHERE_COUNT_MIN; - VectorMA(Self->s.origin, 10.0, Right, laser->s.origin); - if (Self->owner->client) - VectorCopy(Self->owner->client->aimangles, laser->s.angles); + laser->owner = self->owner; + laser->count = self->count-SPHERE_COUNT_MIN; + VectorMA(self->s.origin, 10.0, Right, laser->s.origin); + if (self->owner->client) + VectorCopy(self->owner->client->aimangles, laser->s.angles); else - VectorCopy(Self->owner->s.angles, laser->s.angles); + VectorCopy(self->owner->s.angles, laser->s.angles); VectorScale(Right, SPHERE_LASER_SPEED, laser->velocity); laser->health = 1; // right laser->movetype=MOVETYPE_FLYMISSILE; @@ -326,13 +326,13 @@ static void SphereOfAnnihilationGrowThinkPower(edict_t *Self) SpherePowerLaserThink(laser); laser = G_Spawn(); - laser->owner = Self->owner; - laser->count = Self->count-SPHERE_COUNT_MIN; - VectorMA(Self->s.origin, -10.0, Right, laser->s.origin); - if (Self->owner->client) - VectorCopy(Self->owner->client->aimangles, laser->s.angles); + laser->owner = self->owner; + laser->count = self->count-SPHERE_COUNT_MIN; + VectorMA(self->s.origin, -10.0, Right, laser->s.origin); + if (self->owner->client) + VectorCopy(self->owner->client->aimangles, laser->s.angles); else - VectorCopy(Self->owner->s.angles, laser->s.angles); + VectorCopy(self->owner->s.angles, laser->s.angles); VectorScale(Right, -SPHERE_LASER_SPEED, laser->velocity); laser->health = 2; // left laser->movetype=MOVETYPE_FLYMISSILE; @@ -344,8 +344,8 @@ static void SphereOfAnnihilationGrowThinkPower(edict_t *Self) G_LinkMissile(laser); SpherePowerLaserThink(laser); - gi.sound(Self->owner,CHAN_WEAPON,gi.soundindex("weapons/SpherePowerFire.wav"),1,ATTN_NORM,0); - G_SetToFree(Self); + gi.sound(self->owner,CHAN_WEAPON,gi.soundindex("weapons/SpherePowerFire.wav"),1,ATTN_NORM,0); + G_SetToFree(self); } } @@ -376,14 +376,14 @@ edict_t *SphereReflect(edict_t *self, edict_t *other, vec3_t vel) VectorCopy(self->s.origin, Sphere->s.origin); G_LinkMissile(Sphere); - gi.CreateEffect(&Sphere->s, + gi.CreateEffect(Sphere, FX_WEAPON_SPHERE, CEF_OWNERS_ORIGIN, NULL, "s", (short)Sphere->owner->s.number); - gi.CreateEffect(&Sphere->s, + gi.CreateEffect(Sphere, FX_WEAPON_SPHEREGLOWBALLS, CEF_OWNERS_ORIGIN, NULL, @@ -395,7 +395,7 @@ edict_t *SphereReflect(edict_t *self, edict_t *other, vec3_t vel) G_SetToFree(self); // Do a nasty looking blast at the impact point - gi.CreateEffect(&Sphere->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", Sphere->velocity); + gi.CreateEffect(Sphere, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", Sphere->velocity); return(Sphere); } @@ -411,7 +411,7 @@ void SphereExplodeThink(edict_t *self) { T_Damage(ent, self, self->owner, self->velocity, ent->s.origin, vec3_origin, self->dmg, 0, 0, MOD_SPHERE); ent->fire_timestamp = self->fire_timestamp; - gi.CreateEffect(&ent->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", vec3_origin); + gi.CreateEffect(ent, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", vec3_origin); } } @@ -428,16 +428,16 @@ void SphereExplodeThink(edict_t *self) // SphereOfAnnihilationTouch // **************************************************************************** -static void SphereOfAnnihilationTouch(edict_t *self, edict_t *Other, cplane_t *Plane, csurface_t *surface) +static void SphereOfAnnihilationTouch(edict_t *self, edict_t *other, cplane_t *Plane, csurface_t *surface) { edict_t *explosion; // has the target got reflection turned on ? - if(EntReflecting(Other, true, true) && self->reflect_debounce_time) + if(EntReflecting(other, true, true) && self->reflect_debounce_time) { Create_rand_relect_vect(self->velocity, self->velocity); Vec3ScaleAssign(SPHERE_FLY_SPEED/2, self->velocity); - SphereReflect(self, Other, self->velocity); + SphereReflect(self, other, self->velocity); return; } @@ -465,7 +465,7 @@ static void SphereOfAnnihilationTouch(edict_t *self, edict_t *Other, cplane_t *P // help fix hitting base of a stair and not hurting a guy on next step up. VectorMA(self->s.origin, -8.0, self->movedir, self->s.origin); - gi.CreateEffect(&self->s, FX_WEAPON_SPHEREPLAYEREXPLODE, CEF_OWNERS_ORIGIN, NULL, + gi.CreateEffect(self, FX_WEAPON_SPHEREPLAYEREXPLODE, CEF_OWNERS_ORIGIN, NULL, "db", self->movedir, (byte)(self->count)); gi.sound(self,CHAN_WEAPON,gi.soundindex("weapons/SphereImpact.wav"),2,ATTN_NORM,0); @@ -474,11 +474,11 @@ static void SphereOfAnnihilationTouch(edict_t *self, edict_t *Other, cplane_t *P // Do damage directly to the thing you hit. This is mainly for big creatures, like the trial beast. // The sphere will not damage the other after this initial impact. - if (Other && Other->takedamage) + if (other && other->takedamage) { - T_Damage(Other, self, self->owner, self->velocity, self->s.origin, vec3_origin, self->dmg, 0, 0, MOD_SPHERE); - Other->fire_timestamp = level.time; - gi.CreateEffect(&Other->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", vec3_origin); + T_Damage(other, self, self->owner, self->velocity, self->s.origin, vec3_origin, self->dmg, 0, 0, MOD_SPHERE); + other->fire_timestamp = level.time; + gi.CreateEffect(other, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", vec3_origin); } SphereExplodeThink(explosion); @@ -561,7 +561,7 @@ void SpellCastSphereOfAnnihilation(edict_t *Caster,vec3_t StartPos,vec3_t AimAng else flags = CEF_OWNERS_ORIGIN; - gi.CreateEffect(&Sphere->s, + gi.CreateEffect(Sphere, FX_WEAPON_SPHERE, flags, StartPos, @@ -573,7 +573,7 @@ void SpellCastSphereOfAnnihilation(edict_t *Caster,vec3_t StartPos,vec3_t AimAng else flags = CEF_OWNERS_ORIGIN; - gi.CreateEffect(&Sphere->s, + gi.CreateEffect(Sphere, FX_WEAPON_SPHEREGLOWBALLS, flags, StartPos, @@ -599,117 +599,117 @@ void SpellCastSphereOfAnnihilation(edict_t *Caster,vec3_t StartPos,vec3_t AimAng // SphereWatcherFlyThink // **************************************************************************** -void SphereWatcherFlyThink(edict_t *Self) +void SphereWatcherFlyThink(edict_t *self) { - Self->count++; + self->count++; - if(Self->count > 20) + if(self->count > 20) { // End the circling... - G_SetToFree(Self); + G_SetToFree(self); } else { - Self->nextthink=level.time+0.2; + self->nextthink=level.time+0.2; } } -static void SphereWatcherGrowThink(edict_t *Self) +static void SphereWatcherGrowThink(edict_t *self) { vec3_t Forward, Up, endpos; trace_t trace; - if (Self->owner->client) - AngleVectors(Self->owner->client->aimangles,Forward,NULL,Up); + if (self->owner->client) + AngleVectors(self->owner->client->aimangles,Forward,NULL,Up); else - AngleVectors(Self->owner->s.angles,Forward,NULL,Up); + AngleVectors(self->owner->s.angles,Forward,NULL,Up); // NOTE: 'edict_t'->combattarget is used as a pointer to a 'qboolean' which flags // whether or not I have been released. Would like a dedicated value in the 'edict_t' but this // is unlikely to happen, sooooo... // if we have released, or we are dead, or a chicken, release the sphere - if(*(qboolean *)Self->combattarget && !(Self->owner->deadflag & (DEAD_DYING|DEAD_DEAD))) + if(*(qboolean *)self->combattarget && !(self->owner->deadflag & (DEAD_DYING|DEAD_DEAD))) { - Self->count+=irand(1,2); + self->count+=irand(1,2); - if((Self->count > 10) && (AVG_VEC3T(Self->s.scale) < SPHERE_MAX_SCALE)) + if((self->count > 10) && (AVG_VEC3T(self->s.scale) < SPHERE_MAX_SCALE)) { - if(Self->count > 20) + if(self->count > 20) { - Self->s.scale[0] -= 0.01; - Self->s.scale[1] -= 0.01; - Self->s.scale[2] -= 0.01; + self->s.scale[0] -= 0.01; + self->s.scale[1] -= 0.01; + self->s.scale[2] -= 0.01; } else { - Self->s.scale[0] += 0.1; - Self->s.scale[1] += 0.1; - Self->s.scale[2] += 0.1; + self->s.scale[0] += 0.1; + self->s.scale[1] += 0.1; + self->s.scale[2] += 0.1; } - if(Self->count>25) + if(self->count>25) { - Self->count&=3; + self->count&=3; } } - Self->nextthink=level.time+0.1; + self->nextthink=level.time+0.1; } else { vec3_t angles; // My caster has released me, so I am now a missile and I will fly like the wind. - Self->svflags &= ~SVF_NOCLIENT; + self->svflags &= ~SVF_NOCLIENT; - Self->s.effects&=~EF_MARCUS_FLAG1; + self->s.effects&=~EF_MARCUS_FLAG1; - VectorCopy(Self->owner->movedir,Self->movedir); + VectorCopy(self->owner->movedir,self->movedir); //Check ahead first to see if it's going to hit anything at this angle - VectorCopy(Self->owner->s.angles, angles); + VectorCopy(self->owner->s.angles, angles); AngleVectors(angles, Forward, NULL, NULL); - VectorMA(Self->s.origin, SPHERE_FLY_SPEED, Forward, endpos); - trace = gi.trace(Self->s.origin, vec3_origin, vec3_origin, endpos, Self->owner, MASK_MONSTERSOLID); - if(trace.ent && ok_to_autotarget(Self->owner, trace.ent)) + VectorMA(self->s.origin, SPHERE_FLY_SPEED, Forward, endpos); + trace = gi.trace(self->s.origin, vec3_origin, vec3_origin, endpos, self->owner, MASK_MONSTERSOLID); + if(trace.ent && ok_to_autotarget(self->owner, trace.ent)) {//already going to hit a valid target at this angle- so don't autotarget - VectorScale(Forward, SPHERE_FLY_SPEED, Self->velocity); + VectorScale(Forward, SPHERE_FLY_SPEED, self->velocity); } else {//autotarget current enemy - GetAimVelocity(Self->owner->enemy, Self->s.origin, SPHERE_FLY_SPEED, Self->s.angles, Self->velocity); + GetAimVelocity(self->owner->enemy, self->s.origin, SPHERE_FLY_SPEED, self->s.angles, self->velocity); } - VectorNormalize2(Self->velocity, Self->movedir); - - Self->movetype=MOVETYPE_FLYMISSILE; - Self->solid=SOLID_BBOX; - Self->health=0; - Self->count=0; - Self->dmg= SPHERE_WATCHER_DAMAGE_MIN + - (SPHERE_WATCHER_DAMAGE_RANGE*((AVG_VEC3T(Self->s.scale) - SPHERE_INIT_SCALE)/SPHERE_SCALE_RANGE)); - Self->dmg_radius = + VectorNormalize2(self->velocity, self->movedir); + + self->movetype=MOVETYPE_FLYMISSILE; + self->solid=SOLID_BBOX; + self->health=0; + self->count=0; + self->dmg= SPHERE_WATCHER_DAMAGE_MIN + + (SPHERE_WATCHER_DAMAGE_RANGE*((AVG_VEC3T(self->s.scale) - SPHERE_INIT_SCALE)/SPHERE_SCALE_RANGE)); + self->dmg_radius = SPHERE_WATCHER_EXPLOSION_RADIUS_MIN + (SPHERE_WATCHER_EXPLOSION_RADIUS_MAX - SPHERE_WATCHER_EXPLOSION_RADIUS_MIN) * - (AVG_VEC3T(Self->s.scale) - SPHERE_INIT_SCALE)/SPHERE_SCALE_RANGE; - Self->touch=SphereWatcherTouch; - Self->think=SphereWatcherFlyThink; - Self->nextthink=level.time+0.1; + (AVG_VEC3T(self->s.scale) - SPHERE_INIT_SCALE)/SPHERE_SCALE_RANGE; + self->touch=SphereWatcherTouch; + self->think=SphereWatcherFlyThink; + self->nextthink=level.time+0.1; - VectorSet(Self->mins, -SPHERE_RADIUS, -SPHERE_RADIUS, -SPHERE_RADIUS); - VectorSet(Self->maxs, SPHERE_RADIUS, SPHERE_RADIUS, SPHERE_RADIUS); + VectorSet(self->mins, -SPHERE_RADIUS, -SPHERE_RADIUS, -SPHERE_RADIUS); + VectorSet(self->maxs, SPHERE_RADIUS, SPHERE_RADIUS, SPHERE_RADIUS); - Self->s.sound = 0; - gi.sound(Self,CHAN_WEAPON,gi.soundindex("weapons/SphereFire.wav"),1,ATTN_NORM,0); + self->s.sound = 0; + gi.sound(self, CHAN_WEAPON, gi.soundindex("weapons/SphereFire.wav"), 1, ATTN_NORM, 0); - trace = gi.trace(Self->s.origin, vec3_origin, vec3_origin, Self->s.origin, Self->owner, MASK_PLAYERSOLID); + trace = gi.trace(self->s.origin, vec3_origin, vec3_origin, self->s.origin, self->owner, MASK_PLAYERSOLID); if (trace.startsolid) { - SphereWatcherTouch(Self, trace.ent, &trace.plane, trace.surface); + SphereWatcherTouch(self, trace.ent, &trace.plane, trace.surface); return; } } @@ -745,14 +745,14 @@ edict_t *SphereWatcherReflect(edict_t *self, edict_t *other, vec3_t vel) VectorCopy(self->s.origin, Sphere->s.origin); G_LinkMissile(Sphere); - gi.CreateEffect(&Sphere->s, + gi.CreateEffect(Sphere, FX_WEAPON_SPHERE, CEF_OWNERS_ORIGIN, NULL, "s", (short)Sphere->owner->s.number); - gi.CreateEffect(&Sphere->s, + gi.CreateEffect(Sphere, FX_WEAPON_SPHEREGLOWBALLS, CEF_OWNERS_ORIGIN, NULL, @@ -764,7 +764,7 @@ edict_t *SphereWatcherReflect(edict_t *self, edict_t *other, vec3_t vel) G_SetToFree(self); // Do a nasty looking blast at the impact point - gi.CreateEffect(&Sphere->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", Sphere->velocity); + gi.CreateEffect(Sphere, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", Sphere->velocity); return(Sphere); } @@ -809,7 +809,7 @@ static void SphereWatcherTouch(edict_t *self, edict_t *Other, cplane_t *Plane, c { makeScorch = CEF_FLAG6; } - gi.CreateEffect(&self->s, FX_WEAPON_SPHEREEXPLODE, CEF_OWNERS_ORIGIN | makeScorch, NULL, + gi.CreateEffect(self, FX_WEAPON_SPHEREEXPLODE, CEF_OWNERS_ORIGIN | makeScorch, 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); diff --git a/src/game/spell/teleport.c b/src/game/spell/teleport.c index 5e977ca28..e013f6fc4 100644 --- a/src/game/spell/teleport.c +++ b/src/game/spell/teleport.c @@ -56,7 +56,7 @@ void Perform_Teleport(edict_t *self) gi.linkentity(self); // draw the teleport splash at the destination - gi.CreateEffect(&self->s, FX_PLAYER_TELEPORT_IN, CEF_BROADCAST|CEF_OWNERS_ORIGIN | ((byte)self->client->tele_type << 5), NULL, "" ); + gi.CreateEffect(self, FX_PLAYER_TELEPORT_IN, CEF_BROADCAST|CEF_OWNERS_ORIGIN | ((byte)self->client->tele_type << 5), NULL, "" ); // restart the loop and tell us next time we aren't de-materialising self->client->tele_count = TELE_TIME; @@ -175,7 +175,7 @@ void teleporter_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_ other->s.color[2] = 255; // draw the teleport splash at the teleport source - gi.CreateEffect(&other->s, FX_PLAYER_TELEPORT_OUT, CEF_OWNERS_ORIGIN | ((byte)other->client->tele_type << 5), NULL, "" ); + gi.CreateEffect(other, FX_PLAYER_TELEPORT_OUT, CEF_OWNERS_ORIGIN | ((byte)other->client->tele_type << 5), NULL, "" ); // do the teleport sound gi.sound(other,CHAN_VOICE,gi.soundindex("weapons/teleport.wav"),1,ATTN_NORM,0); @@ -231,7 +231,7 @@ void SpellCastTeleport(edict_t *caster,vec3_t StartPos,vec3_t AimAngles,vec3_t A caster->s.color[3] = 255; // draw the teleport splash at the teleport source - gi.CreateEffect(&caster->s, FX_PLAYER_TELEPORT_OUT, CEF_OWNERS_ORIGIN | ((byte)caster->client->tele_type << 5), NULL, "" ); + gi.CreateEffect(caster, FX_PLAYER_TELEPORT_OUT, CEF_OWNERS_ORIGIN | ((byte)caster->client->tele_type << 5), NULL, "" ); // do the teleport sound gi.sound(caster,CHAN_VOICE,gi.soundindex("weapons/teleport.wav"),1,ATTN_NORM,0); } diff --git a/src/game/spell/tornado.c b/src/game/spell/tornado.c index 55de9c296..78fb428f5 100644 --- a/src/game/spell/tornado.c +++ b/src/game/spell/tornado.c @@ -55,7 +55,7 @@ static void TornadoThink(edict_t *self) if (ent->takedamage) { // Do a nasty looking blast at the impact point - gi.CreateEffect(&ent->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", ent->velocity); + gi.CreateEffect(ent, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", ent->velocity); VectorClear(ent->velocity); // no damage if reflection is on. @@ -111,7 +111,7 @@ void create_tornado(edict_t *tornado) tornado->s.effects |= EF_SPEED_ACTIVE; tornado->jump_time = level.time + flrand(0.2, 1.0); - tornado->PersistantCFX = gi.CreatePersistantEffect(&tornado->s, FX_TORNADO, CEF_BROADCAST|CEF_OWNERS_ORIGIN | flags , NULL, ""); + tornado->PersistantCFX = gi.CreatePersistantEffect(tornado, FX_TORNADO, CEF_BROADCAST|CEF_OWNERS_ORIGIN | flags , NULL, ""); } @@ -182,7 +182,7 @@ void SpellCastDropTornado(edict_t *caster, vec3_t startpos, vec3_t aimangles, ve } } - gi.CreateEffect(&tornado->s, FX_TORNADO_BALL, CEF_OWNERS_ORIGIN | flags , NULL, ""); + gi.CreateEffect(tornado, FX_TORNADO_BALL, CEF_OWNERS_ORIGIN | flags , NULL, ""); } @@ -238,14 +238,14 @@ edict_t *tornboltReflect(edict_t *self, edict_t *other, vec3_t vel) G_LinkMissile(tornbolt); // create new trails for the new missile - gi.CreateEffect(&tornbolt->s, FX_WEAPON_FLYINGFIST, CEF_OWNERS_ORIGIN | CEF_FLAG6, NULL, + gi.CreateEffect(tornbolt, FX_WEAPON_FLYINGFIST, CEF_OWNERS_ORIGIN | CEF_FLAG6, NULL, "t", tornbolt->velocity); // kill the existing missile, since its a pain in the ass to modify it so the physics won't screw it. G_SetToFree(self); // Do a nasty looking blast at the impact point - gi.CreateEffect(&tornbolt->s, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", tornbolt->velocity); + gi.CreateEffect(tornbolt, FX_LIGHTNING_HIT, CEF_OWNERS_ORIGIN, NULL, "t", tornbolt->velocity); return(tornbolt); } @@ -360,6 +360,6 @@ void SpellCasttornbolt(edict_t *caster, vec3_t startpos, vec3_t aimangles, vec3_ } // Spawn effect after it has been determined it has not started in wall // This is so it won`t try to remove it before it exists - gi.CreateEffect(&tornbolt->s, FX_WEAPON_FLYINGFIST, CEF_OWNERS_ORIGIN | CEF_FLAG6, NULL, + gi.CreateEffect(tornbolt, FX_WEAPON_FLYINGFIST, CEF_OWNERS_ORIGIN | CEF_FLAG6, NULL, "t", tornbolt->velocity); } diff --git a/src/game/spell/wall.c b/src/game/spell/wall.c index 1cf558aa7..7cca27655 100644 --- a/src/game/spell/wall.c +++ b/src/game/spell/wall.c @@ -73,7 +73,7 @@ edict_t *CreateFireBlast(vec3_t startpos, vec3_t angles, edict_t *owner, int hea angle_yaw = (short)(angles[YAW]*(65536.0/360.0)); angle_pitch = (short)(angles[PITCH]*(65536.0/360.0)); - gi.CreateEffect(&wall->s, FX_WEAPON_FIREBURST, CEF_OWNERS_ORIGIN, NULL, "ss", angle_yaw, angle_pitch); + gi.CreateEffect(wall, FX_WEAPON_FIREBURST, CEF_OWNERS_ORIGIN, NULL, "ss", angle_yaw, angle_pitch); return wall; } @@ -99,7 +99,7 @@ void FireBlastBlocked(edict_t *self, trace_t *trace) { T_Damage(trace->ent, self, self->owner, self->movedir, self->s.origin, vec3_origin, self->dmg, self->dmg, DAMAGE_FIRE | DAMAGE_FIRE_LINGER, MOD_FIREWALL); - gi.CreateEffect(&(trace->ent->s), FX_FLAREUP, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(trace->ent, FX_FLAREUP, CEF_OWNERS_ORIGIN, NULL, ""); gi.sound(self,CHAN_WEAPON,gi.soundindex("weapons/FirewallDamage.wav"),1,ATTN_NORM,0); @@ -171,7 +171,7 @@ void FireBlastThink(edict_t *self) { T_Damage(ent, self, self->owner, self->movedir, self->s.origin, vec3_origin, self->dmg, self->dmg, DAMAGE_FIRE | DAMAGE_FIRE_LINGER, MOD_FIREWALL); - gi.CreateEffect(&ent->s, FX_FLAREUP, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(ent, FX_FLAREUP, CEF_OWNERS_ORIGIN, NULL, ""); gi.sound(self,CHAN_WEAPON,gi.soundindex("weapons/FirewallDamage.wav"),1,ATTN_NORM,0); @@ -297,7 +297,7 @@ edict_t *CreateFireWall(vec3_t startpos, vec3_t angles, edict_t *owner, int heal angle_yaw = (short)(angles[YAW]*(65536.0/360.0)); angle_pitch = (short)(angles[PITCH]*(65536.0/360.0)); - gi.CreateEffect(&wall->s, FX_WEAPON_FIREWAVE, CEF_OWNERS_ORIGIN | flags, startpos, "ss", angle_yaw, angle_pitch); + gi.CreateEffect(wall, FX_WEAPON_FIREWAVE, CEF_OWNERS_ORIGIN | flags, startpos, "ss", angle_yaw, angle_pitch); return wall; } @@ -340,7 +340,7 @@ void WallMissileBlocked(edict_t *self, trace_t *trace) { T_Damage(trace->ent, self, self->owner, self->movedir, self->s.origin, vec3_origin, self->dmg, self->dmg, DAMAGE_FIRE | DAMAGE_FIRE_LINGER, MOD_FIREWALL); - gi.CreateEffect(&(trace->ent->s), FX_FLAREUP, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(trace->ent, FX_FLAREUP, CEF_OWNERS_ORIGIN, NULL, ""); trace->ent->fire_timestamp = self->fire_timestamp; @@ -422,7 +422,7 @@ void WallMissileThink(edict_t *self) { T_Damage(ent, self, self->owner, self->movedir, self->s.origin, vec3_origin, self->dmg, self->dmg, DAMAGE_FIRE | DAMAGE_FIRE_LINGER, MOD_FIREWALL); - gi.CreateEffect(&ent->s, FX_FLAREUP, CEF_OWNERS_ORIGIN, NULL, ""); + gi.CreateEffect(ent, FX_FLAREUP, CEF_OWNERS_ORIGIN, NULL, ""); ent->fire_timestamp = self->fire_timestamp; diff --git a/src/server/sv_game.c b/src/server/sv_game.c index 2a04ed2fc..241cf6daf 100644 --- a/src/server/sv_game.c +++ b/src/server/sv_game.c @@ -389,8 +389,8 @@ game_export_t* GetGameAPI(game_import_t* import); void MSG_WriteData(sizebuf_t* sb, byte* data, int len); -void -SV_CreateEffectEvent(byte EventId, entity_state_t* ent, int type, int flags, vec3_t origin, char* format, ...) +static void +SV_CreateEffectEvent(byte EventId, edict_t* ent, int type, int flags, vec3_t origin, char* format, ...) { if (developer && developer->value) { @@ -398,8 +398,8 @@ SV_CreateEffectEvent(byte EventId, entity_state_t* ent, int type, int flags, vec } } -void -SV_RemoveEffectsEvent(byte EventId, entity_state_t* ent, int type) +static void +SV_RemoveEffectsEvent(byte EventId, edict_t* ent, int type) { if (developer && developer->value) { @@ -416,10 +416,10 @@ qboolean SV_RemovePersistantEffect(int toRemove, int call_from) return false; } -void -SV_RemoveEffects(entity_state_t* ent, int type) +static void +SV_RemoveEffects(edict_t* ent, int type) { - ent->clientEffects.numEffects = 0; + ent->s.clientEffects.numEffects = 0; } void @@ -498,7 +498,7 @@ SV_WriteClientEffectsToClient(client_frame_t* from, client_frame_t* to, sizebuf_ } int -SV_CreatePersistantEffect(entity_state_t* ent, int type, int flags, vec3_t origin, char* format, ...) +SV_CreatePersistantEffect(edict_t* ent, int type, int flags, vec3_t origin, char* format, ...) { int enta; int effectID = -1; @@ -509,7 +509,7 @@ SV_CreatePersistantEffect(entity_state_t* ent, int type, int flags, vec3_t origi va_start(args, format); if (ent) { - enta = ent->number; + enta = ent->s.number; } else { enta = -1; @@ -559,17 +559,17 @@ SV_CreatePersistantEffect(entity_state_t* ent, int type, int flags, vec3_t origi if (ent != NULL) { - ent->clientEffects.buf = &effect->buf[0]; - ent->clientEffects.bufSize = sizeof(effect->buf); - ent->clientEffects.numEffects = 1; + ent->s.clientEffects.buf = &effect->buf[0]; + ent->s.clientEffects.bufSize = sizeof(effect->buf); + ent->s.clientEffects.numEffects = 1; if (type == (int)FX_MAGIC_PORTAL) { - ent->clientEffects.isPersistant = true; + ent->s.clientEffects.isPersistant = true; } else { - ent->clientEffects.isPersistant = false; + ent->s.clientEffects.isPersistant = false; } } @@ -605,7 +605,7 @@ SV_CreatePersistantEffect(entity_state_t* ent, int type, int flags, vec3_t origi } void -SV_CreateEffect(entity_state_t* ent, int type, int flags, vec3_t origin, char* format, ...) +SV_CreateEffect(edict_t* ent, int type, int flags, vec3_t origin, char* format, ...) { int enta; int effectID = -1; @@ -616,7 +616,7 @@ SV_CreateEffect(entity_state_t* ent, int type, int flags, vec3_t origin, char* f va_start(args, format); if (ent) { - enta = ent->number; + enta = ent->s.number; } else { enta = -1; @@ -660,9 +660,9 @@ SV_CreateEffect(entity_state_t* ent, int type, int flags, vec3_t origin, char* f if (ent != NULL) { - ent->clientEffects.buf = &effect->buf[0]; - ent->clientEffects.bufSize = sizeof(effect->buf); - ent->clientEffects.numEffects = 1; + ent->s.clientEffects.buf = &effect->buf[0]; + ent->s.clientEffects.bufSize = sizeof(effect->buf); + ent->s.clientEffects.numEffects = 1; } testflags = flags;