game: cleanup exports and rename TH_viewthing -> viewthing_think

This commit is contained in:
Denis Pauk 2024-02-25 14:19:33 +02:00
parent 2323e12872
commit 4870c1cc62
8 changed files with 8 additions and 98 deletions

View file

@ -1200,56 +1200,3 @@ T_RadiusNukeDamage(edict_t *inflictor, edict_t *attacker, float damage,
} }
} }
} }
/*
* Like T_RadiusDamage, but ignores
* anything with classname=ignoreClass
*/
void
T_RadiusClassDamage(edict_t *inflictor, edict_t *attacker, float damage,
char *ignoreClass, float radius, int mod)
{
float points;
edict_t *ent = NULL;
vec3_t v;
vec3_t dir;
if (!inflictor || !attacker || !ignoreClass)
{
return;
}
while ((ent = findradius(ent, inflictor->s.origin, radius)) != NULL)
{
if (ent->classname && !strcmp(ent->classname, ignoreClass))
{
continue;
}
if (!ent->takedamage)
{
continue;
}
VectorAdd(ent->mins, ent->maxs, v);
VectorMA(ent->s.origin, 0.5, v, v);
VectorSubtract(inflictor->s.origin, v, v);
points = damage - 0.5 * VectorLength(v);
if (ent == attacker)
{
points = points * 0.5;
}
if (points > 0)
{
if (CanDamage(ent, inflictor))
{
VectorSubtract(ent->s.origin, inflictor->s.origin, dir);
T_Damage(ent, inflictor, attacker, dir, inflictor->s.origin,
vec3_origin, (int)points, (int)points, DAMAGE_RADIUS,
mod);
}
}
}
}

View file

