From 26f85245b9d4b800ddfcab6e8f513e1f9664182c Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Wed, 6 Nov 2024 23:53:55 +0200 Subject: [PATCH] game: sync droptofloor --- src/game/character/ai.c | 8 +- src/game/character/dranor/dranor.c | 4 +- src/game/character/elflord/elflord.c | 4 +- src/game/character/priestess/priestess.c | 4 +- src/game/character/priestess/priestess2.c | 4 +- src/game/character/siernan/siernan1.c | 4 +- src/game/character/siernan/siernan2.c | 4 +- .../character/ssithrascout/ssithrascout.c | 4 +- src/game/character/tome/tome.c | 4 +- .../character/victimssithra/victimssithra.c | 4 +- src/game/ds.cpp | 4 +- src/game/effects/client_entities.c | 2 +- src/game/effects/netmsg_read.c | 2 +- src/game/g_breakable.c | 2 +- src/game/g_combat.c | 2 +- src/game/g_env.c | 4 +- src/game/g_field.c | 4 +- src/game/g_flamethrow.c | 4 +- src/game/g_func.c | 4 +- src/game/g_items.c | 276 ++++++++++-------- src/game/g_light.c | 6 +- src/game/g_misc.c | 22 +- src/game/g_monster.c | 16 +- src/game/g_obj.c | 32 +- src/game/g_phys.c | 52 ++-- src/game/g_physics.c | 4 +- src/game/g_shrine.c | 24 +- src/game/g_spawn.c | 2 +- src/game/g_trigger.c | 10 +- src/game/mg_ai.c | 32 +- src/game/mg_guide.c | 2 +- src/game/monster/actor/actor.c | 30 +- src/game/monster/assassin/assassin.c | 10 +- src/game/monster/beast/beast.c | 4 +- src/game/monster/boss3/boss32.c | 4 +- src/game/monster/dog/dog.c | 2 +- src/game/monster/enforcer/enforcer.c | 2 +- src/game/monster/fish/fish.c | 8 +- src/game/monster/gorgon/gorgon.c | 34 +-- src/game/monster/gorgon/gorgon_anim.c | 2 +- src/game/monster/harpy/harpy.c | 4 +- src/game/monster/hknight/hknight.c | 2 +- src/game/monster/imp/imp.c | 2 +- src/game/monster/misc/fmtest.c | 6 +- src/game/monster/misc/move.c | 2 +- src/game/monster/mother/mother.c | 4 +- src/game/monster/ogle/ogle.c | 2 +- .../monster/plaguessithra/plaguessithra.c | 8 +- src/game/monster/priestess/priestess.c | 2 +- src/game/monster/shalrath/shalrath.c | 2 +- src/game/monster/shambler/shambler.c | 4 +- src/game/monster/spreader/spreadermist.c | 18 +- src/game/monster/tank/tank.c | 4 +- src/game/monster/tarbaby/tarbaby.c | 2 +- src/game/monster/tcheckrik/tcheckrik.c | 4 +- src/game/monster/wizard/wizard.c | 4 +- src/game/player/chase.c | 6 +- src/game/player/client.c | 14 +- src/game/spell/morph.c | 4 +- src/game/spell/teleport.c | 10 +- src/game/spell/tornado.c | 4 +- 61 files changed, 399 insertions(+), 355 deletions(-) diff --git a/src/game/character/ai.c b/src/game/character/ai.c index 12fd15761..7b8f8537f 100644 --- a/src/game/character/ai.c +++ b/src/game/character/ai.c @@ -199,10 +199,10 @@ void c_corvus_init(edict_t *self,int classId) self->yaw_speed = 20; VectorClear(self->knockbackvel); - VectorCopy (c_mins, self->mins); - VectorCopy (c_maxs, self->maxs); - VectorCopy (c_mins, self->intentMins); - VectorCopy (c_maxs, self->intentMaxs); + VectorCopy(c_mins, self->mins); + VectorCopy(c_maxs, self->maxs); + VectorCopy(c_mins, self->intentMins); + VectorCopy(c_maxs, self->intentMaxs); self->viewheight = self->maxs[2]*0.8; diff --git a/src/game/character/dranor/dranor.c b/src/game/character/dranor/dranor.c index be87c43bf..c669b5ef2 100644 --- a/src/game/character/dranor/dranor.c +++ b/src/game/character/dranor/dranor.c @@ -178,8 +178,8 @@ The elf who talks like Sean Connery */ void SP_character_dranor (edict_t *self) { - VectorSet (self->mins, -16, -16, -32); - VectorSet (self->maxs, 16, 16, 32); + VectorSet(self->mins, -16, -16, -32); + VectorSet(self->maxs, 16, 16, 32); c_character_init(self,CID_DRANOR); diff --git a/src/game/character/elflord/elflord.c b/src/game/character/elflord/elflord.c index 2ffb2b08e..47830d2c4 100644 --- a/src/game/character/elflord/elflord.c +++ b/src/game/character/elflord/elflord.c @@ -188,8 +188,8 @@ The Celestial Watcher who whispers when he talks */ void SP_character_elflord (edict_t *self) { - VectorSet (self->mins, -24, -24, -78); - VectorSet (self->maxs, 24, 24, 16); + VectorSet(self->mins, -24, -24, -78); + VectorSet(self->maxs, 24, 24, 16); c_character_init(self,CID_C_ELFLORD); diff --git a/src/game/character/priestess/priestess.c b/src/game/character/priestess/priestess.c index 35acbf5f9..4e9d373e9 100644 --- a/src/game/character/priestess/priestess.c +++ b/src/game/character/priestess/priestess.c @@ -198,8 +198,8 @@ INVISIBLE - you won't see her */ void SP_character_highpriestess (edict_t *self) { - VectorSet (self->mins, -16, -16, -32); - VectorSet (self->maxs, 16, 16, 32); + VectorSet(self->mins, -16, -16, -32); + VectorSet(self->maxs, 16, 16, 32); c_character_init(self,CID_C_HIGHPRIESTESS); } diff --git a/src/game/character/priestess/priestess2.c b/src/game/character/priestess/priestess2.c index 74a9e5115..a466888bd 100644 --- a/src/game/character/priestess/priestess2.c +++ b/src/game/character/priestess/priestess2.c @@ -130,8 +130,8 @@ INVISIBLE - you won't see her */ void SP_character_highpriestess2 (edict_t *self) { - VectorSet (self->mins, -16, -16, -38); - VectorSet (self->maxs, 16, 16, 38); + VectorSet(self->mins, -16, -16, -38); + VectorSet(self->maxs, 16, 16, 38); c_character_init(self,CID_C_HIGHPRIESTESS2); } diff --git a/src/game/character/siernan/siernan1.c b/src/game/character/siernan/siernan1.c index bb6e5dea8..2f2f013a5 100644 --- a/src/game/character/siernan/siernan1.c +++ b/src/game/character/siernan/siernan1.c @@ -213,8 +213,8 @@ LEANING - leaning against a wall, idling */ void SP_character_siernan1 (edict_t *self) { - VectorSet (self->mins, -10, -10, -20); - VectorSet (self->maxs, 10, 10, 20); + VectorSet(self->mins, -10, -10, -20); + VectorSet(self->maxs, 10, 10, 20); self->s.scale = self->monsterinfo.scale = 1.2; diff --git a/src/game/character/siernan/siernan2.c b/src/game/character/siernan/siernan2.c index 179809a63..2649801fc 100644 --- a/src/game/character/siernan/siernan2.c +++ b/src/game/character/siernan/siernan2.c @@ -100,8 +100,8 @@ The cinematic siernan laying down */ void SP_character_siernan2 (edict_t *self) { - VectorSet (self->mins, -17, -25, 0); - VectorSet (self->maxs, 22, 12, 16); + VectorSet(self->mins, -17, -25, 0); + VectorSet(self->maxs, 22, 12, 16); self->s.scale = self->monsterinfo.scale = 1; diff --git a/src/game/character/ssithrascout/ssithrascout.c b/src/game/character/ssithrascout/ssithrascout.c index 04fd91b75..8d271d9ea 100644 --- a/src/game/character/ssithrascout/ssithrascout.c +++ b/src/game/character/ssithrascout/ssithrascout.c @@ -161,8 +161,8 @@ The scout */ void SP_character_ssithra_scout (edict_t *self) { - VectorSet (self->mins, -26, -16, -13); - VectorSet (self->maxs, 26, 16, 13); + VectorSet(self->mins, -26, -16, -13); + VectorSet(self->maxs, 26, 16, 13); c_character_init(self,CID_SSITHRA_SCOUT); } diff --git a/src/game/character/tome/tome.c b/src/game/character/tome/tome.c index d331cb116..5f4844f57 100644 --- a/src/game/character/tome/tome.c +++ b/src/game/character/tome/tome.c @@ -89,8 +89,8 @@ The talking tome of power (sounds like a hot babe) */ void SP_character_tome (edict_t *self) { - VectorSet (self->mins, -4, -8, -12); - VectorSet (self->maxs, 4, 8, 12); + VectorSet(self->mins, -4, -8, -12); + VectorSet(self->maxs, 4, 8, 12); c_character_init(self,CID_C_TOME); } diff --git a/src/game/character/victimssithra/victimssithra.c b/src/game/character/victimssithra/victimssithra.c index 07be04778..d8756d73d 100644 --- a/src/game/character/victimssithra/victimssithra.c +++ b/src/game/character/victimssithra/victimssithra.c @@ -119,8 +119,8 @@ The Ssithra Victim for use in the torture scene */ void SP_character_ssithra_victim (edict_t *self) { - VectorSet (self->mins, -40, -16, -2); - VectorSet (self->maxs, 40, 16, 2); + VectorSet(self->mins, -40, -16, -2); + VectorSet(self->maxs, 40, 16, 2); c_character_init(self,CID_SSITHRA_VICTIM); diff --git a/src/game/ds.cpp b/src/game/ds.cpp index 825553a39..29aa80f53 100644 --- a/src/game/ds.cpp +++ b/src/game/ds.cpp @@ -414,7 +414,7 @@ void SP_script_runner (edict_t *ent) ent->use = script_use; // gi.setmodel (ent, ent->model); -// gi.linkentity (ent); +// gi.linkentity(ent); } #ifdef __cplusplus } //end extern "C" @@ -3502,7 +3502,7 @@ void CScript::HandleTrigger(bool Enable) { trigger_ent->solid = SOLID_TRIGGER; trigger_ent->use = Use_Multi; - gi.linkentity (trigger_ent); + gi.linkentity(trigger_ent); } else { diff --git a/src/game/effects/client_entities.c b/src/game/effects/client_entities.c index 6c82a5c9a..9d2035b70 100644 --- a/src/game/effects/client_entities.c +++ b/src/game/effects/client_entities.c @@ -312,7 +312,7 @@ int AddEffectsToView(client_entity_t **root, centity_t *owner) dl = &fxi.r_dlights[(*fxi.r_numdlights)++]; - VectorCopy (current->r.origin, dl->origin); + VectorCopy(current->r.origin, dl->origin); dl->intensity = ce_dlight->intensity; diff --git a/src/game/effects/netmsg_read.c b/src/game/effects/netmsg_read.c index cef4a0fd7..b99c0c9bb 100644 --- a/src/game/effects/netmsg_read.c +++ b/src/game/effects/netmsg_read.c @@ -185,7 +185,7 @@ void MSG_ReadDirMag(sizebuf_t *sb, vec3_t dir) assert(0); fxi.Com_Error (ERR_DROP, "MSF_ReadDirMag: out of range"); } - VectorCopy (bytedirs[b], dir); + VectorCopy(bytedirs[b], dir); // Scale by magnitude b = fxi.MSG_ReadByte(sb); diff --git a/src/game/g_breakable.c b/src/game/g_breakable.c index 373cb3033..5c7d559bd 100644 --- a/src/game/g_breakable.c +++ b/src/game/g_breakable.c @@ -260,7 +260,7 @@ void SP_breakable_brush (edict_t *ent) ent->use = KillBrushUse; gi.setmodel (ent, ent->model); - gi.linkentity (ent); + gi.linkentity(ent); // Use size to calculate mass VectorSubtract(ent->maxs, ent->mins, space); diff --git a/src/game/g_combat.c b/src/game/g_combat.c index d90326f82..b0e72041f 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -1232,7 +1232,7 @@ void T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t pdir, client->damage_blood += take; client->damage_knockback += knockback; - VectorCopy (point, client->damage_from); + VectorCopy(point, client->damage_from); } } diff --git a/src/game/g_env.c b/src/game/g_env.c index 9f1f003be..dd5baa017 100644 --- a/src/game/g_env.c +++ b/src/game/g_env.c @@ -64,7 +64,7 @@ void SP_env_dust (edict_t *self) self->moveinfo.sound_middle = gi.soundindex ("world/quakeshort.wav"); gi.setmodel (self, self->model); - gi.linkentity (self); + gi.linkentity(self); } #define START_OFF 8 @@ -181,5 +181,5 @@ void SP_env_muck (edict_t *self) self->use = env_dust_use; gi.setmodel (self, self->model); - gi.linkentity (self); + gi.linkentity(self); } diff --git a/src/game/g_field.c b/src/game/g_field.c index c33cafbeb..1e4a4c0e9 100644 --- a/src/game/g_field.c +++ b/src/game/g_field.c @@ -89,7 +89,7 @@ void TrigDamage_Activate(edict_t *self, G_Message_t *msg) { self->solid = SOLID_TRIGGER; self->use = DamageField_Use; - gi.linkentity (self); + gi.linkentity(self); } @@ -140,7 +140,7 @@ void SP_trigger_Damage(edict_t *self) self->use = DamageField_Use; self->movetype = MOVETYPE_NONE; - gi.linkentity (self); + gi.linkentity(self); } void DamageField_Use(edict_t *self, edict_t *other, edict_t *activator) diff --git a/src/game/g_flamethrow.c b/src/game/g_flamethrow.c index bd4e4f887..86d0bf432 100644 --- a/src/game/g_flamethrow.c +++ b/src/game/g_flamethrow.c @@ -31,7 +31,7 @@ void FlameThrower_Activate(edict_t *self, G_Message_t *msg) self->solid = SOLID_TRIGGER; self->use = flamethrower_use; self->touch = flamethrower_touch; - gi.linkentity (self); + gi.linkentity(self); } @@ -164,5 +164,5 @@ void SP_flamethrower(edict_t *self) self->use = flamethrower_use; self->touch = flamethrower_touch; - gi.linkentity (self); + gi.linkentity(self); } diff --git a/src/game/g_func.c b/src/game/g_func.c index 97f397d95..383e138fe 100644 --- a/src/game/g_func.c +++ b/src/game/g_func.c @@ -1078,7 +1078,7 @@ SP_func_plat(edict_t *ent) door_sounds(ent); - gi.linkentity (ent); + gi.linkentity(ent); plat_spawn_inside_trigger(ent); // the "start moving" trigger @@ -3242,7 +3242,7 @@ SP_func_door_rotating(edict_t *ent) st.distance = 90; } - gi.linkentity (ent); + gi.linkentity(ent); VectorCopy(ent->s.angles, ent->pos1); VectorMA(ent->s.angles, st.distance, ent->movedir, ent->pos2); diff --git a/src/game/g_items.c b/src/game/g_items.c index 6968b9db0..375183e0e 100644 --- a/src/game/g_items.c +++ b/src/game/g_items.c @@ -37,8 +37,8 @@ #include "common/h2rand.h" #include "header/g_itemstats.h" -#define HEALTH_IGNORE_MAX 1 -#define HEALTH_TIMED 2 +#define HEALTH_IGNORE_MAX 1 +#define HEALTH_TIMED 2 #define ITEM_COOP_ONLY 1 #define ITEM_NO_DROP 2 @@ -48,7 +48,8 @@ // -------------- // ************************************************************************************************ -void RespawnedThink(edict_t *ent) +void +RespawnedThink(edict_t *ent) { ent->think = NULL; // ent->svflags |= SVF_NOCLIENT; @@ -490,9 +491,10 @@ Pickup_Ammo =============== */ -qboolean Pickup_Ammo (edict_t *ent, edict_t *other) +qboolean +Pickup_Ammo(edict_t *ent, edict_t *other) { - int count; + int count; if (other->flags & FL_CHICKEN) { @@ -500,12 +502,18 @@ qboolean Pickup_Ammo (edict_t *ent, edict_t *other) } if (ent->count) + { count = ent->count; + } else + { count = ent->item->quantity; + } - if (!Add_Ammo (other, ent->item, count)) + if (!Add_Ammo(other, ent->item, count)) + { return false; + } G_CPrintf(other, PRINT_HIGH, ent->item->msg_pickup); @@ -520,32 +528,38 @@ Separate routine so we can distinguish between ammo and mana. =============== */ -qboolean Pickup_Mana (edict_t *ent, edict_t *other) +qboolean +Pickup_Mana(edict_t *ent, edict_t *other) { return(Pickup_Ammo(ent, other)); } -/* -=============== -Drop_Ammo -=============== -*/ - -void Drop_Ammo (edict_t *ent, gitem_t *item) +void +Drop_Ammo(edict_t *ent, gitem_t *item) { - edict_t *dropped; - int index; + edict_t *dropped; + int index; + + if (!ent || !item) + { + return; + } index = playerExport->GetItemIndex(item); - dropped = Drop_Item (ent, item); + dropped = Drop_Item(ent, item); if (ent->client->playerinfo.pers.inventory.Items[index] >= item->quantity) + { dropped->count = item->quantity; + } else + { dropped->count = ent->client->playerinfo.pers.inventory.Items[index]; + } + ent->client->playerinfo.pers.inventory.Items[index] -= dropped->count; - ValidateSelectedItem (ent); + ValidateSelectedItem(ent); } /* @@ -554,7 +568,8 @@ Pickup_Health =============== */ -qboolean Pickup_Health (edict_t *ent, edict_t *other) +qboolean +Pickup_Health(edict_t *ent, edict_t *other) { if (other->flags & FL_CHICKEN) { @@ -604,7 +619,8 @@ Touch_Item =============== */ -void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) +void +Touch_Item(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) { if(strcmp(other->classname,"player")) { @@ -648,7 +664,7 @@ void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf gi.CreateEffect(NULL, FX_PICKUP, 0, ent->s.origin, ""); - G_UseTargets (ent, other); + G_UseTargets(ent, other); // Handle respawn / removal of the item. @@ -684,29 +700,36 @@ void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf } } -/* -================ -drop_temp_touch -================ -*/ +/* ====================================================================== */ static void -drop_temp_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) +drop_temp_touch(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) { + if (!ent || !other) + { + return; + } + if (other == ent->owner) + { return; + } - Touch_Item (ent, other, plane, surf); + /* plane and surf are unused in Touch_Item + but since the function is part of the + game <-> client interface dropping + them is too much pain. */ + Touch_Item(ent, other, plane, surf); } -/* -================ -drop_make_touchable -================ -*/ - -static void drop_make_touchable (edict_t *ent) +void +drop_make_touchable(edict_t *ent) { + if (!ent) + { + return; + } + ent->touch = Touch_Item; if (deathmatch->value) @@ -716,17 +739,17 @@ static void drop_make_touchable (edict_t *ent) } } -/* -================ -Drop_Item -================ -*/ - -edict_t *Drop_Item (edict_t *ent, gitem_t *item) +edict_t * +Drop_Item(edict_t *ent, gitem_t *item) { - edict_t *dropped; - vec3_t forward, right; - vec3_t offset; + edict_t *dropped; + vec3_t forward, right; + vec3_t offset; + + if (!ent || !item) + { + return NULL; + } dropped = G_Spawn(); @@ -735,9 +758,9 @@ edict_t *Drop_Item (edict_t *ent, gitem_t *item) dropped->spawnflags = DROPPED_ITEM; dropped->s.effects = item->world_model_flags; dropped->s.renderfx = RF_GLOW; - VectorSet (dropped->mins, -15, -15, -15); - VectorSet (dropped->maxs, 15, 15, 15); - gi.setmodel (dropped, dropped->item->world_model); + VectorSet(dropped->mins, -15, -15, -15); + VectorSet(dropped->maxs, 15, 15, 15); + gi.setmodel(dropped, dropped->item->world_model); dropped->solid = SOLID_TRIGGER; dropped->movetype = MOVETYPE_NONE; dropped->touch = drop_temp_touch; @@ -745,19 +768,19 @@ edict_t *Drop_Item (edict_t *ent, gitem_t *item) if (ent->client) { - trace_t trace; + trace_t trace; - AngleVectors (ent->client->v_angle, forward, right, NULL); + AngleVectors(ent->client->v_angle, forward, right, NULL); VectorSet(offset, 24, 0, -16); G_ProjectSource (ent->s.origin, offset, forward, right, dropped->s.origin); trace = gi.trace(ent->s.origin, dropped->mins, dropped->maxs, dropped->s.origin, ent, CONTENTS_SOLID); - VectorCopy (trace.endpos, dropped->s.origin); + VectorCopy(trace.endpos, dropped->s.origin); } else { - AngleVectors (ent->s.angles, forward, right, NULL); - VectorCopy (ent->s.origin, dropped->s.origin); + AngleVectors(ent->s.angles, forward, right, NULL); + VectorCopy(ent->s.origin, dropped->s.origin); } VectorScale (forward, 100, dropped->velocity); @@ -766,18 +789,19 @@ edict_t *Drop_Item (edict_t *ent, gitem_t *item) dropped->think = drop_make_touchable; dropped->nextthink = level.time + 1; - gi.linkentity (dropped); + gi.linkentity(dropped); return dropped; } -/* -================ -Use_Item -================ -*/ -void Use_Item (edict_t *ent, edict_t *other, edict_t *activator) +void +Use_Item(edict_t *ent, edict_t *other /* unused */, edict_t *activator /* unused */) { + if (!ent) + { + return; + } + // ent->svflags &= ~SVF_NOCLIENT; ent->use = NULL; @@ -792,7 +816,7 @@ void Use_Item (edict_t *ent, edict_t *other, edict_t *activator) ent->touch = Touch_Item; } - gi.linkentity (ent); + gi.linkentity(ent); } /* ====================================================================== */ @@ -848,6 +872,68 @@ FixObjectPosition(edict_t *ent) } } +void +droptofloor(edict_t *ent) +{ + trace_t tr; + vec3_t dest; + float *v; + + if (!ent) + { + return; + } + + ent->solid = SOLID_TRIGGER; + ent->movetype = MOVETYPE_STATIC; + ent->touch = Touch_Item; + ent->think = NULL; + + if (!(ent->spawnflags & ITEM_NO_DROP)) + { + v = tv(0, 0, -128); + VectorAdd(ent->s.origin, v, dest); + + tr = gi.trace(ent->s.origin, ent->mins, ent->maxs, dest, ent, MASK_SOLID); + + if (tr.startsolid) + { + FixObjectPosition(ent); + + tr = gi.trace(ent->s.origin, ent->mins, ent->maxs, dest, ent, MASK_SOLID); + } + + if (tr.startsolid) + { + if (strcmp(ent->classname, "foodcube") == 0) + { + VectorCopy(ent->s.origin, tr.endpos); + ent->velocity[2] = 0; + } + else + { + gi.dprintf("%s: %s startsolid at %s\n", + __func__, + ent->classname, + vtos(ent->s.origin)); + G_FreeEdict(ent); + return; + } + } + + tr.endpos[2] += 24; + VectorCopy(tr.endpos, ent->s.origin); + } + + gi.linkentity(ent); + + // if we loading a saved game - the objects will already be out there + if (!ent->PersistantCFX) + { + SpawnItemEffect(ent, ent->item); + } +} + // ************************************************************************************************ // ValidItem // --------- @@ -905,12 +991,13 @@ ValidItem(gitem_t *item) // --------------- // ************************************************************************************************ -void SpawnItemEffect(edict_t *ent, gitem_t *item) +void +SpawnItemEffect(edict_t *ent, gitem_t *item) { if(!ValidItem(item)) { - G_FreeEdict (ent); + G_FreeEdict(ent); return; } @@ -944,51 +1031,6 @@ void SpawnItemEffect(edict_t *ent, gitem_t *item) } } - -/* -================ -droptofloor -================ -*/ - -void itemsdroptofloor (edict_t *ent) -{ - trace_t tr; - vec3_t dest; - - ent->movetype = MOVETYPE_STATIC; - ent->solid = SOLID_TRIGGER; - ent->touch = Touch_Item; - ent->think = NULL; - - if (!(ent->spawnflags & ITEM_NO_DROP)) - { - VectorSet(dest, 0.0, 0.0, -128.0); - Vec3AddAssign (ent->s.origin, dest); - - gi.linkentity (ent); - - tr = gi.trace(ent->s.origin, ent->mins, ent->maxs, dest, ent, MASK_SOLID); - if (tr.startsolid) - { - gi.dprintf ("droptofloor: %s startsolid at %s (inhibited)\n", ent->classname, vtos(ent->s.origin)); - G_FreeEdict (ent); - return; - } - - tr.endpos[2] += 24; - VectorCopy(tr.endpos,ent->s.origin); - } - - - gi.linkentity (ent); - - // if we loading a saved game - the objects will already be out there - if (!ent->PersistantCFX) - SpawnItemEffect(ent, ent->item); -} - - /* =============== PrecacheItem @@ -998,7 +1040,8 @@ spawned in a level, and for each item in each client's inventory. =============== */ -void PrecacheItem (gitem_t *it) +void +PrecacheItem(gitem_t *it) { gitem_t *ammo; @@ -1020,6 +1063,7 @@ void PrecacheItem (gitem_t *it) PrecacheItem (ammo); } } + // ************************************************************************************************ // SpawnItem // --------- @@ -1027,7 +1071,8 @@ void PrecacheItem (gitem_t *it) // the floor because they might be on an entity that hasn't spawned yet. // ************************************************************************************************ -void SpawnItem (edict_t *ent, gitem_t *item) +void +SpawnItem(edict_t *ent, gitem_t *item) { if ((ent->spawnflags & ITEM_COOP_ONLY) && (!coop->value)) return; @@ -1036,14 +1081,13 @@ void SpawnItem (edict_t *ent, gitem_t *item) if(!ValidItem(item)) { - G_FreeEdict (ent); + G_FreeEdict(ent); return; } ent->item = item; - ent->nextthink = level.time + (2 * FRAMETIME); // items start after other solids - ent->think = itemsdroptofloor; - + ent->nextthink = level.time + 2 * FRAMETIME; /* items start after other solids */ + ent->think = droptofloor; ent->s.effects = item->world_model_flags; ent->s.renderfx = RF_GLOW; ent->s.effects |= EF_ALWAYS_ADD_EFFECTS; @@ -1090,8 +1134,8 @@ void SpawnItem (edict_t *ent, gitem_t *item) // FIXME: Until all objects have bounding boxes, default to these vals. if (Vec3IsZero(ent->mins)) { - VectorSet (ent->mins, -10.0, -10.0, -10.0); - VectorSet (ent->maxs, 10.0, 10.0, 10.0); + VectorSet(ent->mins, -10.0, -10.0, -10.0); + VectorSet(ent->maxs, 10.0, 10.0, 10.0); } ent->classname = item->classname; diff --git a/src/game/g_light.c b/src/game/g_light.c index d7e6867b7..e78d86032 100644 --- a/src/game/g_light.c +++ b/src/game/g_light.c @@ -56,7 +56,7 @@ void LightInit(edict_t *self) BboxYawAndScale(self); - gi.linkentity (self); + gi.linkentity(self); } void TorchInit (edict_t *self) @@ -64,7 +64,7 @@ void TorchInit (edict_t *self) // no targeted lights in deathmatch, because they cause global messages if (self->targetname && deathmatch->value) { - G_FreeEdict (self); + G_FreeEdict(self); return; } @@ -173,7 +173,7 @@ void SP_light (edict_t *self) // no targeted lights in deathmatch, because they cause global messages if (!self->targetname || deathmatch->value) { - G_FreeEdict (self); + G_FreeEdict(self); return; } diff --git a/src/game/g_misc.c b/src/game/g_misc.c index f5503592f..afebae589 100644 --- a/src/game/g_misc.c +++ b/src/game/g_misc.c @@ -1336,7 +1336,7 @@ void SP_item_spitter(edict_t *self) else self->mass = 0; - gi.linkentity (self); + gi.linkentity(self); } //================================================================================= @@ -1373,9 +1373,9 @@ void respawner_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t } VectorSet(spot->s.origin, self->mins[0]+((self->size[0]) /2), self->mins[1]+((self->size[1]) /2) ,self->mins[2]+self->size[2]); - VectorCopy (self->s.angles, spot->s.angles); + VectorCopy(self->s.angles, spot->s.angles); - G_FreeEdict (self); + G_FreeEdict(self); } /*QUAKED misc_update_spawner (.5 .5 .5) ? @@ -1390,7 +1390,7 @@ void misc_update_spawner (edict_t *ent) ent->touch = respawner_touch; gi.setmodel(ent,ent->model); - gi.linkentity (ent); + gi.linkentity(ent); } @@ -1426,7 +1426,7 @@ void Teleporter_Activate(edict_t *self, G_Message_t *msg) effect->solid = SOLID_NOT; effect->s.effects |= EF_NODRAW_ALWAYS_SEND|EF_ALWAYS_ADD_EFFECTS; self->enemy = effect; - gi.linkentity (effect); + gi.linkentity(effect); real_origin[0] = ((self->maxs[0] - self->mins[0]) / 2.0) + self->mins[0]; real_origin[1] = ((self->maxs[1] - self->mins[1]) / 2.0) + self->mins[1]; @@ -1463,7 +1463,7 @@ void SP_misc_teleporter (edict_t *ent) if (!ent->target && (!(ent->spawnflags&DEATHMATCH_RANDOM) || !deathmatch->value)) { gi.dprintf ("teleporter without a target.\n"); - G_FreeEdict (ent); + G_FreeEdict(ent); return; } @@ -1475,7 +1475,7 @@ void SP_misc_teleporter (edict_t *ent) ent->solid = SOLID_TRIGGER; gi.setmodel(ent, ent->model); - gi.linkentity (ent); + gi.linkentity(ent); // if we don't have mult dests - probably redundant if (!(ent->spawnflags & 8)) @@ -1492,7 +1492,7 @@ void SP_misc_teleporter (edict_t *ent) effect->solid = SOLID_NOT; effect->s.effects |= EF_NODRAW_ALWAYS_SEND|EF_ALWAYS_ADD_EFFECTS; ent->enemy = effect; - gi.linkentity (effect); + gi.linkentity(effect); real_origin[0] = ((ent->maxs[0] - ent->mins[0]) / 2.0) + ent->mins[0]; real_origin[1] = ((ent->maxs[1] - ent->mins[1]) / 2.0) + ent->mins[1]; @@ -1515,9 +1515,9 @@ void SP_misc_teleporter_dest (edict_t *ent) ent->s.skinnum = 0; ent->solid = SOLID_NOT; - VectorSet (ent->mins, -32, -32, -24); - VectorSet (ent->maxs, 32, 32, -16); - gi.linkentity (ent); + VectorSet(ent->mins, -32, -32, -24); + VectorSet(ent->maxs, 32, 32, -16); + gi.linkentity(ent); VectorCopy(ent->s.origin, endpos); endpos[2] -= 500; diff --git a/src/game/g_monster.c b/src/game/g_monster.c index 4cc18fbc4..7d749da5e 100644 --- a/src/game/g_monster.c +++ b/src/game/g_monster.c @@ -175,10 +175,10 @@ void M_CheckGround (edict_t *ent) // ent->groundentity = trace.ent; // ent->groundentity_linkcount = trace.ent->linkcount; // if (!trace.startsolid && !trace.allsolid) -// VectorCopy (trace.endpos, ent->s.origin); +// VectorCopy(trace.endpos, ent->s.origin); if (!trace.startsolid && !trace.allsolid) { - VectorCopy (trace.endpos, ent->s.origin); + VectorCopy(trace.endpos, ent->s.origin); ent->groundentity = trace.ent; ent->groundentity_linkcount = trace.ent->linkcount; ent->velocity[2] = 0; @@ -397,7 +397,7 @@ void M_droptofloor (edict_t *ent) ent->nextthink = level.time + FRAMETIME; ent->s.origin[2] += 1.0; - VectorCopy (ent->s.origin, end); + VectorCopy(ent->s.origin, end); end[2] -= 256; trace = gi.trace(ent->s.origin, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID); @@ -408,7 +408,7 @@ void M_droptofloor (edict_t *ent) if(ent->think == M_droptofloor) { ent->think = NULL;//don't try again - gi.linkentity (ent); + gi.linkentity(ent); M_CatagorizePosition (ent); } return; @@ -423,9 +423,9 @@ void M_droptofloor (edict_t *ent) if(mgai_debug->value) gi.dprintf("%s at %s dropped to floor at %s\n", ent->classname, vtos(ent->s.origin), vtos(trace.endpos)); - VectorCopy (trace.endpos, ent->s.origin); + VectorCopy(trace.endpos, ent->s.origin); - gi.linkentity (ent); + gi.linkentity(ent); M_CheckGround (ent); M_CatagorizePosition (ent); @@ -730,7 +730,7 @@ monster_start(edict_t *self) { if ((deathmatch->value == 1) && !((int)sv_cheats->value & self_spawn)) { - G_FreeEdict (self); + G_FreeEdict(self); return false; } @@ -1668,7 +1668,7 @@ void M_EndDeath( edict_t *self) } self->s.effects |= EF_DISABLE_EXTRA_FX; - gi.linkentity (self); + gi.linkentity(self); } diff --git a/src/game/g_obj.c b/src/game/g_obj.c index e566bd621..b63bd2923 100644 --- a/src/game/g_obj.c +++ b/src/game/g_obj.c @@ -80,7 +80,7 @@ void BboxYawAndScale(edict_t *self) VectorCopy(self->mins,holdmins); VectorCopy(self->maxs,holdmaxs); - AngleVectors (self->s.angles,forward, right,NULL); + AngleVectors(self->s.angles,forward, right,NULL); VectorMA (self->s.origin, holdmins[0],forward, point[0]); VectorMA (point[0], holdmins[1],right, point[0]); @@ -147,7 +147,7 @@ void BboxYawAndScaleAndMoveUp(edict_t *self) VectorCopy(self->mins,holdmins); VectorCopy(self->maxs,holdmaxs); - AngleVectors (self->s.angles,forward, right,NULL); + AngleVectors(self->s.angles,forward, right,NULL); VectorMA (self->s.origin, holdmins[0],forward, point[0]); VectorMA (point[0], holdmins[1],right, point[0]); @@ -199,7 +199,7 @@ void BboxYawAndScaleAndMoveUp(edict_t *self) } -void ObjectInit(edict_t *self,int health,int mass, int materialtype,int solid) +void ObjectInit(edict_t *self,int health,int mass, int materialtype, int solid) { self->movetype = MOVETYPE_NONE; self->solid = (solid_t)solid; @@ -242,7 +242,7 @@ void ObjectInit(edict_t *self,int health,int mass, int materialtype,int solid) } else { - gi.linkentity (self); + gi.linkentity(self); } } @@ -1567,7 +1567,7 @@ void SP_obj_seasonglobe (edict_t *bottom) bottom->use = globebottom_use; bottom->yaw_speed = 2.5; VectorSet(bottom->s.angles, 0, 90, 0); - gi.linkentity (bottom); + gi.linkentity(bottom); top = G_Spawn(); @@ -1588,7 +1588,7 @@ void SP_obj_seasonglobe (edict_t *bottom) top->yaw_speed = 2.5; top->target = bottom->target; VectorSet(top->s.angles, 0, 120, 0); - gi.linkentity (top); + gi.linkentity(top); bottom->enemy = top; top->enemy = bottom; @@ -1867,7 +1867,7 @@ void SP_obj_tree2 (edict_t *self) BboxYawAndScale(moss); - gi.linkentity (moss); + gi.linkentity(moss); self->target_ent = moss; } @@ -1906,7 +1906,7 @@ void SP_obj_tree3 (edict_t *self) moss->s.renderfx |= RF_TRANSLUCENT; BboxYawAndScale(moss); - gi.linkentity (moss); + gi.linkentity(moss); self->target_ent = moss; } @@ -1944,7 +1944,7 @@ void SP_obj_treetall (edict_t *self) moss->s.renderfx |= RF_TRANSLUCENT; moss->s.scale = self->s.scale; BboxYawAndScale(moss); - gi.linkentity (moss); + gi.linkentity(moss); self->target_ent = moss; } @@ -3700,7 +3700,7 @@ void SP_obj_venusflytrap (edict_t *self) leaves->s.modelindex = gi.modelindex("models/objects/plants/v-plant/tris.fm"); BboxYawAndScale(leaves); leaves->s.angles[YAW] = self->s.angles[YAW]; - gi.linkentity (leaves); + gi.linkentity(leaves); self->target_ent = leaves; @@ -3875,7 +3875,7 @@ void SP_obj_spellbook (edict_t *self) beam->s.modelindex = gi.modelindex("models/objects/spellbook/beam/tris.fm"); BboxYawAndScale(beam); beam->s.angles[YAW] = self->s.angles[YAW]; - gi.linkentity (beam); + gi.linkentity(beam); self->target_ent = beam; } @@ -4118,7 +4118,7 @@ void statue_sithraguard_use (edict_t *self, edict_t *other, edict_t *activator) shield->solid = SOLID_NOT; BboxYawAndScale(shield); - gi.linkentity (shield); + gi.linkentity(shield); @@ -4502,7 +4502,7 @@ void SP_obj_biotank (edict_t *self) BboxYawAndScale(fish); fish->s.angles[YAW] = self->s.angles[YAW]; - gi.linkentity (fish); + gi.linkentity(fish); fish->think = fish_anim; fish->nextthink = level.time + FRAMETIME; @@ -4582,7 +4582,7 @@ void SP_obj_hangingdude (edict_t *self) self->s.frame = 0; BboxYawAndScale(self); self->targetname = "guy1"; - gi.linkentity (self); + gi.linkentity(self); ring = G_Spawn(); @@ -4597,7 +4597,7 @@ void SP_obj_hangingdude (edict_t *self) VectorSet(ring->maxs, 3, 20, 55); BboxYawAndScale(ring); - gi.linkentity (ring); + gi.linkentity(ring); } @@ -4794,7 +4794,7 @@ void SP_obj_hanging_ogle (edict_t *self) ring->spawnflags |= OBJ_INVULNERABLE; // can't be destroyed BboxYawAndScale(ring); - gi.linkentity (ring); + gi.linkentity(ring); self->target_ent = ring; diff --git a/src/game/g_phys.c b/src/game/g_phys.c index c9b6e0353..85ac2de3d 100644 --- a/src/game/g_phys.c +++ b/src/game/g_phys.c @@ -251,14 +251,14 @@ static int SV_FlyMove (edict_t *ent, float time, int mask) if (trace.allsolid) { // entity is trapped in another solid - VectorCopy (vec3_origin, ent->velocity); + VectorCopy(vec3_origin, ent->velocity); return 3; } if (trace.fraction > 0) { // actually covered some distance - VectorCopy (trace.endpos, ent->s.origin); - VectorCopy (ent->velocity, original_velocity); + VectorCopy(trace.endpos, ent->s.origin); + VectorCopy(ent->velocity, original_velocity); numplanes = 0; } @@ -294,11 +294,11 @@ static int SV_FlyMove (edict_t *ent, float time, int mask) // cliped to another plane if (numplanes >= MAX_CLIP_PLANES) { // this shouldn't really happen - VectorCopy (vec3_origin, ent->velocity); + VectorCopy(vec3_origin, ent->velocity); return 3; } - VectorCopy (trace.plane.normal, planes[numplanes]); + VectorCopy(trace.plane.normal, planes[numplanes]); numplanes++; // @@ -319,14 +319,14 @@ static int SV_FlyMove (edict_t *ent, float time, int mask) if (i != numplanes) { // go along this plane - VectorCopy (new_velocity, ent->velocity); + VectorCopy(new_velocity, ent->velocity); } else { // go along the crease if (numplanes != 2) { // gi.dprintf ("clip velocity, numplanes == %i\n",numplanes); - VectorCopy (vec3_origin, ent->velocity); + VectorCopy(vec3_origin, ent->velocity); return 7; } CrossProduct (planes[0], planes[1], dir); @@ -340,7 +340,7 @@ static int SV_FlyMove (edict_t *ent, float time, int mask) // if (DotProduct (ent->velocity, primal_velocity) <= 0) { - VectorCopy (vec3_origin, ent->velocity); + VectorCopy(vec3_origin, ent->velocity); return blocked; } } @@ -382,7 +382,7 @@ trace_t SV_PushEntity (edict_t *ent, vec3_t push) vec3_t end; int mask; - VectorCopy (ent->s.origin, start); + VectorCopy(ent->s.origin, start); VectorAdd (start, push, end); retry: @@ -393,7 +393,7 @@ trace_t SV_PushEntity (edict_t *ent, vec3_t push) trace = gi.trace(start, ent->mins, ent->maxs, end, ent, mask); - VectorCopy (trace.endpos, ent->s.origin); + VectorCopy(trace.endpos, ent->s.origin); if (ent->movetype == MOVETYPE_FLYMISSILE) { @@ -401,7 +401,7 @@ trace_t SV_PushEntity (edict_t *ent, vec3_t push) } else { - gi.linkentity (ent); + gi.linkentity(ent); } if (trace.fraction != 1.0) @@ -412,8 +412,8 @@ trace_t SV_PushEntity (edict_t *ent, vec3_t push) if (!trace.ent->inuse && ent->inuse) { // move the pusher back and try again - VectorCopy (start, ent->s.origin); - gi.linkentity (ent); + VectorCopy(start, ent->s.origin); + gi.linkentity(ent); goto retry; } } @@ -463,12 +463,12 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove) // we need this for pushing things later VectorSubtract (vec3_origin, amove, org); - AngleVectors (org, forward, right, up); + AngleVectors(org, forward, right, up); // save the pusher's original position pushed_p->ent = pusher; - VectorCopy (pusher->s.origin, pushed_p->origin); - VectorCopy (pusher->s.angles, pushed_p->angles); + VectorCopy(pusher->s.origin, pushed_p->origin); + VectorCopy(pusher->s.angles, pushed_p->angles); if (pusher->client) pushed_p->deltayaw = pusher->client->ps.pmove.delta_angles[YAW]; pushed_p++; @@ -476,7 +476,7 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove) // move the pusher to it's final position VectorAdd (pusher->s.origin, move, pusher->s.origin); VectorAdd (pusher->s.angles, amove, pusher->s.angles); - gi.linkentity (pusher); + gi.linkentity(pusher); // see if any solid entities are inside the final position check = g_edicts+1; @@ -511,8 +511,8 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove) { // move this entity pushed_p->ent = check; - VectorCopy (check->s.origin, pushed_p->origin); - VectorCopy (check->s.angles, pushed_p->angles); + VectorCopy(check->s.origin, pushed_p->origin); + VectorCopy(check->s.angles, pushed_p->angles); pushed_p++; // try moving the contacted entity @@ -537,7 +537,7 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove) block = SV_TestEntityPosition (check); if (!block) { // pushed ok - gi.linkentity (check); + gi.linkentity(check); // impact? continue; } @@ -562,13 +562,13 @@ qboolean SV_Push (edict_t *pusher, vec3_t move, vec3_t amove) // twice, it goes back to the original position for (p=pushed_p-1 ; p>=pushed ; p--) { - VectorCopy (p->origin, p->ent->s.origin); - VectorCopy (p->angles, p->ent->s.angles); + VectorCopy(p->origin, p->ent->s.origin); + VectorCopy(p->angles, p->ent->s.angles); if (p->ent->client) { p->ent->client->ps.pmove.delta_angles[YAW] = p->deltayaw; } - gi.linkentity (p->ent); + gi.linkentity(p->ent); } return false; } @@ -681,7 +681,7 @@ void SV_Physics_Noclip (edict_t *ent) VectorMA (ent->s.angles, FRAMETIME, ent->avelocity, ent->s.angles); VectorMA (ent->s.origin, FRAMETIME, ent->velocity, ent->s.origin); - gi.linkentity (ent); + gi.linkentity(ent); } /* @@ -1105,7 +1105,7 @@ SV_Physics_Step(edict_t *ent) */ - gi.linkentity (ent); + gi.linkentity(ent); G_TouchTriggers (ent); /* if (ent->groundentity) @@ -1132,7 +1132,7 @@ void SV_Physics_Script_Angular(edict_t *ent) VectorMA(ent->moveinfo.start_origin, ent->moveinfo.distance, Forward, ent->s.origin); - gi.linkentity (ent); + gi.linkentity(ent); } SV_RunThink (ent); diff --git a/src/game/g_physics.c b/src/game/g_physics.c index 1f52d44d3..f3d839406 100644 --- a/src/game/g_physics.c +++ b/src/game/g_physics.c @@ -1060,7 +1060,7 @@ void MoveEntity_Slide(edict_t *self) if (i != numplanes) { // good slide - VectorCopy (new_velocity, self->velocity); + VectorCopy(new_velocity, self->velocity); // gi.dprintf("Acceptable slide for bump %i\n", bumpcount); @@ -2266,7 +2266,7 @@ qboolean PushEntities(edict_t *pusher, vec3_t move, vec3_t amove) if(!block) { // pushed ok - gi.linkentity (check); + gi.linkentity(check); if(check->client) { diff --git a/src/game/g_shrine.c b/src/game/g_shrine.c index a1198f57f..7097ef471 100644 --- a/src/game/g_shrine.c +++ b/src/game/g_shrine.c @@ -435,7 +435,7 @@ void deal_with_shrine_node(edict_t *self) delay->nextthink = level.time + time; delay->oldtouch = self->touch; - gi.linkentity (delay); + gi.linkentity(delay); } // Turn off the touch for this shrine. @@ -715,7 +715,7 @@ void shrine_armor (edict_t *ent) } gi.setmodel(ent, ent->model); - gi.linkentity (ent); + gi.linkentity(ent); } // ************************************************************************************************ @@ -824,7 +824,7 @@ void shrine_armor_gold (edict_t *ent) } gi.setmodel(ent, ent->model); - gi.linkentity (ent); + gi.linkentity(ent); } // ************************************************************************************************ @@ -940,7 +940,7 @@ void shrine_staff (edict_t *ent) } gi.setmodel(ent, ent->model); - gi.linkentity (ent); + gi.linkentity(ent); } // ************************************************************************************************ @@ -1041,7 +1041,7 @@ void shrine_lung (edict_t *ent) } gi.setmodel(ent, ent->model); - gi.linkentity (ent); + gi.linkentity(ent); } // ************************************************************************************************ @@ -1158,7 +1158,7 @@ void shrine_light (edict_t *ent) } gi.setmodel(ent, ent->model); - gi.linkentity (ent); + gi.linkentity(ent); } // ************************************************************************************************ @@ -1261,7 +1261,7 @@ void shrine_mana (edict_t *ent) } gi.setmodel(ent, ent->model); - gi.linkentity (ent); + gi.linkentity(ent); } // ************************************************************************************************ @@ -1371,7 +1371,7 @@ void shrine_ghost (edict_t *ent) } gi.setmodel(ent, ent->model); - gi.linkentity (ent); + gi.linkentity(ent); } // ************************************************************************************************ @@ -1484,7 +1484,7 @@ void shrine_reflect (edict_t *ent) } gi.setmodel(ent, ent->model); - gi.linkentity (ent); + gi.linkentity(ent); } // ************************************************************************************************ @@ -1600,7 +1600,7 @@ void shrine_powerup (edict_t *ent) } gi.setmodel(ent, ent->model); - gi.linkentity (ent); + gi.linkentity(ent); } // ************************************************************************************************ @@ -1717,7 +1717,7 @@ void shrine_speed (edict_t *ent) } gi.setmodel(ent, ent->model); - gi.linkentity (ent); + gi.linkentity(ent); } // ************************************************************************************************ @@ -1940,5 +1940,5 @@ void shrine_random(edict_t *ent) ent->touch = shrine_random_touch; gi.setmodel(ent, ent->model); - gi.linkentity (ent); + gi.linkentity(ent); } diff --git a/src/game/g_spawn.c b/src/game/g_spawn.c index 85b506b06..7113fa537 100644 --- a/src/game/g_spawn.c +++ b/src/game/g_spawn.c @@ -878,7 +878,7 @@ SpawnEntities(const char *mapname, char *entities, const char *spawnpoint) ((skill->value >= 2) && (ent->spawnflags & SPAWNFLAG_NOT_HARD)) ) { - G_FreeEdict (ent); + G_FreeEdict(ent); inhibit++; continue; } diff --git a/src/game/g_trigger.c b/src/game/g_trigger.c index 2853c051a..8de18775b 100644 --- a/src/game/g_trigger.c +++ b/src/game/g_trigger.c @@ -193,7 +193,7 @@ void Trigger_Activate(edict_t *self, G_Message_t *msg) { self->solid = SOLID_TRIGGER; self->use = Use_Multi; - gi.linkentity (self); + gi.linkentity(self); } void Trigger_Sounds(edict_t *self) @@ -240,7 +240,7 @@ void trigger_enable(edict_t *self, edict_t *other, edict_t *activator) { self->solid = SOLID_TRIGGER; self->use = Use_Multi; - gi.linkentity (self); + gi.linkentity(self); } void Use_Multi(edict_t *self, edict_t *other, edict_t *activator) @@ -540,7 +540,7 @@ void SP_trigger_PlayerUsePuzzle(edict_t *self) self->TriggerActivated = trigger_playerusepuzzle; gi.setmodel (self, self->model); - gi.linkentity (self); + gi.linkentity(self); } //---------------------------------------------------------------------- @@ -569,7 +569,7 @@ void SP_trigger_PlayerPushButton(edict_t *self) self->solid = SOLID_TRIGGER; gi.setmodel (self, self->model); - gi.linkentity (self); + gi.linkentity(self); } @@ -1190,7 +1190,7 @@ trigger_push_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *s if(self->spawnflags & FIELD_FORCE_ONCE) { - G_FreeEdict (self); + G_FreeEdict(self); } } diff --git a/src/game/mg_ai.c b/src/game/mg_ai.c index 50dd0bf6f..75d9f677e 100644 --- a/src/game/mg_ai.c +++ b/src/game/mg_ai.c @@ -92,7 +92,7 @@ qboolean ahead (edict_t *self, edict_t *other) else VectorCopy(self->s.angles,check_angles); - AngleVectors (check_angles, forward, NULL, NULL); + AngleVectors(check_angles, forward, NULL, NULL); VectorSubtract (other->s.origin, self->s.origin, vec); VectorNormalize (vec); dot = DotProduct (vec, forward); @@ -132,7 +132,7 @@ qboolean visible_pos (edict_t *self, vec3_t spot2) vec3_t spot1; trace_t trace; - VectorCopy (self->s.origin, spot1); + VectorCopy(self->s.origin, spot1); spot1[2] += self->viewheight; trace = gi.trace(spot1, vec3_origin, vec3_origin, spot2, self, MASK_OPAQUE); @@ -170,8 +170,8 @@ qboolean MG_CheckBottom (edict_t *ent) } else//lenient, max 16 corner checking { - VectorCopy (ent->mins, mins); - VectorCopy (ent->maxs, maxs); + VectorCopy(ent->mins, mins); + VectorCopy(ent->maxs, maxs); //some leniency is ok here, no? mins[0] *= 0.75; @@ -326,7 +326,7 @@ trace_t MG_MoveStep (edict_t *self, vec3_t move, qboolean relink) trace.succeeded = false; // try the move - VectorCopy (self->s.origin, save_org); + VectorCopy(self->s.origin, save_org); if(self->monsterinfo.scale) {//scale movement by monster's scale //scale here, not before since any function can call this @@ -408,10 +408,10 @@ trace_t MG_MoveStep (edict_t *self, vec3_t move, qboolean relink) if (trace.fraction == 1) { - VectorCopy (trace.endpos, self->s.origin); + VectorCopy(trace.endpos, self->s.origin); if (relink) { - gi.linkentity (self); + gi.linkentity(self); G_TouchTriggers (self); } return trace;//true @@ -440,7 +440,7 @@ trace_t MG_MoveStep (edict_t *self, vec3_t move, qboolean relink) stepsize = 1; test_org[2] += stepsize; - VectorCopy (test_org, end); + VectorCopy(test_org, end); end[2] -= stepsize*2; trace = gi.trace(test_org, self->mins, self->maxs, end, self, clipmask); @@ -497,7 +497,7 @@ trace_t MG_MoveStep (edict_t *self, vec3_t move, qboolean relink) VectorAdd (self->s.origin, move, self->s.origin); if (relink) { - gi.linkentity (self); + gi.linkentity(self); G_TouchTriggers (self); } self->groundentity = NULL; @@ -512,7 +512,7 @@ trace_t MG_MoveStep (edict_t *self, vec3_t move, qboolean relink) // check point traces down for dangling corners //DO THE MOVE! //ok, put me there - VectorCopy (trace.endpos, self->s.origin); + VectorCopy(trace.endpos, self->s.origin); if(contents&MASK_WATER && self->flags & FL_AMPHIBIAN); else if (!MG_CheckBottom(self))// && self->classID!=CID_TBEAST) @@ -522,14 +522,14 @@ trace_t MG_MoveStep (edict_t *self, vec3_t move, qboolean relink) // and is trying to correct or can float if (relink) { - gi.linkentity (self); + gi.linkentity(self); G_TouchTriggers (self); } trace.succeeded = true; return trace;//true! } //whoops, let's not make that move after all - VectorCopy (save_org, self->s.origin); + VectorCopy(save_org, self->s.origin); G_QPostMessage(self, MSG_BLOCKED, PRI_DIRECTIVE, NULL); return trace; } @@ -545,11 +545,11 @@ trace_t MG_MoveStep (edict_t *self, vec3_t move, qboolean relink) // the move is ok if (relink) { - gi.linkentity (self); + gi.linkentity(self); G_TouchTriggers (self); } else - VectorCopy (save_org, self->s.origin); + VectorCopy(save_org, self->s.origin); trace.succeeded = true; return trace;//true! @@ -832,7 +832,7 @@ qboolean infront_pos (edict_t *self, vec3_t pos) else VectorCopy(self->s.angles,check_angles); - AngleVectors (check_angles, forward, NULL, NULL); + AngleVectors(check_angles, forward, NULL, NULL); VectorSubtract (pos, self->s.origin, vec); VectorNormalize (vec); dot = DotProduct (vec, forward); @@ -1988,7 +1988,7 @@ void MG_PostDeathThink (edict_t *self) else self->next_post_think = level.time + flrand(10, 20); - gi.linkentity (self); + gi.linkentity(self); } void MG_CheckLanded (edict_t *self, float next_anim) diff --git a/src/game/mg_guide.c b/src/game/mg_guide.c index b3277ca34..3db874744 100644 --- a/src/game/mg_guide.c +++ b/src/game/mg_guide.c @@ -138,7 +138,7 @@ qboolean clear_visible_pos (edict_t *self, vec3_t spot2) if (!self) return false; - VectorCopy (self->s.origin, spot1); + VectorCopy(self->s.origin, spot1); spot1[2] += self->viewheight; if(self->classID == CID_TBEAST) { diff --git a/src/game/monster/actor/actor.c b/src/game/monster/actor/actor.c index 579bd0311..6823ce884 100644 --- a/src/game/monster/actor/actor.c +++ b/src/game/monster/actor/actor.c @@ -314,7 +314,7 @@ void actorMachineGun (edict_t *self) vec3_t start, target; vec3_t forward, right; - AngleVectors (self->s.angles, forward, right, NULL); + AngleVectors(self->s.angles, forward, right, NULL); G_ProjectSource (self->s.origin, monster_flash_offset[MZ2_ACTOR_MACHINEGUN_1], forward, right, start); if (self->enemy) { @@ -325,7 +325,7 @@ void actorMachineGun (edict_t *self) } else { - VectorCopy (self->enemy->absmin, target); + VectorCopy(self->enemy->absmin, target); target[2] += (self->enemy->size[2] / 2); } VectorSubtract (target, start, forward); @@ -333,7 +333,7 @@ void actorMachineGun (edict_t *self) } else { - AngleVectors (self->s.angles, forward, NULL, NULL); + AngleVectors(self->s.angles, forward, NULL, NULL); } monster_fire_bullet (self, start, forward, 3, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MZ2_ACTOR_MACHINEGUN_1); } @@ -341,12 +341,12 @@ void actorMachineGun (edict_t *self) void actor_dead (edict_t *self) { - VectorSet (self->mins, -16, -16, -24); - VectorSet (self->maxs, 16, 16, -8); + VectorSet(self->mins, -16, -16, -24); + VectorSet(self->maxs, 16, 16, -8); self->movetype = MOVETYPE_TOSS; self->svflags |= SVF_DEADMONSTER; self->nextthink = 0; - gi.linkentity (self); + gi.linkentity(self); } static mframe_t actor_frames_death1 [] = @@ -485,29 +485,29 @@ void SP_misc_actor (edict_t *self) { if (deathmatch->value) { - G_FreeEdict (self); + G_FreeEdict(self); return; } if (!self->targetname) { gi.dprintf("untargeted %s at %s\n", self->classname, vtos(self->s.origin)); - G_FreeEdict (self); + G_FreeEdict(self); return; } if (!self->target) { gi.dprintf("%s with no target at %s\n", self->classname, vtos(self->s.origin)); - G_FreeEdict (self); + G_FreeEdict(self); return; } self->movetype = MOVETYPE_STEP; self->solid = SOLID_BBOX; self->s.modelindex = gi.modelindex("players/male/tris.md2"); - VectorSet (self->mins, -16, -16, -24); - VectorSet (self->maxs, 16, 16, 32); + VectorSet(self->mins, -16, -16, -24); + VectorSet(self->maxs, 16, 16, 32); if (!self->health) self->health = 100; @@ -525,7 +525,7 @@ void SP_misc_actor (edict_t *self) self->monsterinfo.aiflags |= AI_GOOD_GUY; - gi.linkentity (self); + gi.linkentity(self); self->monsterinfo.currentmove = &actor_move_stand; self->monsterinfo.scale = MODEL_SCALE; @@ -651,8 +651,8 @@ void SP_target_actor (edict_t *self) self->solid = SOLID_TRIGGER; self->touch = target_actor_touch; - VectorSet (self->mins, -8, -8, -8); - VectorSet (self->maxs, 8, 8, 8); + VectorSet(self->mins, -8, -8, -8); + VectorSet(self->maxs, 8, 8, 8); self->svflags = SVF_NOCLIENT; if (self->spawnflags & 1) @@ -667,5 +667,5 @@ void SP_target_actor (edict_t *self) self->movedir[2] = st.height; } - gi.linkentity (self); + gi.linkentity(self); } diff --git a/src/game/monster/assassin/assassin.c b/src/game/monster/assassin/assassin.c index 7a7353620..cf4a741b4 100644 --- a/src/game/monster/assassin/assassin.c +++ b/src/game/monster/assassin/assassin.c @@ -380,12 +380,12 @@ void assassinThrowDagger(edict_t *self, float right_ofs) 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); + 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); + VectorCopy(self->movedir, Arrow->movedir); VectoAngles (Forward, Arrow->s.angles); extrapolateFiredir (self, Arrow->s.origin, ASSASSIN_DAGGER_SPEED, self->enemy, 0.3, check_lead); @@ -2089,13 +2089,13 @@ void assassinStop (edict_t *self) void assassinSetCrouched (edict_t *self) { - VectorSet (self->maxs, 16, 16, 0); + VectorSet(self->maxs, 16, 16, 0); self->viewheight = 0; } void assassinUndoCrouched (edict_t *self) { - VectorSet (self->maxs, 16, 16, 48); + VectorSet(self->maxs, 16, 16, 48); self->viewheight = 40; } diff --git a/src/game/monster/beast/beast.c b/src/game/monster/beast/beast.c index 963833abf..aa59d2f7f 100644 --- a/src/game/monster/beast/beast.c +++ b/src/game/monster/beast/beast.c @@ -965,7 +965,7 @@ void tbeastbite (edict_t *self, float ofsf, float ofsr, float ofsu) { gi.sound(self, CHAN_WEAPON, sounds[SND_CHOMP], 1, ATTN_NORM, 0); - VectorCopy (self->enemy->s.origin, temp); + VectorCopy(self->enemy->s.origin, temp); temp[2] += 5; VectorSubtract(self->enemy->s.origin, self->s.origin, v); @@ -987,7 +987,7 @@ void tbeast_dead(edict_t *self) self->think = NULL; self->nextthink = 0; level.fighting_beast = false; - gi.linkentity (self); + gi.linkentity(self); } void tbeast_land(edict_t *self) diff --git a/src/game/monster/boss3/boss32.c b/src/game/monster/boss3/boss32.c index e62026fa6..2f56d279d 100644 --- a/src/game/monster/boss3/boss32.c +++ b/src/game/monster/boss3/boss32.c @@ -871,7 +871,7 @@ makron_torso_origin(edict_t *self, edict_t *torso) tr = gi.trace(self->s.origin, torso->mins, torso->maxs, v, self, MASK_SOLID); - VectorCopy (tr.endpos, torso->s.origin); + VectorCopy(tr.endpos, torso->s.origin); } void @@ -1007,7 +1007,7 @@ makron_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* /* lower bbox since the torso is gone */ self->maxs[2] = 64; - gi.linkentity (self); + gi.linkentity(self); self->monsterinfo.currentmove = &makron_move_death2; } diff --git a/src/game/monster/dog/dog.c b/src/game/monster/dog/dog.c index 5e9e559a7..05e8c146d 100644 --- a/src/game/monster/dog/dog.c +++ b/src/game/monster/dog/dog.c @@ -122,7 +122,7 @@ dog_leap_step(edict_t *self) { vec3_t forward; - AngleVectors (self->s.angles, forward, NULL, NULL); + AngleVectors(self->s.angles, forward, NULL, NULL); self->s.origin[2] += 1; VectorScale(forward, 300, self->velocity); self->velocity[2] = 200; diff --git a/src/game/monster/enforcer/enforcer.c b/src/game/monster/enforcer/enforcer.c index 1063048bf..882ac11b2 100644 --- a/src/game/monster/enforcer/enforcer.c +++ b/src/game/monster/enforcer/enforcer.c @@ -130,7 +130,7 @@ enfbolt_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf) if (surf && (surf->flags & SURF_SKY)) { - G_FreeEdict (self); + G_FreeEdict(self); return; } diff --git a/src/game/monster/fish/fish.c b/src/game/monster/fish/fish.c index 31fd92121..b96b1efaf 100644 --- a/src/game/monster/fish/fish.c +++ b/src/game/monster/fish/fish.c @@ -806,7 +806,7 @@ void fish_dead(edict_t *self) self->PersistantCFX = 0; } - gi.linkentity (self); + gi.linkentity(self); } // he bit the player - decide what to do @@ -1100,7 +1100,7 @@ void SP_monster_fish (edict_t *self) if ((deathmatch->value == 1) && !((int)sv_cheats->value & self_spawn)) { - G_FreeEdict (self); + G_FreeEdict(self); return; } @@ -1140,8 +1140,8 @@ void SP_monster_fish (edict_t *self) self->monsterinfo.aiflags |= AI_NO_ALERT;//pay no attention to alert ents - VectorCopy (self->s.origin, self->s.old_origin); - VectorCopy (self->s.angles, self->movedir); + VectorCopy(self->s.origin, self->s.old_origin); + VectorCopy(self->s.angles, self->movedir); if (!self->mass) self->mass = FISH_MASS; diff --git a/src/game/monster/gorgon/gorgon.c b/src/game/monster/gorgon/gorgon.c index 52a24a53d..03d64ff5a 100644 --- a/src/game/monster/gorgon/gorgon.c +++ b/src/game/monster/gorgon/gorgon.c @@ -965,7 +965,7 @@ void gorgonbite (edict_t *self) else gi.sound(self, CHAN_WEAPON, sounds[SND_MELEEHIT2], 1, ATTN_NORM, 0); - VectorCopy (self->enemy->s.origin, temp); + VectorCopy(self->enemy->s.origin, temp); temp[2] += 5; VectorSubtract(self->enemy->s.origin, self->s.origin, v); @@ -1021,29 +1021,29 @@ void gorgon_hop (edict_t *self) { if (self->monsterinfo.currentmove == &gorgon_move_melee6) // hop left { - VectorCopy (self->s.angles, temp); + VectorCopy(self->s.angles, temp); temp[YAW] -= 15; - AngleVectors (temp, NULL, right, NULL); + AngleVectors(temp, NULL, right, NULL); VectorScale (right, -40*JUMP_SCALE, self->velocity); } else if (self->monsterinfo.currentmove == &gorgon_move_melee7) // hop right { - VectorCopy (self->s.angles, temp); + VectorCopy(self->s.angles, temp); temp[YAW] += 15; - AngleVectors (temp, NULL, right, NULL); + AngleVectors(temp, NULL, right, NULL); VectorScale (right, 40*JUMP_SCALE, self->velocity); } else if (self->monsterinfo.currentmove == &gorgon_move_melee8) // hop forward { - VectorCopy (self->s.angles, temp); - AngleVectors (temp, forward, NULL, NULL); + VectorCopy(self->s.angles, temp); + AngleVectors(temp, forward, NULL, NULL); VectorScale (forward, 50*JUMP_SCALE, self->velocity); } else if (self->monsterinfo.currentmove == &gorgon_move_melee9) // hop backward { - VectorCopy (self->s.angles, temp); - AngleVectors (temp, forward, NULL, NULL); + VectorCopy(self->s.angles, temp); + AngleVectors(temp, forward, NULL, NULL); VectorScale (forward, -50*JUMP_SCALE, self->velocity); } @@ -1221,7 +1221,7 @@ qboolean gorgon_check_jump (edict_t *self) // Calculate velocity to make monster jump to hit arc spot // choose landing spot behind enemy - AngleVectors (angles, forward, right, up); + AngleVectors(angles, forward, right, up); VectorMA (landing_spot, 60, forward, landing_spot); @@ -1256,12 +1256,12 @@ qboolean gorgon_check_jump (edict_t *self) landing_spot_angles[ROLL] = 0; landing_spot_angles[YAW] = vectoyaw(v); - AngleVectors (landing_spot_angles, forward, right, up); + AngleVectors(landing_spot_angles, forward, right, up); VectorMA (landing_spot, 20, forward, arc_spot); VectorMA (landing_spot, 180, up, arc_spot); - AngleVectors (self->s.angles, forward, right, up); + AngleVectors(self->s.angles, forward, right, up); // Calculate velocity to make monster jump to hit arc spot VectorSubtract (arc_spot,self->s.origin, v); // Face monster to arc spot @@ -1272,7 +1272,7 @@ qboolean gorgon_check_jump (edict_t *self) hold = len / 200; - AngleVectors (angles, forward, right, up); + AngleVectors(angles, forward, right, up); VectorScale (forward, 300 * hold, self->movedir); self->movedir[2] = 200 * hold; @@ -1324,7 +1324,7 @@ void gorgon_jump (edict_t *self) // Calculate velocity to make monster jump to hit arc spot // choose landing spot behind enemy - AngleVectors (angles, forward, right, up); + AngleVectors(angles, forward, right, up); VectorMA (landing_spot, 60, forward, landing_spot); @@ -1359,12 +1359,12 @@ void gorgon_jump (edict_t *self) landing_spot_angles[ROLL] = 0; landing_spot_angles[YAW] = vectoyaw(v); - AngleVectors (landing_spot_angles, forward, right, up); + AngleVectors(landing_spot_angles, forward, right, up); VectorMA (landing_spot, 20, forward, arc_spot); VectorMA (landing_spot, 180, up, arc_spot); - AngleVectors (self->s.angles, forward, right, up); + AngleVectors(self->s.angles, forward, right, up); // Calculate velocity to make monster jump to hit arc spot VectorSubtract (arc_spot,self->s.origin, v); // Face monster to arc spot @@ -1375,7 +1375,7 @@ void gorgon_jump (edict_t *self) hold = len / 200; - AngleVectors (angles, forward, right, up); + AngleVectors(angles, forward, right, up); VectorScale (forward, 300 * hold, self->velocity); self->velocity[2] = 200 * hold; diff --git a/src/game/monster/gorgon/gorgon_anim.c b/src/game/monster/gorgon/gorgon_anim.c index 7f7430115..6424b434e 100644 --- a/src/game/monster/gorgon/gorgon_anim.c +++ b/src/game/monster/gorgon/gorgon_anim.c @@ -664,7 +664,7 @@ void gorgon_death2throw (edict_t *self) { vec3_t forward; - AngleVectors (self->s.angles, forward, NULL, NULL); + AngleVectors(self->s.angles, forward, NULL, NULL); VectorScale (forward, -375, self->velocity); self->velocity[2] = 200; diff --git a/src/game/monster/harpy/harpy.c b/src/game/monster/harpy/harpy.c index 6725ee095..2e14886d2 100644 --- a/src/game/monster/harpy/harpy.c +++ b/src/game/monster/harpy/harpy.c @@ -709,7 +709,7 @@ void harpy_dead_pain(edict_t *self, G_Message_t *msg) BecomeDebris(self); self->think = NULL; self->nextthink = 0; - gi.linkentity (self); + gi.linkentity(self); return; } else if(msg) @@ -738,7 +738,7 @@ void harpy_die(edict_t *self, G_Message_t *msg) gi.sound(self, CHAN_BODY, sounds[SND_GIB], 1, ATTN_NORM, 0); BecomeDebris(self); - gi.linkentity (self); + gi.linkentity(self); return; } diff --git a/src/game/monster/hknight/hknight.c b/src/game/monster/hknight/hknight.c index e7e18fc17..b4e1b4116 100644 --- a/src/game/monster/hknight/hknight.c +++ b/src/game/monster/hknight/hknight.c @@ -154,7 +154,7 @@ magic_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf) if (surf && (surf->flags & SURF_SKY)) { - G_FreeEdict (self); + G_FreeEdict(self); return; } if (other->takedamage) diff --git a/src/game/monster/imp/imp.c b/src/game/monster/imp/imp.c index ce4682e2f..af36510ed 100644 --- a/src/game/monster/imp/imp.c +++ b/src/game/monster/imp/imp.c @@ -424,7 +424,7 @@ void imp_die(edict_t *self, G_Message_t *msg) BecomeDebris(self); self->think = NULL; self->nextthink = 0; - gi.linkentity (self); + gi.linkentity(self); return; } diff --git a/src/game/monster/misc/fmtest.c b/src/game/monster/misc/fmtest.c index 1201d881d..140b0f933 100644 --- a/src/game/monster/misc/fmtest.c +++ b/src/game/monster/misc/fmtest.c @@ -11,11 +11,11 @@ MakeSolidObject(edict_t *ent, char *Model, float MinX, float MinY, float MinZ, { ent->movetype = MOVETYPE_NONE; ent->solid = SOLID_BBOX; - VectorSet (ent->mins, MinX, MinY, MinZ); - VectorSet (ent->maxs, MaxX, MaxY, MaxZ); + VectorSet(ent->mins, MinX, MinY, MinZ); + VectorSet(ent->maxs, MaxX, MaxY, MaxZ); gi.setmodel(ent, Model); - gi.linkentity (ent); + gi.linkentity(ent); } static void diff --git a/src/game/monster/misc/move.c b/src/game/monster/misc/move.c index d099e5cf4..0c884e9c5 100644 --- a/src/game/monster/misc/move.c +++ b/src/game/monster/misc/move.c @@ -366,7 +366,7 @@ SV_movestep(edict_t *ent, vec3_t move, qboolean relink) } neworg[2] += stepsize; - VectorCopy (neworg, end); + VectorCopy(neworg, end); end[2] -= stepsize * 2; trace = gi.trace(neworg, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID); diff --git a/src/game/monster/mother/mother.c b/src/game/monster/mother/mother.c index 8bdf38bec..8c15805f4 100644 --- a/src/game/monster/mother/mother.c +++ b/src/game/monster/mother/mother.c @@ -148,8 +148,8 @@ void SP_monster_tcheckrik_mothers (edict_t *self) self->solid=SOLID_BBOX; - VectorSet (self->mins, -40, -40, -75); - VectorSet (self->maxs, 40, 40, 75); + VectorSet(self->mins, -40, -40, -75); + VectorSet(self->maxs, 40, 40, 75); self->viewheight = self->maxs[2]*0.8; self->s.modelindex = classStatics[CID_MOTHER].resInfo->modelIndex; diff --git a/src/game/monster/ogle/ogle.c b/src/game/monster/ogle/ogle.c index f50edb7bf..3a9a65a87 100644 --- a/src/game/monster/ogle/ogle.c +++ b/src/game/monster/ogle/ogle.c @@ -1695,7 +1695,7 @@ void SP_monster_ogle(edict_t *self) if ((deathmatch->value == 1) && !((int)sv_cheats->value & self_spawn)) { - G_FreeEdict (self); + G_FreeEdict(self); return; } diff --git a/src/game/monster/plaguessithra/plaguessithra.c b/src/game/monster/plaguessithra/plaguessithra.c index 6db6555c1..d8b0c5704 100644 --- a/src/game/monster/plaguessithra/plaguessithra.c +++ b/src/game/monster/plaguessithra/plaguessithra.c @@ -1224,9 +1224,9 @@ void ssithraSplit (edict_t *self, int BodyPart) tophalf->monsterinfo.nextframeindex = -1; tophalf->friction = 0.1; - VectorCopy (self->s.origin, tophalf->s.origin); - VectorCopy (tophalf->s.origin, tophalf->s.old_origin); - VectorCopy (self->s.angles, tophalf->s.angles); + VectorCopy(self->s.origin, tophalf->s.origin); + VectorCopy(tophalf->s.origin, tophalf->s.old_origin); + VectorCopy(self->s.angles, tophalf->s.angles); if(!self->s.frame)//?!?! tophalf->s.frame = FRAME_startle32; @@ -1850,7 +1850,7 @@ void ssithraWaterDead(edict_t *self) self->think = fish_deadfloat; self->nextthink = level.time + 0.1; - gi.linkentity (self); + gi.linkentity(self); } void ssithraCollapse (edict_t *self) diff --git a/src/game/monster/priestess/priestess.c b/src/game/monster/priestess/priestess.c index f5b9306be..825c2f867 100644 --- a/src/game/monster/priestess/priestess.c +++ b/src/game/monster/priestess/priestess.c @@ -1446,7 +1446,7 @@ void priestess_dead( edict_t *self ) } gi.RemoveEffects(&self->s, 0); - gi.linkentity (self); + gi.linkentity(self); self->think = G_FreeEdict; self->nextthink = level.time + 0.1; diff --git a/src/game/monster/shalrath/shalrath.c b/src/game/monster/shalrath/shalrath.c index 8de7f131e..2f78715ea 100644 --- a/src/game/monster/shalrath/shalrath.c +++ b/src/game/monster/shalrath/shalrath.c @@ -191,7 +191,7 @@ FireShalrathPod(edict_t *self) vec3_t vec; vec3_t offset = {16, 0, 16}; - AngleVectors (self->s.angles, forward, right, NULL); + AngleVectors(self->s.angles, forward, right, NULL); G_ProjectSource(self->s.origin, offset, forward, right, start); VectorCopy(self->enemy->s.origin, vec); vec[2] += self->enemy->viewheight; diff --git a/src/game/monster/shambler/shambler.c b/src/game/monster/shambler/shambler.c index fe1bbb9b9..1b75ef701 100644 --- a/src/game/monster/shambler/shambler.c +++ b/src/game/monster/shambler/shambler.c @@ -710,8 +710,8 @@ SP_monster_shambler(edict_t* self) } self->s.modelindex = gi.modelindex("models/monsters/shambler/tris.md2"); - VectorSet (self->mins, -32, -32, -24); - VectorSet (self->maxs, 32, 32, 64); + VectorSet(self->mins, -32, -32, -24); + VectorSet(self->maxs, 32, 32, 64); self->movetype = MOVETYPE_STEP; self->solid = SOLID_BBOX; diff --git a/src/game/monster/spreader/spreadermist.c b/src/game/monster/spreader/spreadermist.c index b44a9e223..1957a51ed 100644 --- a/src/game/monster/spreader/spreadermist.c +++ b/src/game/monster/spreader/spreadermist.c @@ -255,7 +255,7 @@ static void spreader_grenade_touch (edict_t *self, edict_t *other, cplane_t *pla if (surf && (surf->flags & SURF_SKY)) { - G_FreeEdict (self); + G_FreeEdict(self); return; } @@ -424,11 +424,11 @@ void spreader_toss_grenade(edict_t *self) //self is the tosser if(self->monsterinfo.aiflags & AI_NO_MISSILE) return;//fixme: actually prevent these anims - AngleVectors (self->s.angles, forward, right, NULL); + AngleVectors(self->s.angles, forward, right, NULL); G_ProjectSource (self->s.origin, offset, forward, right, start); grenade = G_Spawn(); - VectorCopy (start, grenade->s.origin); + VectorCopy(start, grenade->s.origin); M_PredictTargetPosition( self->enemy, self->enemy->velocity, 15, predPos); @@ -436,9 +436,9 @@ void spreader_toss_grenade(edict_t *self) //self is the tosser distance = VectorLength (v); distance *= 1.25; - VectorCopy (forward, aim); + VectorCopy(forward, aim); VectoAngles (aim, dir); - AngleVectors (dir, forward, right, up); + AngleVectors(dir, forward, right, up); VectorScale (aim, distance, grenade->velocity); VectorMA (grenade->velocity, flrand(100.0F, 125.0F), up, grenade->velocity); @@ -446,15 +446,15 @@ void spreader_toss_grenade(edict_t *self) //self is the tosser //FIXME: Difficulty modifier here VectorMA (grenade->velocity, flrand(-10.0F, 10.0F), right, grenade->velocity); - VectorSet (grenade->avelocity, flrand(300,600), flrand(300,600), flrand(300,600)); + VectorSet(grenade->avelocity, flrand(300,600), flrand(300,600), flrand(300,600)); grenade->movetype = MOVETYPE_STEP; grenade->elasticity = 1; grenade->friction = 1; grenade->clipmask = MASK_SHOT; grenade->solid = SOLID_BBOX; - VectorSet (grenade->mins, -1, -1, -1); - VectorSet (grenade->maxs, 1, 1, 1); + VectorSet(grenade->mins, -1, -1, -1); + VectorSet(grenade->maxs, 1, 1, 1); grenade->s.modelindex = gi.modelindex ("models/monsters/spreader/bomb/tris.fm"); grenade->owner = self; @@ -471,5 +471,5 @@ void spreader_toss_grenade(edict_t *self) //self is the tosser grenade->classname = "spreader_grenade"; grenade->s.effects |= EF_CAMERA_NO_CLIP; - gi.linkentity (grenade); + gi.linkentity(grenade); } diff --git a/src/game/monster/tank/tank.c b/src/game/monster/tank/tank.c index 87c491d3a..fbe61d514 100644 --- a/src/game/monster/tank/tank.c +++ b/src/game/monster/tank/tank.c @@ -539,11 +539,11 @@ TankRocket(edict_t *self) if (blindfire) { - VectorCopy (self->monsterinfo.blind_fire_target, target); + VectorCopy(self->monsterinfo.blind_fire_target, target); } else { - VectorCopy (self->enemy->s.origin, target); + VectorCopy(self->enemy->s.origin, target); } if (blindfire) diff --git a/src/game/monster/tarbaby/tarbaby.c b/src/game/monster/tarbaby/tarbaby.c index f40aed5f0..91715ac4a 100644 --- a/src/game/monster/tarbaby/tarbaby.c +++ b/src/game/monster/tarbaby/tarbaby.c @@ -145,7 +145,7 @@ tarbaby_jump_step(edict_t *self) self->movetype = MOVETYPE_BOUNCE; self->touch = tarbaby_touch; - AngleVectors (self->s.angles, forward, NULL, NULL); + AngleVectors(self->s.angles, forward, NULL, NULL); self->s.origin[2] += 1; VectorScale(forward, 600, self->velocity); self->velocity[2] = 200 + (random() * 150); diff --git a/src/game/monster/tcheckrik/tcheckrik.c b/src/game/monster/tcheckrik/tcheckrik.c index 364c03b32..74c1ea919 100644 --- a/src/game/monster/tcheckrik/tcheckrik.c +++ b/src/game/monster/tcheckrik/tcheckrik.c @@ -1664,8 +1664,8 @@ void SP_monster_tcheckrik_male (edict_t *self) VectorCopy(STDMinsForClass[self->classID], self->mins); VectorCopy(STDMaxsForClass[self->classID], self->maxs); -// VectorSet (self->mins, -16, -16, -32); -// VectorSet (self->maxs, 16, 16, 32); +// VectorSet(self->mins, -16, -16, -32); +// VectorSet(self->maxs, 16, 16, 32); self->viewheight = self->maxs[2]*0.8; self->touch = M_Touch; diff --git a/src/game/monster/wizard/wizard.c b/src/game/monster/wizard/wizard.c index c9921e0f1..45ed86a26 100644 --- a/src/game/monster/wizard/wizard.c +++ b/src/game/monster/wizard/wizard.c @@ -149,7 +149,7 @@ spit_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf) if (surf && (surf->flags & SURF_SKY)) { - G_FreeEdict (self); + G_FreeEdict(self); return; } if (other->takedamage) @@ -221,7 +221,7 @@ wizard_spit(edict_t *self) vec3_t vec; vec3_t offset = {0, 0, 30}; - AngleVectors (self->s.angles, forward, right, NULL); + AngleVectors(self->s.angles, forward, right, NULL); G_ProjectSource(self->s.origin, offset, forward, right, start); VectorCopy(self->enemy->s.origin, vec); vec[2] += self->enemy->viewheight; diff --git a/src/game/player/chase.c b/src/game/player/chase.c index fa8fcccfd..b23af6705 100644 --- a/src/game/player/chase.c +++ b/src/game/player/chase.c @@ -109,10 +109,10 @@ ChasecamRemove(edict_t *ent) ent->s.modelindex = ent->client->oldplayer->s.modelindex; ent->svflags &= ~SVF_NOCLIENT; - G_FreeEdict (ent->client->oldplayer); + G_FreeEdict(ent->client->oldplayer); ent->client->oldplayer = NULL; ent->client->chasetoggle = 0; - G_FreeEdict (ent->client->chasecam); + G_FreeEdict(ent->client->chasecam); ent->client->chasecam = NULL; } @@ -326,7 +326,7 @@ CheckChasecam_Viewent(edict_t *ent) ent->client->oldplayer->flags = ent->flags; /* end Lazarus */ - gi.linkentity (ent->client->oldplayer); + gi.linkentity(ent->client->oldplayer); } } diff --git a/src/game/player/client.c b/src/game/player/client.c index e9acb723b..a72e71af0 100644 --- a/src/game/player/client.c +++ b/src/game/player/client.c @@ -86,7 +86,7 @@ void SP_info_player_deathmatch(edict_t *self) { if (!deathmatch->value) { - G_FreeEdict (self); + G_FreeEdict(self); return; } // SP_misc_teleporter_dest (self); @@ -99,7 +99,7 @@ void SP_info_player_coop(edict_t *self) { if(!coop->value) { - G_FreeEdict (self); + G_FreeEdict(self); return; } // SP_misc_teleporter_dest (self); @@ -1872,13 +1872,13 @@ respawn(edict_t *self) if (self->client->oldplayer) { - G_FreeEdict (self->client->oldplayer); + G_FreeEdict(self->client->oldplayer); } self->client->oldplayer = NULL; if (self->client->chasecam) { - G_FreeEdict (self->client->chasecam); + G_FreeEdict(self->client->chasecam); } self->client->chasecam = NULL; @@ -2573,9 +2573,9 @@ PutClientInServer(edict_t *ent) // Set up the model's origin, making sure it's off the ground. - VectorCopy (spawn_origin, ent->s.origin); + VectorCopy(spawn_origin, ent->s.origin); ent->s.origin[2] += 1; - VectorCopy (ent->s.origin, ent->s.old_origin); + VectorCopy(ent->s.origin, ent->s.old_origin); ent->s.angles[PITCH] = 0; ent->s.angles[YAW] = spawn_angles[YAW]; @@ -3717,7 +3717,7 @@ ClientThink(edict_t *ent, usercmd_t *ucmd) VectorCopy(client->aimangles,client->ps.viewangles); } - gi.linkentity (ent); + gi.linkentity(ent); // Process touch triggers that the client could activate. diff --git a/src/game/spell/morph.c b/src/game/spell/morph.c index 9f4976bc7..590241d1b 100644 --- a/src/game/spell/morph.c +++ b/src/game/spell/morph.c @@ -167,8 +167,8 @@ void reset_morph_to_elf(edict_t *ent) ent->client->playerinfo.renderfx &= ~RF_IGNORE_REFS; // reset our mins and max's. And then let the physics move us out of anyone elses bounding box - VectorCopy (mins, ent->intentMins); - VectorCopy (maxs, ent->intentMaxs); + VectorCopy(mins, ent->intentMins); + VectorCopy(maxs, ent->intentMaxs); ent->physicsFlags |= PF_RESIZE; // reset our thinking diff --git a/src/game/spell/teleport.c b/src/game/spell/teleport.c index 532b39906..5e977ca28 100644 --- a/src/game/spell/teleport.c +++ b/src/game/spell/teleport.c @@ -29,8 +29,8 @@ void Perform_Teleport(edict_t *self) self->client->playerinfo.flags |= PLAYER_FLAG_RELEASEROPE; //physically move the player, bearing in mind thats what a teleport is - VectorCopy (self->client->tele_dest, self->client->playerinfo.origin); - VectorCopy (self->client->tele_dest, self->s.origin); + VectorCopy(self->client->tele_dest, self->client->playerinfo.origin); + VectorCopy(self->client->tele_dest, self->s.origin); // set angles for (i=0 ; i<3 ; i++) @@ -39,8 +39,8 @@ void Perform_Teleport(edict_t *self) self->s.angles[PITCH] = 0; self->s.angles[YAW] = self->client->tele_angles[YAW]; self->s.angles[ROLL] = 0; - VectorCopy (self->client->tele_angles, self->client->ps.viewangles); - VectorCopy (self->client->tele_angles, self->client->v_angle); + VectorCopy(self->client->tele_angles, self->client->ps.viewangles); + VectorCopy(self->client->tele_angles, self->client->v_angle); // reset the cvar Farclip dist, incase it was modified by a trigger - there should be no teleport // destinations or spawn points anywhere where the far clip has been modified. @@ -53,7 +53,7 @@ void Perform_Teleport(edict_t *self) KillBox (self); // re link us - gi.linkentity (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, "" ); diff --git a/src/game/spell/tornado.c b/src/game/spell/tornado.c index 21987f546..b1b858401 100644 --- a/src/game/spell/tornado.c +++ b/src/game/spell/tornado.c @@ -150,10 +150,10 @@ void SpellCastDropTornado(edict_t *caster, vec3_t startpos, vec3_t aimangles, ve VectorCopy(startpos, tornado->s.origin); tornado->s.origin[2] += 1.0; - VectorCopy (tornado->s.origin, end); + VectorCopy(tornado->s.origin, end); end[2] -= 256; - gi.linkentity (tornado); + gi.linkentity(tornado); trace = gi.trace(tornado->s.origin, NULL, NULL, end, tornado, MASK_SOLID);