Big documentation update

This commit is contained in:
Walter Julius Hennecke 2013-04-12 23:26:59 +02:00
parent 71671b4fca
commit 3ffe39bf3a
14 changed files with 1051 additions and 855 deletions

View File

@ -303,15 +303,6 @@ static void ClientImpacts( gentity_t *ent, pmove_t *pm ) {
}
/*
============
G_TouchTriggers
============
*/
/**
* Find all trigger entities that ent's current position touches.
* Spectators will only interact with teleporters.
*/
void G_TouchTriggers( gentity_t *ent ) {
int i, num;
int touch[MAX_GENTITIES];
@ -931,10 +922,6 @@ static qhandle_t shieldDamageSound=0;
static qhandle_t shieldMurderSound=0;
static qhandle_t shieldDeactivateSound=0;
/**
* Remove a forcefield
*/
void G_Active_ShieldRemove(gentity_t *self)
{
self->think = G_FreeEntity;
@ -2210,15 +2197,6 @@ static void ClientThink_real( gentity_t *ent ) {
}
/*
==================
ClientThink
==================
*/
/**
* A new command has arrived from the client
*/
void ClientThink( int clientNum ) {
gentity_t *ent;
@ -2290,16 +2268,6 @@ static void SpectatorClientEndFrame( gentity_t *ent ) {
}
}
/*
==============
ClientEndFrame
==============
*/
/**
* Called at the end of each server frame for each connected client
* A fast client will have multiple ClientThink for each ClientEdFrame,
* while a slow client may have multiple ClientEndFrame between ClientThink.
*/
void ClientEndFrame( gentity_t *ent ) {
int i;
playerState_t *ps = &ent->client->ps;

View File

@ -519,16 +519,6 @@ void G_Client_Respawn( gentity_t *ent ) {
tent->s.clientNum = ent->s.clientNum;
}
/*
================
G_Client_TeamCount
Returns number of players on a team
================
*/
/**
* Returns number of players on a team
*/
team_t G_Client_TeamCount( int ignoreClientNum, int team ) {
int i;
int count = 0;
@ -548,13 +538,6 @@ team_t G_Client_TeamCount( int ignoreClientNum, int team ) {
return (team_t)count;
}
/*
================
G_Client_PickTeam
================
*/
team_t G_Client_PickTeam( int ignoreClientNum ) {
int counts[TEAM_NUM_TEAMS];

View File

@ -17,12 +17,6 @@ extern int numKilled;
extern clInitStatus_t clientInitialStatus[];
extern qboolean levelExiting;
/*
==================
DeathmatchScoreboardMessage
==================
*/
void DeathmatchScoreboardMessage( gentity_t *ent ) {
char entry[1024];
char string[1400];
@ -75,14 +69,6 @@ void DeathmatchScoreboardMessage( gentity_t *ent ) {
string ) );
}
/*
==================
Cmd_Score_f
Request current scoreboard information
==================
*/
void Cmd_Score_f( gentity_t *ent ) {
DeathmatchScoreboardMessage( ent );
}
@ -106,12 +92,6 @@ static qboolean CheatsOk( gentity_t *ent ) {
return qtrue;
}
/*
==================
ConcatArgs
==================
*/
char *ConcatArgs( int start ) {
int i, c, tlen;
static char line[MAX_STRING_CHARS];
@ -625,13 +605,6 @@ static void Cmd_Kill_f( gentity_t *ent )
}
}
/*
=================
BroadCastTeamChange
Let everyone know about a team change
=================
*/
void BroadcastTeamChange( gclient_t *client, int oldTeam )
{
clientSession_t *sess = &client->sess;
@ -681,11 +654,6 @@ void BroadcastClassChange( gclient_t *client, pclass_t oldPClass )
trap_SendServerCommand( -1, va("cp \"%.15s" S_COLOR_WHITE "%s\n\"", client->pers.netname, g_classData[client->sess.sessionClass].message) );
}
/*
=================
SetTeam
=================
*/
qboolean SetTeam( gentity_t *ent, char *s ) {
int team, oldTeam;
gclient_t *client;
@ -977,14 +945,7 @@ qboolean SetClass( gentity_t *ent, char *s, char *teamName, qboolean SaveToCvar
return qtrue;
}
/*
=================
StopFollowing
If the client being followed leaves the game, or you just want to drop
to free floating spectator mode
=================
*/
void StopFollowing( gentity_t *ent ) {
playerState_t *ps = &ent->client->ps;
clientSession_t *sess = &ent->client->sess;
@ -1285,11 +1246,6 @@ static void Cmd_Flight_f( gentity_t *ent )
trap_SendServerCommand( ent-g_entities, va("print \"%s\"", msg));
}
/*
=================
Cmd_FollowCycle_f
=================
*/
void Cmd_FollowCycle_f( gentity_t *ent, int dir ) {
int clientnum;
int original;

View File

@ -72,13 +72,7 @@ void SetScore( gentity_t *ent, int score ) {
//RPG-X: RedTechie - Lets enable score updating without this scores will not be updated
ent->client->UpdateScore = qfalse;
}
/*
=================
TossClientItems
Toss the weapon and powerups for the killed player
=================
*/
void TossClientItems( gentity_t *self, qboolean dis_con ) {
gitem_t *item;
float angle;
@ -171,13 +165,8 @@ static void GibEntity( gentity_t *self, int killer ) {
self->r.contents = 0;
}
/*
==================
body_die
==================
*/
void body_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int meansOfDeath ) {
int contents;
int contents;
contents = trap_PointContents( self->r.currentOrigin, -1 );
if(rpg_medicsrevive.integer == 1 && !( contents & CONTENTS_NODROP ) && (meansOfDeath != MOD_TRIGGER_HURT)){
if ( self->health > GIB_HEALTH_IMPOSSIBLE ) {
@ -1050,30 +1039,6 @@ static int G_LocationDamage(vec3_t point, gentity_t* targ, gentity_t* attacker,
return take;
}
/*
============
T_Damage
targ entity that is being damaged
inflictor entity that is causing the damage
attacker entity that caused the inflictor to damage targ
example: targ=monster, inflictor=rocket, attacker=player
dir direction of the attack for knockback
point point at which the damage is being inflicted, used for headshots
damage amount of damage being inflicted
knockback force to be applied against targ as a result of the damage
inflictor, attacker, dir, and point can be NULL for environmental effects
dflags these flags are used to control how T_Damage works
DAMAGE_RADIUS damage was indirect (from a nearby explosion)
DAMAGE_NO_ARMOR armor does not protect from this damage
DAMAGE_NO_KNOCKBACK do not affect velocity, just view angles
DAMAGE_NO_PROTECTION kills godmode, armor, everything
============
*/
void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
vec3_t dir, vec3_t point, int damage, int dflags, int mod ) {
gclient_t *client;
@ -1360,15 +1325,6 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
}
/*
============
CanDamage
Returns qtrue if the inflictor can directly damage the target. Used for
explosions and melee attacks.
============
*/
qboolean CanDamage (gentity_t *targ, vec3_t origin) {
vec3_t dest;
trace_t tr;
@ -1418,12 +1374,6 @@ qboolean CanDamage (gentity_t *targ, vec3_t origin) {
return qfalse;
}
/*
============
G_RadiusDamage
============
*/
extern void tripwireThink ( gentity_t *ent );
qboolean G_RadiusDamage ( vec3_t origin, gentity_t *attacker, float damage, float radius,
gentity_t *ignore, int dflags, int mod) {
@ -1531,12 +1481,7 @@ qboolean IsBorg(gentity_t *ent) {
extern void InitBBrush(gentity_t *ent);
extern void SP_misc_model_breakable(gentity_t* self);
/*
============
G_Repair
RPG-X | GSIO01 | 09/05/2009
============
*/
void G_Repair(gentity_t *ent, gentity_t *tr_ent, float rate) {
float distance;
vec3_t help, forward;

View File

@ -111,13 +111,6 @@ int Min_Weapon(int num)
}
}
/*
===============
Padd_Add
RPG-X | Marcin | 06/12/2008
===============
*/
void Padd_Add( gentity_t *key, gentity_t *who, char *txt )
{
int i = 0;
@ -158,12 +151,6 @@ void Padd_Add( gentity_t *key, gentity_t *who, char *txt )
++paddDataNum;
}
/*
===============
Padd_Get
RPG-X | Marcin | 06/12/2008
===============
*/
char *Padd_Get( gentity_t *key, gentity_t *who )
{
int i, j;
@ -188,12 +175,6 @@ char *Padd_Get( gentity_t *key, gentity_t *who )
return 0;
}
/*
===============
Padd_Remove
RPG-X | Marcin | 06/12/2008
===============
*/
void Padd_Remove( gentity_t *key )
{
int i = 0;
@ -452,11 +433,6 @@ int Pickup_Armor( gentity_t *ent, gentity_t *other ) {
//======================================================================
/*
===============
RespawnItem
===============
*/
void RespawnItem( gentity_t *ent ) {
if(!ent) return;
@ -503,11 +479,6 @@ void RespawnItem( gentity_t *ent ) {
}
/*
===============
Touch_Item
===============
*/
void Touch_Item (gentity_t *ent, gentity_t *other, trace_t *trace) {
int respawn;
@ -736,14 +707,6 @@ gentity_t *DropWeapon( gentity_t *ent, gitem_t *item, float angle, int flags, ch
return LaunchItem( item, ent, origin, velocity, flags, txt );
}
/*
================
Drop_Item
Spawns an item and tosses it forward
================
*/
gentity_t *Drop_Item( gentity_t *ent, gitem_t *item, float angle ) {
vec3_t velocity;
vec3_t angles;
@ -773,14 +736,6 @@ void Use_Item( gentity_t *ent, gentity_t *other, gentity_t *activator ) {
//======================================================================
/*
================
FinishSpawningItem
Traces down to find where an item should rest, instead of letting them
free fall from their spawn points
================
*/
void FinishSpawningItem( gentity_t *ent ) {
trace_t tr;
vec3_t dest;
@ -955,11 +910,6 @@ qboolean FinishSpawningDecoy( gentity_t *ent, int itemIndex )
qboolean itemRegistered[MAX_ITEMS];
/*
==============
ClearRegisteredItems
==============
*/
void ClearRegisteredItems( void ) {
memset( itemRegistered, 0, sizeof( itemRegistered ) );
// players always start with the base weapon
@ -979,13 +929,6 @@ void ClearRegisteredItems( void ) {
RegisterItem( BG_FindItemForWeapon( WP_7 ) );
}
/*
===============
RegisterItem
The item will be added to the precache list
===============
*/
void RegisterItem( gitem_t *item ) {
if ( !item ) {
G_Error( "RegisterItem: NULL" );
@ -995,15 +938,6 @@ void RegisterItem( gitem_t *item ) {
itemRegistered[ item - bg_itemlist ] = qtrue;
}
/*
===============
SaveRegisteredItems
Write the needed items to a config string
so the client will know which ones to precache
===============
*/
void SaveRegisteredItems( void ) {
char string[MAX_ITEMS+1];
int i;
@ -1062,16 +996,6 @@ qboolean G_ItemClassnameSuppressed( char *itemname )
return G_ItemSuppressed( itemType, itemTag );
}
/*
============
G_SpawnItem
Sets the clipping size and plants the object on the floor.
Items can't be immediately dropped to floor, because they might
be on an entity that hasn't spawned yet.
============
*/
void G_SpawnItem (gentity_t *ent, gitem_t *item) {
if ( G_ItemSuppressed( item->giType, item->giTag ) )
{
@ -1130,13 +1054,6 @@ void G_BounceItem( gentity_t *ent, trace_t *trace ) {
ent->s.pos.trTime = level.time;
}
/*
================
G_RunItem
================
*/
void G_RunItem( gentity_t *ent ) {
vec3_t origin;
trace_t tr;

File diff suppressed because it is too large Load Diff

View File

@ -1982,11 +1982,7 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) {
}
extern list_iter_p iterTimedMessages; /* list iterator for timed messages */
/*
=================
G_ShutdownGame
=================
*/
void G_ShutdownGame( int restart ) {
G_Printf ("==== ShutdownGame ====\n");
@ -2319,14 +2315,6 @@ void SendScoreboardMessageToAllClients( void ) {
}
}
/*
========================
MoveClientToIntermission
When the intermission starts, this will be called for all players.
If a new client connects, this will be called after the spawn function.
========================
*/
void MoveClientToIntermission( gentity_t *ent ) {
entityState_t *es = &ent->s;
playerState_t *ps = &ent->client->ps;
@ -2356,13 +2344,6 @@ void MoveClientToIntermission( gentity_t *ent ) {
ent->r.contents = 0;
}
/*
==================
FindIntermissionPoint
This is also used for spectator spawns
==================
*/
void FindIntermissionPoint( void ) {
gentity_t *ent, *target;
vec3_t dir;

View File

@ -365,12 +365,6 @@ static void G_RunStuckMissile( gentity_t *ent )
G_RunThink( ent );
}
/*
================
G_Missile_Run
================
*/
void G_Missile_Run( gentity_t *ent ) {
vec3_t origin;
trace_t tr;
@ -416,12 +410,6 @@ void G_Missile_Run( gentity_t *ent ) {
//=============================================================================
/*
=================
fire_plasma
=================
*/
gentity_t *fire_plasma (gentity_t *self, vec3_t start, vec3_t dir) {
gentity_t *bolt;
@ -492,13 +480,6 @@ gentity_t *fire_comprifle(gentity_t *self, vec3_t start, vec3_t dir) {
//=============================================================================
/*
=================
fire_quantum
=================
*/
gentity_t *fire_quantum (gentity_t *self, vec3_t start, vec3_t dir) {
gentity_t *bolt;
@ -536,11 +517,6 @@ gentity_t *fire_quantum (gentity_t *self, vec3_t start, vec3_t dir) {
//=============================================================================
/*
=================
fire_grenade
=================
*/
gentity_t *fire_grenade (gentity_t *self, vec3_t start, vec3_t dir) {
gentity_t *bolt;
@ -580,12 +556,6 @@ gentity_t *fire_grenade (gentity_t *self, vec3_t start, vec3_t dir) {
//=============================================================================
/*
=================
fire_rocket
=================
*/
gentity_t *fire_rocket (gentity_t *self, vec3_t start, vec3_t dir) {
gentity_t *bolt;

View File

@ -358,12 +358,6 @@ static void G_MoverTeam( gentity_t *ent ) {
}
}
/*
================
G_Mover_Run
================
*/
void G_Mover_Run( gentity_t *ent ) {
// if not a team captain, don't do anything, because
// the captain will handle everything
@ -775,12 +769,6 @@ void Reached_BinaryMover( gentity_t *ent ) {
}
}
/*
================
G_Mover_UseBinaryMover
================
*/
void G_Mover_UseBinaryMover( gentity_t *ent, gentity_t *other, gentity_t *activator ) {
int total;
int partial;
@ -1218,11 +1206,6 @@ static void Touch_DoorTriggerSpectator( gentity_t *ent, gentity_t *other, trace_
void DoorTriggerReactivate(gentity_t *ent);
/*
================
G_Mover_TouchDoorTrigger
================
*/
void G_Mover_TouchDoorTrigger( gentity_t *ent, gentity_t *other, trace_t *trace ) {
#if 0
vec3_t vec, doorcenter, movedir;

View File

@ -13,11 +13,6 @@
sqlite3 *user_db;
qboolean sql_ready = qfalse;
/*
===============
G_Sql_Check_StepReturn
===============
*/
static qboolean G_Sql_Check_StepReturn(int r) {
switch(r) {
case SQLITE_ROW:
@ -30,11 +25,6 @@ static qboolean G_Sql_Check_StepReturn(int r) {
return qtrue;
}
/*
===============
G_Sql_Check_PrepareReturn
===============
*/
static qboolean G_Sql_Check_PrepareReturn(int r) {
switch(r) {
case SQLITE_OK:
@ -46,11 +36,6 @@ static qboolean G_Sql_Check_PrepareReturn(int r) {
return qtrue;
}
/*
===============
G_Sql_Check_BindReturn
===============
*/
static qboolean G_Sql_Check_BindReturn(int r) {
switch(r) {
case SQLITE_OK:
@ -62,11 +47,6 @@ static qboolean G_Sql_Check_BindReturn(int r) {
return qtrue;
}
/*
===============
G_Sql_Md5
===============
*/
static char *G_Sql_Md5(const char *s) {
char *res;
unsigned char sig[16];
@ -89,11 +69,6 @@ static char *G_Sql_Md5(const char *s) {
return res;
}
/*
===============
G_SqlInit
===============
*/
qboolean G_Sql_Init(void) {
int res;
sqlite3_stmt *stmt;
@ -152,11 +127,6 @@ qboolean G_Sql_Init(void) {
return qtrue;
}
/*
===============
G_Sql_Shutdown
===============
*/
void G_Sql_Shutdown(void) {
if(!sql_use.integer) return;
@ -166,11 +136,6 @@ void G_Sql_Shutdown(void) {
sqlite3_close(user_db);
}
/*
===============
G_Sql_UserDB_Del
===============
*/
qboolean G_Sql_UserDB_Del(const char *uName) {
sqlite3_stmt *stmt;
int res, id = -1;
@ -241,11 +206,6 @@ qboolean G_Sql_UserDB_Del(const char *uName) {
return qtrue;
}
/*
===============
G_Sql_UserAdd
===============
*/
qboolean G_Sql_UserDB_Add(const char *uName, const char *password) {
sqlite3_stmt *stmt;
int res, id;
@ -334,11 +294,6 @@ qboolean G_Sql_UserDB_Add(const char *uName, const char *password) {
return qtrue;
}
/*
===============
G_Sql_UserDB_login
===============
*/
qboolean G_Sql_UserDB_Login(const char *uName, const char *pwd, int clientnum) {
sqlite3_stmt *stmt;
int res, id;
@ -406,11 +361,6 @@ qboolean G_Sql_UserDB_Login(const char *uName, const char *pwd, int clientnum) {
return qtrue;
}
/*
===============
G_Sql_UserDB_CheckRight
===============
*/
qboolean G_Sql_UserDB_CheckRight(int uid, int right) {
sqlite3_stmt *stmt;
int res;
@ -454,11 +404,6 @@ qboolean G_Sql_UserDB_CheckRight(int uid, int right) {
return qfalse;
}
/*
===============
G_Sql_UserDB_AddRight
===============
*/
qboolean G_Sql_UserDB_AddRight(int uid, int right) {
sqlite3_stmt *stmt;
int res;
@ -512,11 +457,6 @@ qboolean G_Sql_UserDB_AddRight(int uid, int right) {
return qtrue;
}
/*
===============
G_Sql_UserDB_RemoveRight
===============
*/
qboolean G_Sql_UserDB_RemoveRight(int uid, int right) {
sqlite3_stmt *stmt;
int res;
@ -570,11 +510,6 @@ qboolean G_Sql_UserDB_RemoveRight(int uid, int right) {
return qtrue;
}
/*
===============
G_Sql_UserDB_GetUID
===============
*/
int G_Sql_UserDB_GetUID(const char *uName) {
sqlite3_stmt *stmt;
int res;

View File

@ -128,11 +128,6 @@ static void UpdateIPBans (void)
trap_Cvar_Set( "g_banIPs", iplist );
}
/*
=================
G_FilterPacket
=================
*/
qboolean G_FilterPacket (char *from)
{
int i;
@ -790,12 +785,6 @@ static void Svcmd_LuaRestart_f(void)
}
#endif
/*
=================
ConsoleCommand
=================
*/
qboolean ConsoleCommand( void ) { //void
char cmd[MAX_TOKEN_CHARS];

View File

@ -431,13 +431,6 @@ trigger_teleport
#define MAX_TRANSPORTER_POINTS 16
/**
* \brief Select a random spawn point.
*
* Select a random spawn point.
*
* @return a random spawn point
*/
gentity_t *SelectRandomSpawnPoint( void )
{
gentity_t *spot = NULL;

View File

@ -31,15 +31,6 @@ static int remapCount = 0;
/** List of shader remaps */
static shaderRemap_t remappedShaders[MAX_SHADER_REMAPS];
/**
* \brief Add a new shader remap.
*
* Remaps oldShader with newShader.
*
* @param oldShader shader to be remapped
* @param newShader replacement shader
* @param timeOffset time offset
*/
void AddRemap(const char *oldShader, const char *newShader, float timeOffset) {
int i;
@ -131,56 +122,20 @@ int G_FindConfigstringIndex( char *name, int start, int max, qboolean create ) {
return i;
}
/**
* \brief Get the model index for a model.
*
* Get the model index for a model.
*
* @param name the model name
*
* @return the models index
*/
int G_ModelIndex( char *name ) {
return G_FindConfigstringIndex (name, CS_MODELS, MAX_MODELS, qtrue);
}
/**
* \brief Get the sound index for a sound.
*
* Get the sound index for a sound.
*
* @param name the sound name
*
* @return the sounds index
*/
int G_SoundIndex( char *name ) {
return G_FindConfigstringIndex (name, CS_SOUNDS, MAX_SOUNDS, qtrue);
}
/**
* \brief Get the tric string index.
*
* Get the tric string index.
*
* @param name the tric string name
*
* @return the tric strings index
*/
int G_TricStringIndex( char *name ) {
return G_FindConfigstringIndex (name, CS_TRIC_STRINGS, MAX_TRIC_STRINGS, qtrue);
}
//=====================================================================
/**
* \brief Issue a team command.
*
* Issue a team command.
*
* @param team the team
* @param cmd the command
*/
void G_TeamCommand( team_t team, char *cmd ) {
int i;
@ -193,22 +148,6 @@ void G_TeamCommand( team_t team, char *cmd ) {
}
}
/**
*
* \brief Finds an entity.
*
* Searches all active entities for the next one that holds
* the matching string at fieldofs (use the FOFS() macro) in the structure.
* Searches beginning at the entity after from, or the beginning if NULL
* NULL will be returned if the end of the list is reached.
*
* @param from search from this entity on
* @param fieldofs in which field to look
* @param match string to match
*
* @return an matching entity or NULL
*/
gentity_t *G_Find (gentity_t *from, int fieldofs, const char *match)
{
char *s;
@ -236,15 +175,6 @@ gentity_t *G_Find (gentity_t *from, int fieldofs, const char *match)
/** Maximum number of possible choices for G_PickTarget. */
#define MAXCHOICES 32
/**
* \brief Pick a target.
*
* Selects a random entity from among the targets.
*
* @param targetname the targets targetname
*
* @return an entity or NULL
*/
gentity_t *G_PickTarget (char *targetname)
{
gentity_t *ent = NULL;
@ -325,18 +255,6 @@ gentity_t *G_PickTarget (char *targetname)
return choice[rand() % num_choices];
}
/**
* \brief Use all targets of the given entity.
*
* Goes through all entities and calls ther use function if their
* targetname, swapname, truename, falsename, bluename are matching
* the target. activator should be set the the inflictor of this function
* call.
*
* @param ent the entity
* @param activator the activator
* @param target target to match
*/
void G_UseTargets2( gentity_t *ent, gentity_t *activator, char *target ) {
gentity_t *t;
@ -507,14 +425,6 @@ void G_UseTargets2( gentity_t *ent, gentity_t *activator, char *target ) {
}
}
/**
* \brief Use all of the given entity's targets.
*
* Use all of the given entity's targets.
*
* @param ent the entity
* @param activator the initiator of the function call
*/
void G_UseTargets( gentity_t *ent, gentity_t *activator ) {
if ( !ent ) {
return;
@ -522,19 +432,6 @@ void G_UseTargets( gentity_t *ent, gentity_t *activator ) {
G_UseTargets2( ent, activator, ent->target );
}
/**
* \brief Create a temporary vector.
*
* This is just a convenience function
* for making temporary vectors for function calls
*
* @param x x-value
* @param y y-value
* @param z z-value
*
* @return temporary vector
*/
float *tv( float x, float y, float z ) {
static int index;
static vec3_t vecs[8];
@ -554,18 +451,7 @@ float *tv( float x, float y, float z ) {
return v;
}
/**
* \brief Converts a vector to a string to be printed.
*
* This is just a convenience function
* for printing vectors
*
* @param v the vector
*
* @return string representation of the vector
*/
char *vtos( const vec3_t v ) {
char *vtos( const vec3_t v ) {
static int index;
static char str[8][32];
char *s;
@ -579,19 +465,6 @@ char *vtos( const vec3_t v ) {
return s;
}
/**
* \brief Converts angles to move directions.
*
* The editor only specifies a single value for angles (yaw),
* but we have special constants to generate an up or down direction.
* Angles will be cleared, because it is being used to represent a direction
* instead of an orientation.
*
* @param angles the angles
* @param movedir the movedir
*/
void G_SetMovedir( vec3_t angles, vec3_t movedir ) {
static vec3_t VEC_UP = {0, -1, 0};
static vec3_t MOVEDIR_UP = {0, 0, 1};
@ -608,15 +481,6 @@ void G_SetMovedir( vec3_t angles, vec3_t movedir ) {
VectorClear( angles );
}
/**
* \brief Get the yaw from a vector.
*
* Get the yaw from a vector.
*
* @param vec the vector
*
* @return the yaw
*/
float vectoyaw( const vec3_t vec ) {
float yaw;
@ -638,13 +502,6 @@ float vectoyaw( const vec3_t vec ) {
return yaw;
}
/**
* \brief Init the entity.
*
* Inits a given game entity.
*
* @param e the entity
*/
void G_InitGentity( gentity_t *e ) {
e->inuse = qtrue;
e->classname = "noclass";
@ -652,19 +509,6 @@ void G_InitGentity( gentity_t *e ) {
e->r.ownerNum = ENTITYNUM_NONE;
}
/**
* \brief Spawns a new entity.
*
* Either finds a free entity, or allocates a new one.
* The slots from 0 to MAX_CLIENTS-1 are always reserved for clients,
* and will never be used by anything else.
* Try to avoid reusing an entity that was recently freed, because it
* can cause the client to think the entity morphed into something else
* instead of being removed and recreated, which can cause interpolated
* angles and bad trails.
*
* @return a new entity or NULL
*/
gentity_t *G_Spawn( void ) {
int i, force;
gentity_t *e;
@ -745,14 +589,6 @@ gentity_t *G_Spawn( void ) {
return e;
}
/**
* \brief Free an entity.
*
* Marks the entity as free.
*
* @param ed entity to free
*/
void G_FreeEntity( gentity_t *ed ) {
trap_UnlinkEntity (ed); /* unlink from world */
@ -774,18 +610,6 @@ void G_FreeEntity( gentity_t *ed ) {
ed->inuse = qfalse;
}
/**
* \brief Spawn an temporary entity.
*
* Spawns an event entity that will be auto-removed
* The origin will be snapped to save net bandwidth, so care
* must be taken if the origin is right on a surface (snap towards start vector first)
*
* @param origin the origin
* @param event the event to use for this entity
*
* @return the temporary entity
*/
gentity_t *G_TempEntity( vec3_t origin, int event ) {
gentity_t *e;
vec3_t snapped;
@ -817,14 +641,6 @@ Kill box
==============================================================================
*/
/**
* \brief Kill all that would be inside a new one.
*
* Kills all entities that would touch the proposed new positioning
* of ent. Ent should be unlinked before calling this!
*
* @param ent the entity
*/
void G_KillBox (gentity_t *ent) {
int i, num;
int touch[MAX_GENTITIES];
@ -848,17 +664,6 @@ void G_KillBox (gentity_t *ent) {
}
/**
* \author J2J
* \brief Push all entities away that are inside a new entity.
*
* Basically does teh same as G_KillBox except it will
* push players and other entities away instead of killing them.
*
* @param ent the entity
*
* @return was an ent moved?
*/
qboolean G_MoveBox (gentity_t *ent )
{
int i, num;
@ -895,17 +700,6 @@ qboolean G_MoveBox (gentity_t *ent )
//==============================================================================
/**
* \brief Adds a new Predictable event.
*
* Use for non-pmove events that would also be predicted on the
* client side: jumppads and item pickups
* Adds an event+parm and twiddles the event counter
*
* @param ent the entity
* @param event the event
* @param eventParm any parameters for the event
*/
void G_AddPredictableEvent( gentity_t *ent, int event, int eventParm ) {
if ( !ent->client ) {
return;
@ -913,16 +707,6 @@ void G_AddPredictableEvent( gentity_t *ent, int event, int eventParm ) {
BG_AddPredictableEventToPlayerstate( event, eventParm, &ent->client->ps );
}
/**
* \brief Add a new event.
*
* Adds an event+parm and twiddles the event counter
*
* @param ent the entity
* @param event the event
* @param eventParm parameter for the event
*/
void G_AddEvent( gentity_t *ent, int event, int eventParm ) {
int bits;
playerState_t *ps = &ent->client->ps;
@ -948,15 +732,6 @@ void G_AddEvent( gentity_t *ent, int event, int eventParm ) {
ent->eventTime = level.time;
}
/**
* \brief Makes an entity to play a non looping sound.
*
* Makes an entity to play a non looping sound.
*
* @param ent the entity
* @param soundIndex the sounds index
*/
void G_Sound( gentity_t *ent, int soundIndex ) {
gentity_t *te;
@ -967,15 +742,6 @@ void G_Sound( gentity_t *ent, int soundIndex ) {
//==============================================================================
/**
* \brief Set the Origin of an entity.
*
* Sets the pos trajectory for a fixed position
*
* @param ent the entity
* @param origin the new origin
*/
void G_SetOrigin( gentity_t *ent, vec3_t origin ) {
// lets try this to fix setting origins for brush ents without origin brush
VectorCopy(origin, ent->pos1); // needs testing
@ -990,14 +756,6 @@ void G_SetOrigin( gentity_t *ent, vec3_t origin ) {
VectorCopy( origin, ent->s.origin); /* RPG-X | GSIO01 | 24.08.2009 */
}
/**
* \brief Set the angles of an entity.
*
* Sets the pos trajectory for a fixed angular position
*
* @param ent the entity
* @param angles the new angles
*/
void G_SetAngles(gentity_t *ent, vec3_t angles) {
VectorCopy(angles, ent->s.apos.trBase);
ent->s.apos.trType = TR_STATIONARY;
@ -1339,17 +1097,6 @@ gentity_t *G_GetNearestPlayer(vec3_t origin, float radius, list_p ignore ) {
return nearest;
}
/**
* \author GSIO01
* \brief Get all entities with the specified targetname.
*
* Get all entities with the specified targetname.
*
* @param targetname the targetname
* @param entities the result
*
* @return number of entities found
*/
int G_GetEntityByTargetname(const char *targetname, list_p entities) {
int i;
gentity_t *t;
@ -1369,17 +1116,6 @@ int G_GetEntityByTargetname(const char *targetname, list_p entities) {
return entities->length;
}
/**
* \author GSIO01
* \brief Get all entities with specified target.
*
* Get all entities matching the specifie target.
*
* @param target target the entities should have
* @param entities the result
*
* @return number of matches found
*/
int G_GetEntityByTarget(const char *target, list_p entities) {
int i;
gentity_t *t;
@ -1399,18 +1135,6 @@ int G_GetEntityByTarget(const char *target, list_p entities) {
return entities->length;
}
/**
* \author GSIO01
* \brief Get all entities with specified brush model
*
* Get all entities matching the specified brush model.
* Normally this only shoud be one entity.
*
* @param bmodel brush model to match
* @param entities the result
*
* @return number of matches found
*/
int G_GetEntityByBmodel(char *bmodel, list_p entities) {
int i;
gentity_t *t;

View File

@ -61,15 +61,6 @@ extern vmCvar_t rpg_photonAltDamage;
#define QUANTUM_ALT_SPLASH_DAM rpg_photonAltDamage.integer
#define QUANTUM_ALT_SPLASH_RAD 80
/**
Round a vector to integers for more efficient network
transmission, but make sure that it rounds towards a given point
rather than blindly truncating. This prevents it from truncating
into a wall.
@param v vector to round
@param to rounded vector
*/
void G_Weapon_SnapVectorTowards( vec3_t v, vec3_t to ) {
int i;
@ -1328,13 +1319,6 @@ static void WP_FireQuantumBurst( gentity_t *ent, qboolean alt_fire )
G_LogWeaponFire(ent->s.number, WP_9);
}
/**
* \brief Checks wether accuray for this hit should be logged.
*
* @param target the target entity
* @param attacker the attacker entity
*/
qboolean G_Weapon_LogAccuracyHit( gentity_t *target, gentity_t *attacker ) {
if( !target->takedamage ) {
return qfalse;
@ -1496,20 +1480,6 @@ static float WP_ShotAltSize[WP_NUM_WEAPONS] =
/* 0,*/ /* WP_7 */
};
/**
* \brief Calculates the muzzle point.
*
* Calculates the muzzle point.
*
* @param ent the player
* @param fwd the forward vector
* @param rt the right vector
* @param vup the up vector
* @param muzzlePoint the muzzle point
* @param projsize projsize
*/
void G_Weapon_CalcMuzzlePoint ( gentity_t *ent, vec3_t fwd, vec3_t rt, vec3_t vup, vec3_t muzzlePoint, float projsize)
{
int weapontype;
@ -1734,14 +1704,6 @@ FireWeapon
#define ACCURACY_TRACKING_DELAY 100 /* in ms */
#define NUM_FAST_WEAPONS 3
/**
* \brief Fire weapons.
*
* Handles weapon firing.
*
* @param ent the player
* @param alt_fire was this alt fire mode?
*/
void FireWeapon( gentity_t *ent, qboolean alt_fire )
{
float projsize;