@ -834,7 +834,7 @@ SP_point_combat(edict_t *self)
* Just for the debugging level. Don't use * Just for the debugging level. Don't use
*/ */
void void
TH_viewthing(edict_t *ent) viewthing_think(edict_t *ent)
{ {
if (!ent) if (!ent)
{ {
@ -871,7 +871,7 @@ SP_viewthing(edict_t *ent)
ent->s.modelindex = gi.modelindex("models/objects/banner/tris.md2"); ent->s.modelindex = gi.modelindex("models/objects/banner/tris.md2");
gi.linkentity(ent); gi.linkentity(ent);
ent->nextthink = level.time + 0.5; ent->nextthink = level.time + 0.5;
ent->think = TH_viewthing; ent->think = viewthing_think;
return; return;
} }

View file

@ -808,8 +808,6 @@ void T_RadiusDamage(edict_t *inflictor, edict_t *attacker,
int mod); int mod);
void T_RadiusNukeDamage(edict_t *inflictor, edict_t *attacker, float damage, void T_RadiusNukeDamage(edict_t *inflictor, edict_t *attacker, float damage,
edict_t *ignore, float radius, int mod); edict_t *ignore, float radius, int mod);
void T_RadiusClassDamage(edict_t *inflictor, edict_t *attacker, float damage,
char *ignoreClass, float radius, int mod);
void cleanupHealTarget(edict_t *ent); void cleanupHealTarget(edict_t *ent);
/* damage flags */ /* damage flags */
@ -858,7 +856,6 @@ void monster_dabeam(edict_t *self);
void monster_fire_blueblaster(edict_t *self, vec3_t start, vec3_t dir, int damage, void monster_fire_blueblaster(edict_t *self, vec3_t start, vec3_t dir, int damage,
int speed, int flashtype, int effect); int speed, int flashtype, int effect);
void Widow2Precache(void);
void M_droptofloor(edict_t *ent); void M_droptofloor(edict_t *ent);
void monster_think(edict_t *self); void monster_think(edict_t *self);
void walkmonster_start(edict_t *self); void walkmonster_start(edict_t *self);

View file

@ -824,7 +824,7 @@ stalker_attack_melee(edict_t *self)
} }
} }
void static void
calcJumpAngle(vec3_t start, vec3_t end, float velocity, vec3_t angles) calcJumpAngle(vec3_t start, vec3_t end, float velocity, vec3_t angles)
{ {
float distV, distH; float distV, distH;

View file

@ -1820,7 +1820,7 @@ WidowCalcSlots(edict_t *self)
} }
} }
void static void
WidowPrecache(void) WidowPrecache(void)
{ {
/* cache in all of the stalker stuff, widow stuff, spawngro stuff, gibs */ /* cache in all of the stalker stuff, widow stuff, spawngro stuff, gibs */

View file

@ -1436,7 +1436,7 @@ Widow2_CheckAttack(edict_t *self)
return false; return false;
} }
void static void
Widow2Precache(void) Widow2Precache(void)
{ {
/* cache in all of the stalker stuff, widow stuff, spawngro stuff, gibs */ /* cache in all of the stalker stuff, widow stuff, spawngro stuff, gibs */
@ -1539,7 +1539,7 @@ SP_monster_widow2(edict_t *self)
walkmonster_start(self); walkmonster_start(self);
} }
void static void
WidowVelocityForDamage(int damage, vec3_t v) WidowVelocityForDamage(int damage, vec3_t v)
{ {
v[0] = damage * crandom(); v[0] = damage * crandom();

View file

@ -42,10 +42,6 @@ extern edict_t * PlayerTrail_PickFirst ( edict_t * self ) ;
extern edict_t * PlayerTrail_PickNext ( edict_t * self ) ; extern edict_t * PlayerTrail_PickNext ( edict_t * self ) ;
extern edict_t * SelectFarthestDeathmatchSpawnPoint ( void ) ; extern edict_t * SelectFarthestDeathmatchSpawnPoint ( void ) ;
extern edict_t * SelectRandomDeathmatchSpawnPoint ( void ) ; extern edict_t * SelectRandomDeathmatchSpawnPoint ( void ) ;
extern edict_t * SpawnBadArea ( vec3_t mins , vec3_t maxs , float lifespan , edict_t * owner ) ;
extern edict_t * Sphere_Spawn ( edict_t * owner , int spawnflags ) ;
extern edict_t * findradius ( edict_t * from , vec3_t org , float rad ) ;
extern edict_t * findradius2 ( edict_t * from , vec3_t org , float rad ) ;
extern edict_t * fixbot_FindDeadMonster ( edict_t * self ) ; extern edict_t * fixbot_FindDeadMonster ( edict_t * self ) ;
extern edict_t * medic_FindDeadMonster ( edict_t * self ) ; extern edict_t * medic_FindDeadMonster ( edict_t * self ) ;
extern float PlayersRangeFromSpot ( edict_t * spot ) ; extern float PlayersRangeFromSpot ( edict_t * spot ) ;
@ -342,23 +338,15 @@ extern void SetTriggeredSpawn ( edict_t * ent ) ;
extern void ShamClaw(edict_t* self); extern void ShamClaw(edict_t* self);
extern void ShamblerCastLightning(edict_t* self); extern void ShamblerCastLightning(edict_t* self);
extern void ShamblerSaveLoc(edict_t* self); extern void ShamblerSaveLoc(edict_t* self);
extern void SpawnEntities ( const char * mapname , char * entities , const char * spawnpoint ) ;
extern void SpawnGrow_Spawn ( vec3_t startpos , int size ) ;
extern void SpawnItem ( edict_t * ent , gitem_t * item ) ; extern void SpawnItem ( edict_t * ent , gitem_t * item ) ;
extern void TH_viewthing ( edict_t * ent ) ; extern void viewthing_think ( edict_t * ent ) ;
extern void T_Damage ( edict_t * targ , edict_t * inflictor , edict_t * attacker , vec3_t dir , vec3_t point , vec3_t normal , int damage , int knockback , int dflags , int mod ) ;
extern void T_RadiusClassDamage ( edict_t * inflictor , edict_t * attacker , float damage , char * ignoreClass , float radius , int mod ) ;
extern void T_RadiusDamage ( edict_t * inflictor , edict_t * attacker , float damage , edict_t * ignore , float radius , int mod ) ;
extern void T_RadiusNukeDamage ( edict_t * inflictor , edict_t * attacker , float damage , edict_t * ignore , float radius , int mod ) ;
extern void Tag_DogTag ( edict_t * ent , edict_t * killer , char * * pic ) ; extern void Tag_DogTag ( edict_t * ent , edict_t * killer , char * * pic ) ;
extern void Tag_DropToken ( edict_t * ent , gitem_t * item ) ; extern void Tag_DropToken ( edict_t * ent , gitem_t * item ) ;
extern void Tag_GameInit ( void ) ;
extern void Tag_KillItBonus ( edict_t * self ) ; extern void Tag_KillItBonus ( edict_t * self ) ;
extern void Tag_MakeTouchable ( edict_t * ent ) ; extern void Tag_MakeTouchable ( edict_t * ent ) ;
extern void Tag_PlayerDeath ( edict_t * targ , edict_t * inflictor , edict_t * attacker ) ; extern void Tag_PlayerDeath ( edict_t * targ , edict_t * inflictor , edict_t * attacker ) ;
extern void Tag_PlayerDisconnect ( edict_t * self ) ; extern void Tag_PlayerDisconnect ( edict_t * self ) ;
extern void Tag_PlayerEffects ( edict_t * ent ) ; extern void Tag_PlayerEffects ( edict_t * ent ) ;
extern void Tag_PostInitSetup ( void ) ;
extern void Tag_Respawn ( edict_t * ent ) ; extern void Tag_Respawn ( edict_t * ent ) ;
extern void Tag_Score ( edict_t * attacker , edict_t * victim , int scoreChange ) ; extern void Tag_Score ( edict_t * attacker , edict_t * victim , int scoreChange ) ;
extern void TankBlaster ( edict_t * self ) ; extern void TankBlaster ( edict_t * self ) ;
@ -451,7 +439,6 @@ extern void Weapon_Trap ( edict_t * ent ) ;
extern void Widow2Beam ( edict_t * self ) ; extern void Widow2Beam ( edict_t * self ) ;
extern void Widow2BeamTargetRemove ( edict_t * self ) ; extern void Widow2BeamTargetRemove ( edict_t * self ) ;
extern void Widow2Crunch ( edict_t * self ) ; extern void Widow2Crunch ( edict_t * self ) ;
extern void Widow2Precache ( void ) ;
extern void Widow2SaveBeamTarget ( edict_t * self ) ; extern void Widow2SaveBeamTarget ( edict_t * self ) ;
extern void Widow2SaveDisruptLoc ( edict_t * self ) ; extern void Widow2SaveDisruptLoc ( edict_t * self ) ;
extern void Widow2Spawn ( edict_t * self ) ; extern void Widow2Spawn ( edict_t * self ) ;
@ -476,13 +463,10 @@ extern void WidowGoinQuad ( edict_t * self , float framenum ) ;
extern void WidowPent ( edict_t * self , float framenum ) ; extern void WidowPent ( edict_t * self , float framenum ) ;
extern void WidowPowerArmor ( edict_t * self ) ; extern void WidowPowerArmor ( edict_t * self ) ;
extern void WidowPowerups ( edict_t * self ) ; extern void WidowPowerups ( edict_t * self ) ;
extern void WidowPrecache ( void ) ;
extern void WidowRail ( edict_t * self ) ; extern void WidowRail ( edict_t * self ) ;
extern void WidowRespondPowerup ( edict_t * self , edict_t * other ) ; extern void WidowRespondPowerup ( edict_t * self , edict_t * other ) ;
extern void WidowSaveLoc ( edict_t * self ) ; extern void WidowSaveLoc ( edict_t * self ) ;
extern void WidowSpawn ( edict_t * self ) ; extern void WidowSpawn ( edict_t * self ) ;
extern void WidowVelocityForDamage ( int damage , vec3_t v ) ;
extern void Widowlegs_Spawn ( vec3_t startpos , vec3_t angles ) ;
extern void abortHeal ( edict_t *self, qboolean change_frame, qboolean gib, qboolean mark ) ; extern void abortHeal ( edict_t *self, qboolean change_frame, qboolean gib, qboolean mark ) ;
extern void actorMachineGun ( edict_t * self ) ; extern void actorMachineGun ( edict_t * self ) ;
extern void actor_attack ( edict_t * self ) ; extern void actor_attack ( edict_t * self ) ;
@ -612,7 +596,6 @@ extern void button_return ( edict_t * self ) ;
extern void button_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; extern void button_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ;
extern void button_use ( edict_t * self , edict_t * other , edict_t * activator ) ; extern void button_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
extern void button_wait ( edict_t * self ) ; extern void button_wait ( edict_t * self ) ;
extern void calcJumpAngle ( vec3_t start , vec3_t end , float velocity , vec3_t angles ) ;
extern void carrier_attack ( edict_t * self ) ; extern void carrier_attack ( edict_t * self ) ;
extern void carrier_attack_gren ( edict_t * self ) ; extern void carrier_attack_gren ( edict_t * self ) ;
extern void carrier_attack_mg ( edict_t * self ) ; extern void carrier_attack_mg ( edict_t * self ) ;

View file

@ -280,27 +280,17 @@
{"ShamClaw", (byte *)ShamClaw}, {"ShamClaw", (byte *)ShamClaw},
{"ShamblerCastLightning", (byte *)ShamblerCastLightning}, {"ShamblerCastLightning", (byte *)ShamblerCastLightning},
{"ShamblerSaveLoc", (byte *)ShamblerSaveLoc}, {"ShamblerSaveLoc", (byte *)ShamblerSaveLoc},
{"SpawnBadArea", (byte *)SpawnBadArea},
{"SpawnEntities", (byte *)SpawnEntities},
{"SpawnGrow_Spawn", (byte *)SpawnGrow_Spawn},
{"SpawnItem", (byte *)SpawnItem}, {"SpawnItem", (byte *)SpawnItem},
{"Sphere_Spawn", (byte *)Sphere_Spawn}, {"viewthing_think", (byte *)viewthing_think},
{"TH_viewthing", (byte *)TH_viewthing},
{"T_Damage", (byte *)T_Damage},
{"T_RadiusClassDamage", (byte *)T_RadiusClassDamage},
{"T_RadiusDamage", (byte *)T_RadiusDamage},
{"T_RadiusNukeDamage", (byte *)T_RadiusNukeDamage},
{"Tag_ChangeDamage", (byte *)Tag_ChangeDamage}, {"Tag_ChangeDamage", (byte *)Tag_ChangeDamage},
{"Tag_DogTag", (byte *)Tag_DogTag}, {"Tag_DogTag", (byte *)Tag_DogTag},
{"Tag_DropToken", (byte *)Tag_DropToken}, {"Tag_DropToken", (byte *)Tag_DropToken},
{"Tag_GameInit", (byte *)Tag_GameInit},
{"Tag_KillItBonus", (byte *)Tag_KillItBonus}, {"Tag_KillItBonus", (byte *)Tag_KillItBonus},
{"Tag_MakeTouchable", (byte *)Tag_MakeTouchable}, {"Tag_MakeTouchable", (byte *)Tag_MakeTouchable},
{"Tag_PickupToken", (byte *)Tag_PickupToken}, {"Tag_PickupToken", (byte *)Tag_PickupToken},
{"Tag_PlayerDeath", (byte *)Tag_PlayerDeath}, {"Tag_PlayerDeath", (byte *)Tag_PlayerDeath},
{"Tag_PlayerDisconnect", (byte *)Tag_PlayerDisconnect}, {"Tag_PlayerDisconnect", (byte *)Tag_PlayerDisconnect},
{"Tag_PlayerEffects", (byte *)Tag_PlayerEffects}, {"Tag_PlayerEffects", (byte *)Tag_PlayerEffects},
{"Tag_PostInitSetup", (byte *)Tag_PostInitSetup},
{"Tag_Respawn", (byte *)Tag_Respawn}, {"Tag_Respawn", (byte *)Tag_Respawn},
{"Tag_Score", (byte *)Tag_Score}, {"Tag_Score", (byte *)Tag_Score},
{"TankBlaster", (byte *)TankBlaster}, {"TankBlaster", (byte *)TankBlaster},
@ -393,7 +383,6 @@
{"Widow2Beam", (byte *)Widow2Beam}, {"Widow2Beam", (byte *)Widow2Beam},
{"Widow2BeamTargetRemove", (byte *)Widow2BeamTargetRemove}, {"Widow2BeamTargetRemove", (byte *)Widow2BeamTargetRemove},
{"Widow2Crunch", (byte *)Widow2Crunch}, {"Widow2Crunch", (byte *)Widow2Crunch},
{"Widow2Precache", (byte *)Widow2Precache},
{"Widow2SaveBeamTarget", (byte *)Widow2SaveBeamTarget}, {"Widow2SaveBeamTarget", (byte *)Widow2SaveBeamTarget},
{"Widow2SaveDisruptLoc", (byte *)Widow2SaveDisruptLoc}, {"Widow2SaveDisruptLoc", (byte *)Widow2SaveDisruptLoc},
{"Widow2Spawn", (byte *)Widow2Spawn}, {"Widow2Spawn", (byte *)Widow2Spawn},
@ -419,15 +408,12 @@
{"WidowPent", (byte *)WidowPent}, {"WidowPent", (byte *)WidowPent},
{"WidowPowerArmor", (byte *)WidowPowerArmor}, {"WidowPowerArmor", (byte *)WidowPowerArmor},
{"WidowPowerups", (byte *)WidowPowerups}, {"WidowPowerups", (byte *)WidowPowerups},
{"WidowPrecache", (byte *)WidowPrecache},
{"WidowRail", (byte *)WidowRail}, {"WidowRail", (byte *)WidowRail},
{"WidowRespondPowerup", (byte *)WidowRespondPowerup}, {"WidowRespondPowerup", (byte *)WidowRespondPowerup},
{"WidowSaveLoc", (byte *)WidowSaveLoc}, {"WidowSaveLoc", (byte *)WidowSaveLoc},
{"WidowSpawn", (byte *)WidowSpawn}, {"WidowSpawn", (byte *)WidowSpawn},
{"WidowTorso", (byte *)WidowTorso}, {"WidowTorso", (byte *)WidowTorso},
{"WidowVelocityForDamage", (byte *)WidowVelocityForDamage},
{"Widow_CheckAttack", (byte *)Widow_CheckAttack}, {"Widow_CheckAttack", (byte *)Widow_CheckAttack},
{"Widowlegs_Spawn", (byte *)Widowlegs_Spawn},
{"abortHeal", (byte *)abortHeal}, {"abortHeal", (byte *)abortHeal},
{"actorMachineGun", (byte *)actorMachineGun}, {"actorMachineGun", (byte *)actorMachineGun},
{"actor_attack", (byte *)actor_attack}, {"actor_attack", (byte *)actor_attack},
@ -564,7 +550,6 @@
{"button_touch", (byte *)button_touch}, {"button_touch", (byte *)button_touch},
{"button_use", (byte *)button_use}, {"button_use", (byte *)button_use},
{"button_wait", (byte *)button_wait}, {"button_wait", (byte *)button_wait},
{"calcJumpAngle", (byte *)calcJumpAngle},
{"canReach", (byte *)canReach}, {"canReach", (byte *)canReach},
{"carrier_attack", (byte *)carrier_attack}, {"carrier_attack", (byte *)carrier_attack},
{"carrier_attack_gren", (byte *)carrier_attack_gren}, {"carrier_attack_gren", (byte *)carrier_attack_gren},
@ -666,8 +651,6 @@
{"fd_secret_move5", (byte *)fd_secret_move5}, {"fd_secret_move5", (byte *)fd_secret_move5},
{"fd_secret_move6", (byte *)fd_secret_move6}, {"fd_secret_move6", (byte *)fd_secret_move6},
{"fd_secret_use", (byte *)fd_secret_use}, {"fd_secret_use", (byte *)fd_secret_use},
{"findradius", (byte *)findradius},
{"findradius2", (byte *)findradius2},
{"fire_beams", (byte *)fire_beams}, {"fire_beams", (byte *)fire_beams},
{"fire_bfg", (byte *)fire_bfg}, {"fire_bfg", (byte *)fire_bfg},
{"fire_blaster", (byte *)fire_blaster}, {"fire_blaster", (byte *)fire_blaster},