wrapping linkent and unlinkent calls

This commit is contained in:
Richard Allen 2003-03-22 20:29:26 +00:00
parent 0bc2c4251f
commit 50552c3289
16 changed files with 212 additions and 90 deletions

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.126 2003/03/22 20:29:26 jbravo
// wrapping linkent and unlinkent calls
//
// Revision 1.125 2003/03/22 20:19:20 jbravo // Revision 1.125 2003/03/22 20:19:20 jbravo
// Item replacement fixes, tmp ban after votekicks and ignore now works on // Item replacement fixes, tmp ban after votekicks and ignore now works on
// players with colors. // players with colors.
@ -2300,11 +2303,18 @@ void CG_StartMusic(void)
static qboolean JB_FileExists(const char *filename) static qboolean JB_FileExists(const char *filename)
{ {
int len; int len;
char hack[MAX_QPATH];
len = trap_FS_FOpenFile(filename, 0, FS_READ); Com_sprintf(hack, MAX_QPATH, "%s", filename);
if (len > 0) { len = trap_FS_FOpenFile(hack, 0, FS_READ);
if (len > 0)
return qtrue; return qtrue;
}
Com_sprintf(hack, MAX_QPATH, "%s.tga", filename);
len = trap_FS_FOpenFile(hack, 0, FS_READ);
if (len > 0)
return qtrue;
return qfalse; return qfalse;
} }
@ -2425,7 +2435,7 @@ void CG_ReplaceModels(void)
if (JB_FileExists(RQ3_handcannon_icon)) if (JB_FileExists(RQ3_handcannon_icon))
bg_itemlist[item - bg_itemlist].icon = (char *)&RQ3_handcannon_icon; bg_itemlist[item - bg_itemlist].icon = (char *)&RQ3_handcannon_icon;
else else
CG_Printf("^1Error loading handcannonmp5 replacement icon %s\n", cg_RQ3_handcannon_skin.string); CG_Printf("^1Error loading handcannon replacement icon %s\n", cg_RQ3_handcannon_skin.string);
} }
} }
if (!strcmp(item->classname, "weapon_m3")) { if (!strcmp(item->classname, "weapon_m3")) {
@ -2461,7 +2471,7 @@ void CG_ReplaceModels(void)
if (JB_FileExists(RQ3_akimbo_icon)) if (JB_FileExists(RQ3_akimbo_icon))
bg_itemlist[item - bg_itemlist].icon = (char *)&RQ3_akimbo_icon; bg_itemlist[item - bg_itemlist].icon = (char *)&RQ3_akimbo_icon;
else else
CG_Printf("^1Error loading akimbom3 replacement icon %s\n", cg_RQ3_akimbo_skin.string); CG_Printf("^1Error loading akimbo replacement icon %s\n", cg_RQ3_akimbo_skin.string);
} }
} }
if (!strcmp(item->classname, "weapon_grenade")) { if (!strcmp(item->classname, "weapon_grenade")) {

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.98 2003/03/22 20:29:26 jbravo
// wrapping linkent and unlinkent calls
//
// Revision 1.97 2003/03/10 07:07:58 jbravo // Revision 1.97 2003/03/10 07:07:58 jbravo
// Small unlagged fixes and voting delay added. // Small unlagged fixes and voting delay added.
// //
@ -553,7 +556,7 @@ void SpectatorThink(gentity_t * ent, usercmd_t * ucmd)
VectorCopy(client->ps.origin, ent->s.origin); VectorCopy(client->ps.origin, ent->s.origin);
G_TouchTriggers(ent); G_TouchTriggers(ent);
trap_UnlinkEntity(ent); trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
} }
// JBravo: Lets not allow bots to use any specmode other than FREE // JBravo: Lets not allow bots to use any specmode other than FREE
if (ent->r.svFlags & SVF_BOT) if (ent->r.svFlags & SVF_BOT)
@ -1300,7 +1303,7 @@ void ClientThink_real(gentity_t * ent)
// link entity now, after any personal teleporters have been used // link entity now, after any personal teleporters have been used
// JBravo: this call reactivates gibbed players. // JBravo: this call reactivates gibbed players.
if (!ent->client->gibbed) if (!ent->client->gibbed)
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
if (!ent->client->noclip) { if (!ent->client->noclip) {
G_TouchTriggers(ent); G_TouchTriggers(ent);
} }

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.10 2003/03/22 20:29:26 jbravo
// wrapping linkent and unlinkent calls
//
// Revision 1.9 2002/09/24 05:06:16 blaze // Revision 1.9 2002/09/24 05:06:16 blaze
// fixed spectating so ref\'s can now use all the chasecam modes. // fixed spectating so ref\'s can now use all the chasecam modes.
// //
@ -160,7 +163,7 @@ static gentity_t *SpawnModelOnVictoryPad(gentity_t * pad, vec3_t offset, gentity
G_SetOrigin(body, vec); G_SetOrigin(body, vec);
trap_LinkEntity(body); trap_RQ3LinkEntity(body, __LINE__, __FILE__);
body->count = place; body->count = place;
@ -281,7 +284,7 @@ static gentity_t *SpawnPodium(void)
VectorSubtract(level.intermission_origin, podium->r.currentOrigin, vec); VectorSubtract(level.intermission_origin, podium->r.currentOrigin, vec);
podium->s.apos.trBase[YAW] = vectoyaw(vec); podium->s.apos.trBase[YAW] = vectoyaw(vec);
trap_LinkEntity(podium); trap_RQ3LinkEntity(podium, __LINE__, __FILE__);
podium->think = PodiumPlacementThink; podium->think = PodiumPlacementThink;
podium->nextthink = level.time + 100; podium->nextthink = level.time + 100;

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.127 2003/03/22 20:29:26 jbravo
// wrapping linkent and unlinkent calls
//
// Revision 1.126 2003/03/10 07:07:58 jbravo // Revision 1.126 2003/03/10 07:07:58 jbravo
// Small unlagged fixes and voting delay added. // Small unlagged fixes and voting delay added.
// //
@ -666,7 +669,7 @@ void ClearBodyQue(void)
level.bodyQueIndex = 0; level.bodyQueIndex = 0;
for (i = 0; i < BODY_QUEUE_SIZE; i++) { for (i = 0; i < BODY_QUEUE_SIZE; i++) {
ent = level.bodyQue[i]; ent = level.bodyQue[i];
trap_UnlinkEntity(ent); trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
ent->physicsObject = qfalse; ent->physicsObject = qfalse;
} }
} }
@ -686,7 +689,7 @@ void BodySink(gentity_t * ent)
if (level.time - ent->timestamp > 6500) { if (level.time - ent->timestamp > 6500) {
// the body ques are never actually freed, they are just unlinked // the body ques are never actually freed, they are just unlinked
trap_UnlinkEntity(ent); trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
ent->physicsObject = qfalse; ent->physicsObject = qfalse;
return; return;
} }
@ -707,7 +710,7 @@ void CopyToBodyQue(gentity_t * ent)
gentity_t *body; gentity_t *body;
int contents; int contents;
trap_UnlinkEntity(ent); trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
// if client is in a nodrop area, don't leave the body // if client is in a nodrop area, don't leave the body
contents = trap_PointContents(ent->s.origin, -1); contents = trap_PointContents(ent->s.origin, -1);
@ -718,7 +721,7 @@ void CopyToBodyQue(gentity_t * ent)
body = level.bodyQue[level.bodyQueIndex]; body = level.bodyQue[level.bodyQueIndex];
level.bodyQueIndex = (level.bodyQueIndex + 1) % BODY_QUEUE_SIZE; level.bodyQueIndex = (level.bodyQueIndex + 1) % BODY_QUEUE_SIZE;
trap_UnlinkEntity(body); trap_RQ3UnlinkEntity(body, __LINE__, __FILE__);
body->s = ent->s; body->s = ent->s;
@ -786,7 +789,7 @@ void CopyToBodyQue(gentity_t * ent)
} }
VectorCopy(body->s.pos.trBase, body->r.currentOrigin); VectorCopy(body->s.pos.trBase, body->r.currentOrigin);
trap_LinkEntity(body); trap_RQ3LinkEntity(body, __LINE__, __FILE__);
} }
//====================================================================== //======================================================================
@ -1422,7 +1425,7 @@ void ClientBegin(int clientNum)
client = level.clients + clientNum; client = level.clients + clientNum;
if (ent->r.linked) { if (ent->r.linked) {
trap_UnlinkEntity(ent); trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
} }
G_InitGentity(ent); G_InitGentity(ent);
@ -1803,7 +1806,7 @@ void ClientSpawn(gentity_t * ent)
} else { } else {
G_KillBox(ent); G_KillBox(ent);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
// force the base weapon up // force the base weapon up
//Blaze: Changed WP_MACHINEGUN to WP_PISTOL //Blaze: Changed WP_MACHINEGUN to WP_PISTOL
@ -1898,7 +1901,7 @@ void ClientSpawn(gentity_t * ent)
if (ent->client->sess.sessionTeam != TEAM_SPECTATOR) { if (ent->client->sess.sessionTeam != TEAM_SPECTATOR) {
BG_PlayerStateToEntityState(&client->ps, &ent->s, qtrue); BG_PlayerStateToEntityState(&client->ps, &ent->s, qtrue);
VectorCopy(ent->client->ps.origin, ent->r.currentOrigin); VectorCopy(ent->client->ps.origin, ent->r.currentOrigin);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
// run the presend to set anything else // run the presend to set anything else
// JBravo: We should not have to call this during TP spawns // JBravo: We should not have to call this during TP spawns
@ -2036,7 +2039,7 @@ void ClientDisconnect(int clientNum)
ClientUserinfoChanged(level.sortedClients[0]); ClientUserinfoChanged(level.sortedClients[0]);
} }
trap_UnlinkEntity(ent); trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
ent->s.modelindex = 0; ent->s.modelindex = 0;
ent->inuse = qfalse; ent->inuse = qfalse;
ent->classname = "disconnected"; ent->classname = "disconnected";

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.134 2003/03/22 20:29:26 jbravo
// wrapping linkent and unlinkent calls
//
// Revision 1.133 2003/03/09 21:30:38 jbravo // Revision 1.133 2003/03/09 21:30:38 jbravo
// Adding unlagged. Still needs work. // Adding unlagged. Still needs work.
// //
@ -1544,14 +1547,14 @@ void player_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, i
//GibEntity (self, killer); //GibEntity (self, killer);
G_TempEntity(self->r.currentOrigin, EV_GIB_PLAYER); G_TempEntity(self->r.currentOrigin, EV_GIB_PLAYER);
self->client->gibbed = qtrue; self->client->gibbed = qtrue;
trap_UnlinkEntity(self); trap_RQ3UnlinkEntity(self, __LINE__, __FILE__);
} }
} else if (meansOfDeath == MOD_HANDCANNON && g_RQ3_gib.integer > 1 && self->health <= -15) { } else if (meansOfDeath == MOD_HANDCANNON && g_RQ3_gib.integer > 1 && self->health <= -15) {
self->client->noHead = qfalse; self->client->noHead = qfalse;
//GibEntity (self, killer); //GibEntity (self, killer);
G_TempEntity(self->r.currentOrigin, EV_GIB_PLAYER); G_TempEntity(self->r.currentOrigin, EV_GIB_PLAYER);
self->client->gibbed = qtrue; self->client->gibbed = qtrue;
trap_UnlinkEntity(self); trap_RQ3UnlinkEntity(self, __LINE__, __FILE__);
} }
} }
// never gib in a nodrop // never gib in a nodrop
@ -1605,7 +1608,7 @@ void player_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, i
// JBravo: lets not relink players that have been gibbed here. // JBravo: lets not relink players that have been gibbed here.
if (!self->client->gibbed) if (!self->client->gibbed)
trap_LinkEntity(self); trap_RQ3LinkEntity(self, __LINE__, __FILE__);
} }
/* /*

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.55 2003/03/22 20:29:26 jbravo
// wrapping linkent and unlinkent calls
//
// Revision 1.54 2002/10/30 20:04:34 jbravo // Revision 1.54 2002/10/30 20:04:34 jbravo
// Adding helmet // Adding helmet
// //
@ -477,7 +480,7 @@ void RespawnItem(gentity_t * ent)
ent->r.contents = CONTENTS_TRIGGER; ent->r.contents = CONTENTS_TRIGGER;
ent->s.eFlags &= ~EF_NODRAW; ent->s.eFlags &= ~EF_NODRAW;
ent->r.svFlags &= ~SVF_NOCLIENT; ent->r.svFlags &= ~SVF_NOCLIENT;
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
if (ent->item->giType == IT_POWERUP) { if (ent->item->giType == IT_POWERUP) {
// play powerup spawn sound to all clients // play powerup spawn sound to all clients
@ -743,7 +746,7 @@ void Touch_Item(gentity_t * ent, gentity_t * other, trace_t * trace)
ent->nextthink = level.time + respawn * 1000; ent->nextthink = level.time + respawn * 1000;
ent->think = RespawnItem; ent->think = RespawnItem;
} }
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
//====================================================================== //======================================================================
@ -846,7 +849,7 @@ gentity_t *LaunchItem(gitem_t * item, vec3_t origin, vec3_t velocity, int xr_fla
dropped->physicsBounce = 0.1f; dropped->physicsBounce = 0.1f;
} }
trap_LinkEntity(dropped); trap_RQ3LinkEntity(dropped, __LINE__, __FILE__);
return dropped; return dropped;
} }
@ -1012,7 +1015,7 @@ void FinishSpawningItem(gentity_t * ent)
} }
} }
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
qboolean itemRegistered[MAX_ITEMS]; qboolean itemRegistered[MAX_ITEMS];
@ -1056,7 +1059,7 @@ void G_CheckTeamItems(void)
ent->s.pos.trType = TR_STATIONARY; ent->s.pos.trType = TR_STATIONARY;
ent->s.modelindex = TEAM_RED; ent->s.modelindex = TEAM_RED;
G_SetOrigin(ent, flag->s.origin); G_SetOrigin(ent, flag->s.origin);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
// NiceAss: Find the blue flag // NiceAss: Find the blue flag
@ -1073,7 +1076,7 @@ void G_CheckTeamItems(void)
ent->s.pos.trType = TR_STATIONARY; ent->s.pos.trType = TR_STATIONARY;
ent->s.modelindex = TEAM_BLUE; ent->s.modelindex = TEAM_BLUE;
G_SetOrigin(ent, flag->s.origin); G_SetOrigin(ent, flag->s.origin);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
} }
} }
@ -1293,7 +1296,7 @@ void G_RunItem(gentity_t * ent)
ent->s.angles[1] = (level.time & 1023) * 360 / 1024.0f; ent->s.angles[1] = (level.time & 1023) * 360 / 1024.0f;
} }
trap_LinkEntity(ent); // FIXME: avoid this for stationary? trap_RQ3LinkEntity(ent, __LINE__, __FILE__); // FIXME: avoid this for stationary?
// check think function // check think function
G_RunThink(ent); G_RunThink(ent);

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.137 2003/03/22 20:29:26 jbravo
// wrapping linkent and unlinkent calls
//
// Revision 1.136 2003/03/10 07:07:58 jbravo // Revision 1.136 2003/03/10 07:07:58 jbravo
// Small unlagged fixes and voting delay added. // Small unlagged fixes and voting delay added.
// //
@ -1245,6 +1248,11 @@ void QDECL G_Error(const char *fmt, ...);
//Elder: added //Elder: added
void RQ3_StartUniqueItems(void); void RQ3_StartUniqueItems(void);
// JBravo: added
void trap_RQ3LinkEntity(gentity_t *ent, int line, char *file);
void trap_RQ3UnlinkEntity(gentity_t *ent, int line, char *file);
void trap_RQ3AdjustAreaPortalState(gentity_t *ent, qboolean open, int line, char *file);
// aasimon: init stuff // aasimon: init stuff
void RQ3_ReadInitFile(void); void RQ3_ReadInitFile(void);
void RQ3_ParseBuffer(char *buf, int len); void RQ3_ParseBuffer(char *buf, int len);

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.138 2003/03/22 20:29:26 jbravo
// wrapping linkent and unlinkent calls
//
// Revision 1.137 2003/03/22 20:19:20 jbravo // Revision 1.137 2003/03/22 20:19:20 jbravo
// Item replacement fixes, tmp ban after votekicks and ignore now works on // Item replacement fixes, tmp ban after votekicks and ignore now works on
// players with colors. // players with colors.
@ -765,6 +768,68 @@ void QDECL G_Error(const char *fmt, ...)
trap_Error(text); trap_Error(text);
} }
/*
================
trap_RQ3LinkEntity, trap_RQ3UnlinkEntity and trap_RQ3AdjustAreaPortalState
Written by JBravo to catch the bad gEnt bug
// if (!((((btye*)ent - (byte*)g_entities)) % sizeof(gentity_t))
// ((((btye*)ent - (byte*)g_entities)) / sizeof(gentity_t)))
================
*/
void trap_RQ3LinkEntity(gentity_t *ent, int line, char *file)
{
if (ent == NULL) {
G_Printf("^1trap_LinkEntity got called with a NULL ent from line %d of file %s\n", line, file);
G_LogPrintf("trap_LinkEntity got called with a NULL ent from line %d of file %s\n", line, file);
}
if (ent-g_entities < 0 || ent-g_entities > level.num_entities) {
G_Printf("^1trap_LinkEntity got called with a unaligned ent from line %d of file %s\n", line, file);
G_LogPrintf("trap_LinkEntity got called with a unaligned ent from line %d of file %s\n", line, file);
}
if (ent->s.number <0 || ent->s.number > level.num_entities) {
G_Printf("^1trap_LinkEntity got called with s.number outof range from line %d of file %s\n", line, file);
G_LogPrintf("trap_LinkEntity got called with s.number outof range from line %d of file %s\n", line, file);
}
trap_LinkEntity(ent);
}
void trap_RQ3UnlinkEntity(gentity_t *ent, int line, char *file)
{
if (ent == NULL) {
G_Printf("^1trap_UnlinkEntity got called with a NULL ent from line %d of file %s\n", line, file);
G_LogPrintf("trap_UnlinkEntity got called with a NULL ent from line %d of file %s\n", line, file);
}
if (ent-g_entities < 0 || ent-g_entities > level.num_entities) {
G_Printf("^1trap_UnlinkEntity got called with a unaligned ent from line %d of file %s\n", line, file);
G_LogPrintf("trap_UnlinkEntity got called with a unaligned ent from line %d of file %s\n", line, file);
}
if (ent->s.number <0 || ent->s.number > level.num_entities) {
G_Printf("^1trap_UnlinkEntity got called with s.number outof range from line %d of file %s\n", line, file);
G_LogPrintf("trap_UnlinkEntity got called with s.number outof range from line %d of file %s\n", line, file);
}
trap_UnlinkEntity(ent);
}
void trap_RQ3AdjustAreaPortalState(gentity_t *ent, qboolean open, int line, char *file)
{
if (ent == NULL) {
G_Printf("^1trap_RQ3AdjustAreaPortalState got called with a NULL ent from line %d of file %s\n", line, file);
G_LogPrintf("trap_RQ3AdjustAreaPortalState got called with a NULL ent from line %d of file %s\n", line, file);
}
if (ent-g_entities < 0 || ent-g_entities > level.num_entities) {
G_Printf("^1trap_RQ3AdjustAreaPortalState got called with a unaligned ent from line %d of file %s\n", line, file);
G_LogPrintf("trap_RQ3AdjustAreaPortalState got called with a unaligned ent from line %d of file %s\n", line, file);
}
if (ent->s.number <0 || ent->s.number > level.num_entities) {
G_Printf("^1trap_RQ3AdjustAreaPortalState got called with s.number outof range from line %d of file %s\n", line, file);
G_LogPrintf("trap_RQ3AdjustAreaPortalState got called with s.number outof range from line %d of file %s\n", line, file);
}
trap_AdjustAreaPortalState(ent, open);
}
/* /*
================ ================
G_FindTeams G_FindTeams
@ -2575,7 +2640,7 @@ void G_RunFrame(int levelTime)
} else if (ent->unlinkAfterEvent) { } else if (ent->unlinkAfterEvent) {
// items that will respawn will hide themselves after their pickup event // items that will respawn will hide themselves after their pickup event
ent->unlinkAfterEvent = qfalse; ent->unlinkAfterEvent = qfalse;
trap_UnlinkEntity(ent); trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
} }
} }
// temporary entities don't think // temporary entities don't think

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.67 2003/03/22 20:29:26 jbravo
// wrapping linkent and unlinkent calls
//
// Revision 1.66 2003/03/09 21:30:38 jbravo // Revision 1.66 2003/03/09 21:30:38 jbravo
// Adding unlagged. Still needs work. // Adding unlagged. Still needs work.
// //
@ -299,14 +302,14 @@ void SP_dlight(gentity_t * ent)
ent->s.pos.trType = TR_STATIONARY; ent->s.pos.trType = TR_STATIONARY;
VectorCopy(ent->s.origin, ent->r.currentOrigin); VectorCopy(ent->s.origin, ent->r.currentOrigin);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
/* /*
// Nothing significant to do // Nothing significant to do
void G_RunDlight(gentity_t * ent) void G_RunDlight(gentity_t * ent)
{ {
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
*/ */
@ -332,7 +335,7 @@ void TeleportPlayer(gentity_t * player, vec3_t origin, vec3_t angles)
tent->s.clientNum = player->s.clientNum; tent->s.clientNum = player->s.clientNum;
} }
// unlink to make sure it can't possibly interfere with G_KillBox // unlink to make sure it can't possibly interfere with G_KillBox
trap_UnlinkEntity(player); trap_RQ3UnlinkEntity(player, __LINE__, __FILE__);
VectorCopy(origin, player->client->ps.origin); VectorCopy(origin, player->client->ps.origin);
player->client->ps.origin[2] += 1; player->client->ps.origin[2] += 1;
@ -363,7 +366,7 @@ void TeleportPlayer(gentity_t * player, vec3_t origin, vec3_t angles)
VectorCopy(player->client->ps.origin, player->r.currentOrigin); VectorCopy(player->client->ps.origin, player->r.currentOrigin);
if (player->client->sess.sessionTeam != TEAM_SPECTATOR) { if (player->client->sess.sessionTeam != TEAM_SPECTATOR) {
trap_LinkEntity(player); trap_RQ3LinkEntity(player, __LINE__, __FILE__);
} }
} }
@ -388,7 +391,7 @@ void SP_misc_model(gentity_t * ent)
ent->s.modelindex = G_ModelIndex(ent->model); ent->s.modelindex = G_ModelIndex(ent->model);
VectorSet(ent->mins, -16, -16, -16); VectorSet(ent->mins, -16, -16, -16);
VectorSet(ent->maxs, 16, 16, 16); VectorSet(ent->maxs, 16, 16, 16);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
G_SetOrigin(ent, ent->s.origin); G_SetOrigin(ent, ent->s.origin);
VectorCopy(ent->s.angles, ent->s.apos.trBase); VectorCopy(ent->s.angles, ent->s.apos.trBase);
@ -463,7 +466,7 @@ void SP_misc_portal_surface(gentity_t * ent)
{ {
VectorClear(ent->r.mins); VectorClear(ent->r.mins);
VectorClear(ent->r.maxs); VectorClear(ent->r.maxs);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
ent->r.svFlags = SVF_PORTAL; ent->r.svFlags = SVF_PORTAL;
ent->s.eType = ET_PORTAL; ent->s.eType = ET_PORTAL;
@ -504,7 +507,7 @@ void SP_misc_portal_camera(gentity_t * ent)
VectorClear(ent->r.mins); VectorClear(ent->r.mins);
VectorClear(ent->r.maxs); VectorClear(ent->r.maxs);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
G_SpawnFloat("roll", "0", &roll); G_SpawnFloat("roll", "0", &roll);
@ -520,7 +523,7 @@ void SP_misc_sky_portal(gentity_t * ent)
ent->r.svFlags |= SVF_PORTAL; ent->r.svFlags |= SVF_PORTAL;
VectorClear(ent->r.mins); VectorClear(ent->r.mins);
VectorClear(ent->r.maxs); VectorClear(ent->r.maxs);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
if (!info[0]) { if (!info[0]) {
gentity_t *skyportal = G_Find(NULL, FOFS(targetname), ent->target); gentity_t *skyportal = G_Find(NULL, FOFS(targetname), ent->target);
@ -628,7 +631,7 @@ void InitShooter(gentity_t * ent, int weapon)
ent->think = InitShooter_Finish; ent->think = InitShooter_Finish;
ent->nextthink = level.time + 500; ent->nextthink = level.time + 500;
} }
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
/*QUAKED shooter_rocket (1 0 0) (-16 -16 -16) (16 16 16) /*QUAKED shooter_rocket (1 0 0) (-16 -16 -16) (16 16 16)
@ -683,7 +686,7 @@ void func_breakable_die(gentity_t * self, gentity_t * inflictor, gentity_t * att
if (self->damage > 0 && self->damage_radius > 0) if (self->damage > 0 && self->damage_radius > 0)
G_RadiusDamage(self->s.origin, attacker, self->damage, self->damage_radius, self, meansOfDeath); G_RadiusDamage(self->s.origin, attacker, self->damage, self->damage_radius, self, meansOfDeath);
// radius damage // radius damage
trap_UnlinkEntity(self); trap_RQ3UnlinkEntity(self, __LINE__, __FILE__);
} }
@ -860,7 +863,7 @@ void SP_func_breakable(gentity_t * ent)
Info_SetValueForKey(breakinfo, "id", id); Info_SetValueForKey(breakinfo, "id", id);
trap_SetConfigstring(CS_BREAKABLES + atoi(id), breakinfo); trap_SetConfigstring(CS_BREAKABLES + atoi(id), breakinfo);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
@ -963,7 +966,7 @@ void G_BreakGlass(gentity_t * ent, gentity_t * inflictor, gentity_t * attacker,
//tent = G_TempEntity( center, EV_BREAK_GLASS ); //tent = G_TempEntity( center, EV_BREAK_GLASS );
//tent->s.eventParm = eParm; //tent->s.eventParm = eParm;
//unlink it instead of freeing //unlink it instead of freeing
trap_UnlinkEntity(ent); trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
} else if (ent->chippable) { } else if (ent->chippable) {
//Stil has some life left, so chip it //Stil has some life left, so chip it
@ -1021,7 +1024,7 @@ void SP_func_pressure(gentity_t * ent)
// Make it appear as the brush // Make it appear as the brush
trap_SetBrushModel(ent, ent->model); trap_SetBrushModel(ent, ent->model);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
VectorCopy(ent->s.origin, ent->s.pos.trBase); VectorCopy(ent->s.origin, ent->s.pos.trBase);
VectorCopy(ent->s.origin, ent->r.currentOrigin); VectorCopy(ent->s.origin, ent->r.currentOrigin);

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.33 2003/03/22 20:29:26 jbravo
// wrapping linkent and unlinkent calls
//
// Revision 1.32 2003/03/09 21:30:38 jbravo // Revision 1.32 2003/03/09 21:30:38 jbravo
// Adding unlagged. Still needs work. // Adding unlagged. Still needs work.
// //
@ -137,7 +140,7 @@ void G_ExplodeMissile(gentity_t * ent)
} }
//Elder: huhh? //Elder: huhh?
//G_Printf("exploding knife\n"); //G_Printf("exploding knife\n");
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
/* /*
@ -228,8 +231,8 @@ void G_MissileImpact(gentity_t * ent, trace_t * trace)
ent->parent->client->ps.pm_flags |= PMF_GRAPPLE_PULL; ent->parent->client->ps.pm_flags |= PMF_GRAPPLE_PULL;
VectorCopy(ent->r.currentOrigin, ent->parent->client->ps.grapplePoint); VectorCopy(ent->r.currentOrigin, ent->parent->client->ps.grapplePoint);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
trap_LinkEntity(nent); trap_RQ3LinkEntity(nent, __LINE__, __FILE__);
return; return;
} }
@ -348,7 +351,7 @@ void G_MissileImpact(gentity_t * ent, trace_t * trace)
} }
} }
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
/* /*
@ -384,7 +387,7 @@ void G_RunMissile(gentity_t * ent)
VectorCopy(tr.endpos, ent->r.currentOrigin); VectorCopy(tr.endpos, ent->r.currentOrigin);
} }
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
if (tr.fraction != 1) { if (tr.fraction != 1) {
// never explode or bounce on sky // never explode or bounce on sky

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.55 2003/03/22 20:29:26 jbravo
// wrapping linkent and unlinkent calls
//
// Revision 1.54 2003/01/05 22:36:50 makro // Revision 1.54 2003/01/05 22:36:50 makro
// Added "inactive" field for entities // Added "inactive" field for entities
// New "target_activate" entity // New "target_activate" entity
@ -295,7 +298,7 @@ qboolean G_TryPushingEntity(gentity_t * check, gentity_t * pusher, vec3_t move,
} else { } else {
VectorCopy(check->s.pos.trBase, check->r.currentOrigin); VectorCopy(check->s.pos.trBase, check->r.currentOrigin);
} }
trap_LinkEntity(check); trap_RQ3LinkEntity(check, __LINE__, __FILE__);
return qtrue; return qtrue;
} }
// if it is ok to leave in the old position, do it // if it is ok to leave in the old position, do it
@ -365,7 +368,7 @@ qboolean G_TryPushingProxMine(gentity_t * check, gentity_t * pusher, vec3_t move
ret = G_CheckProxMinePosition(check); ret = G_CheckProxMinePosition(check);
if (ret) { if (ret) {
VectorCopy(check->s.pos.trBase, check->r.currentOrigin); VectorCopy(check->s.pos.trBase, check->r.currentOrigin);
trap_LinkEntity(check); trap_RQ3LinkEntity(check, __LINE__, __FILE__);
} }
return ret; return ret;
} }
@ -426,14 +429,14 @@ qboolean G_MoverPush(gentity_t * pusher, vec3_t move, vec3_t amove, gentity_t **
} }
// unlink the pusher so we don't get it in the entityList // unlink the pusher so we don't get it in the entityList
trap_UnlinkEntity(pusher); trap_RQ3UnlinkEntity(pusher, __LINE__, __FILE__);
listedEntities = trap_EntitiesInBox(totalMins, totalMaxs, entityList, MAX_GENTITIES); listedEntities = trap_EntitiesInBox(totalMins, totalMaxs, entityList, MAX_GENTITIES);
// move the pusher to it's final position // move the pusher to it's final position
VectorAdd(pusher->r.currentOrigin, move, pusher->r.currentOrigin); VectorAdd(pusher->r.currentOrigin, move, pusher->r.currentOrigin);
VectorAdd(pusher->r.currentAngles, amove, pusher->r.currentAngles); VectorAdd(pusher->r.currentAngles, amove, pusher->r.currentAngles);
trap_LinkEntity(pusher); trap_RQ3LinkEntity(pusher, __LINE__, __FILE__);
// see if any solid entities are inside the final position // see if any solid entities are inside the final position
for (e = 0; e < listedEntities; e++) { for (e = 0; e < listedEntities; e++) {
@ -498,7 +501,7 @@ qboolean G_MoverPush(gentity_t * pusher, vec3_t move, vec3_t amove, gentity_t **
p->ent->client->ps.delta_angles[YAW] = p->deltayaw; p->ent->client->ps.delta_angles[YAW] = p->deltayaw;
//VectorCopy (p->origin, p->ent->client->ps.origin); //VectorCopy (p->origin, p->ent->client->ps.origin);
} }
// trap_LinkEntity (p->ent); // trap_RQ3LinkEntity (p->ent, __LINE__, __FILE__);
} }
// return qfalse; // return qfalse;
continue; continue;
@ -521,7 +524,7 @@ qboolean G_MoverPush(gentity_t * pusher, vec3_t move, vec3_t amove, gentity_t **
p->ent->client->ps.delta_angles[YAW] = p->deltayaw; p->ent->client->ps.delta_angles[YAW] = p->deltayaw;
VectorCopy(p->origin, p->ent->client->ps.origin); VectorCopy(p->origin, p->ent->client->ps.origin);
} }
trap_LinkEntity(p->ent); trap_RQ3LinkEntity(p->ent, __LINE__, __FILE__);
} }
return qfalse; return qfalse;
} }
@ -564,7 +567,7 @@ void G_MoverTeam(gentity_t * ent)
part->s.apos.trTime += level.time - level.previousTime; part->s.apos.trTime += level.time - level.previousTime;
G_EvaluateTrajectory(&part->s.pos, level.time, part->r.currentOrigin); G_EvaluateTrajectory(&part->s.pos, level.time, part->r.currentOrigin);
G_EvaluateTrajectory(&part->s.apos, level.time, part->r.currentAngles); G_EvaluateTrajectory(&part->s.apos, level.time, part->r.currentAngles);
trap_LinkEntity(part); trap_RQ3LinkEntity(part, __LINE__, __FILE__);
} }
// if the pusher has a "blocked" function, call it // if the pusher has a "blocked" function, call it
@ -689,7 +692,7 @@ void SetMoverState(gentity_t * ent, moverState_t moverState, int time)
G_EvaluateTrajectory(&ent->s.pos, level.time, ent->r.currentOrigin); G_EvaluateTrajectory(&ent->s.pos, level.time, ent->r.currentOrigin);
G_EvaluateTrajectory(&ent->s.apos, level.time, ent->r.currentAngles); G_EvaluateTrajectory(&ent->s.apos, level.time, ent->r.currentAngles);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
/* /*
@ -793,7 +796,7 @@ void Reached_BinaryMover(gentity_t * ent)
} }
// close areaportals // close areaportals
if (ent->teammaster == ent || !ent->teammaster) { if (ent->teammaster == ent || !ent->teammaster) {
trap_AdjustAreaPortalState(ent, qfalse); trap_RQ3AdjustAreaPortalState(ent, qfalse, __LINE__, __FILE__);
} }
} else if (ent->moverState == ROTATOR_1TO2) { // Reaction } else if (ent->moverState == ROTATOR_1TO2) { // Reaction
@ -832,7 +835,7 @@ void Reached_BinaryMover(gentity_t * ent)
} }
// close areaportals // close areaportals
if (ent->teammaster == ent || !ent->teammaster) { if (ent->teammaster == ent || !ent->teammaster) {
trap_AdjustAreaPortalState(ent, qfalse); trap_RQ3AdjustAreaPortalState(ent, qfalse, __LINE__, __FILE__);
} }
} else { } else {
G_Error("Reached_BinaryMover: bad moverState"); G_Error("Reached_BinaryMover: bad moverState");
@ -898,7 +901,7 @@ void Use_BinaryMover(gentity_t * ent, gentity_t * other, gentity_t * activator)
// open areaportal // open areaportal
if (ent->teammaster == ent || !ent->teammaster) { if (ent->teammaster == ent || !ent->teammaster) {
trap_AdjustAreaPortalState(ent, qtrue); trap_RQ3AdjustAreaPortalState(ent, qtrue, __LINE__, __FILE__);
} }
return; return;
} }
@ -974,7 +977,7 @@ void Use_BinaryMover(gentity_t * ent, gentity_t * other, gentity_t * activator)
// open areaportal // open areaportal
if (ent->teammaster == ent || !ent->teammaster) { if (ent->teammaster == ent || !ent->teammaster) {
trap_AdjustAreaPortalState(ent, qtrue); trap_RQ3AdjustAreaPortalState(ent, qtrue, __LINE__, __FILE__);
} }
return; return;
} }
@ -1100,7 +1103,7 @@ void InitMover(gentity_t * ent)
ent->r.svFlags = SVF_USE_CURRENT_ORIGIN; ent->r.svFlags = SVF_USE_CURRENT_ORIGIN;
ent->s.eType = ET_MOVER; ent->s.eType = ET_MOVER;
VectorCopy(ent->pos1, ent->r.currentOrigin); VectorCopy(ent->pos1, ent->r.currentOrigin);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
ent->s.pos.trType = TR_STATIONARY; ent->s.pos.trType = TR_STATIONARY;
VectorCopy(ent->pos1, ent->s.pos.trBase); VectorCopy(ent->pos1, ent->s.pos.trBase);
@ -1327,7 +1330,7 @@ void Think_SpawnNewDoorTrigger(gentity_t * ent)
other->touch = Touch_DoorTrigger; other->touch = Touch_DoorTrigger;
// remember the thinnest axis // remember the thinnest axis
other->count = best; other->count = best;
trap_LinkEntity(other); trap_RQ3LinkEntity(other, __LINE__, __FILE__);
} }
//Makro - some doors shouldn't have triggers for spectators //Makro - some doors shouldn't have triggers for spectators
if (!ent->unbreakable) { if (!ent->unbreakable) {
@ -1355,7 +1358,7 @@ void Think_SpawnNewDoorTrigger(gentity_t * ent)
other->touch = Touch_DoorTriggerSpectator; other->touch = Touch_DoorTriggerSpectator;
// remember the thinnest axis // remember the thinnest axis
other->count = best; other->count = best;
trap_LinkEntity(other); trap_RQ3LinkEntity(other, __LINE__, __FILE__);
} }
MatchTeam(ent, ent->moverState, level.time); MatchTeam(ent, ent->moverState, level.time);
@ -1514,7 +1517,7 @@ void SP_func_door(gentity_t * ent)
} }
//Elder: open areaportals for start_open doors //Elder: open areaportals for start_open doors
if ((ent->spawnflags & 1) == 1 && (ent->teammaster == ent || !ent->teammaster)) { if ((ent->spawnflags & 1) == 1 && (ent->teammaster == ent || !ent->teammaster)) {
trap_AdjustAreaPortalState(ent, qtrue); trap_RQ3AdjustAreaPortalState(ent, qtrue, __LINE__, __FILE__);
} }
} }
@ -1662,7 +1665,7 @@ void SP_func_door_rotating(gentity_t * ent)
//Makro - copied from func_door //Makro - copied from func_door
//Elder: open areaportals for start_open doors //Elder: open areaportals for start_open doors
if ((ent->spawnflags & 1) == 1 && (ent->teammaster == ent || !ent->teammaster)) { if ((ent->spawnflags & 1) == 1 && (ent->teammaster == ent || !ent->teammaster)) {
trap_AdjustAreaPortalState(ent, qtrue); trap_RQ3AdjustAreaPortalState(ent, qtrue, __LINE__, __FILE__);
} }
} }
@ -1725,7 +1728,7 @@ void InitRotator(gentity_t * ent)
ent->r.svFlags = SVF_USE_CURRENT_ORIGIN; ent->r.svFlags = SVF_USE_CURRENT_ORIGIN;
ent->s.eType = ET_MOVER; ent->s.eType = ET_MOVER;
VectorCopy(ent->pos1, ent->r.currentAngles); VectorCopy(ent->pos1, ent->r.currentAngles);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
ent->s.apos.trType = TR_STATIONARY; ent->s.apos.trType = TR_STATIONARY;
VectorCopy(ent->pos1, ent->s.apos.trBase); VectorCopy(ent->pos1, ent->s.apos.trBase);
@ -1829,7 +1832,7 @@ void SpawnPlatTrigger(gentity_t * ent)
VectorCopy(tmin, trigger->r.mins); VectorCopy(tmin, trigger->r.mins);
VectorCopy(tmax, trigger->r.maxs); VectorCopy(tmax, trigger->r.maxs);
trap_LinkEntity(trigger); trap_RQ3LinkEntity(trigger, __LINE__, __FILE__);
} }
/*QUAKED func_plat (0 .5 .8) ? /*QUAKED func_plat (0 .5 .8) ?
@ -2369,7 +2372,7 @@ void SP_func_rotating(gentity_t * ent)
VectorCopy(ent->s.pos.trBase, ent->r.currentOrigin); VectorCopy(ent->s.pos.trBase, ent->r.currentOrigin);
VectorCopy(ent->s.apos.trBase, ent->r.currentAngles); VectorCopy(ent->s.apos.trBase, ent->r.currentAngles);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
/* /*

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.11 2003/03/22 20:29:26 jbravo
// wrapping linkent and unlinkent calls
//
// Revision 1.10 2003/01/06 00:23:29 makro // Revision 1.10 2003/01/06 00:23:29 makro
// no message // no message
// //
@ -66,7 +69,7 @@ void Use_Target_Give(gentity_t * ent, gentity_t * other, gentity_t * activator)
// make sure it isn't going to respawn or show any events // make sure it isn't going to respawn or show any events
t->nextthink = 0; t->nextthink = 0;
trap_UnlinkEntity(t); trap_RQ3UnlinkEntity(t, __LINE__, __FILE__);
} }
} }
@ -267,7 +270,7 @@ void SP_target_speaker(gentity_t * ent)
// must link the entity so we get areas and clusters so // must link the entity so we get areas and clusters so
// the server can determine who to send updates to // the server can determine who to send updates to
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
//========================================================== //==========================================================
@ -302,7 +305,7 @@ void target_laser_think(gentity_t * self)
VectorCopy(tr.endpos, self->s.origin2); VectorCopy(tr.endpos, self->s.origin2);
trap_LinkEntity(self); trap_RQ3LinkEntity(self, __LINE__, __FILE__);
self->nextthink = level.time + FRAMETIME; self->nextthink = level.time + FRAMETIME;
} }
@ -315,7 +318,7 @@ void target_laser_on(gentity_t * self)
void target_laser_off(gentity_t * self) void target_laser_off(gentity_t * self)
{ {
trap_UnlinkEntity(self); trap_RQ3UnlinkEntity(self, __LINE__, __FILE__);
self->nextthink = 0; self->nextthink = 0;
} }

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.25 2003/03/22 20:29:26 jbravo
// wrapping linkent and unlinkent calls
//
// Revision 1.24 2002/07/22 06:32:27 niceass // Revision 1.24 2002/07/22 06:32:27 niceass
// cleaned up the powerup code // cleaned up the powerup code
// //
@ -157,7 +160,7 @@ void SP_trigger_multiple(gentity_t * ent)
ent->use = Use_Multi; ent->use = Use_Multi;
InitTrigger(ent); InitTrigger(ent);
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
/* /*
@ -299,7 +302,7 @@ void SP_trigger_push(gentity_t * self)
self->touch = trigger_push_touch; self->touch = trigger_push_touch;
self->think = AimAtTarget; self->think = AimAtTarget;
self->nextthink = level.time + FRAMETIME; self->nextthink = level.time + FRAMETIME;
trap_LinkEntity(self); trap_RQ3LinkEntity(self, __LINE__, __FILE__);
} }
void Use_target_push(gentity_t * self, gentity_t * other, gentity_t * activator) void Use_target_push(gentity_t * self, gentity_t * other, gentity_t * activator)
@ -418,7 +421,7 @@ void SP_trigger_teleport(gentity_t * self)
self->s.eType = ET_TELEPORT_TRIGGER; self->s.eType = ET_TELEPORT_TRIGGER;
self->touch = trigger_teleporter_touch; self->touch = trigger_teleporter_touch;
trap_LinkEntity(self); trap_RQ3LinkEntity(self, __LINE__, __FILE__);
} }
/* /*
@ -444,9 +447,9 @@ NO_PROTECTION *nothing* stops the damage
void hurt_use(gentity_t * self, gentity_t * other, gentity_t * activator) void hurt_use(gentity_t * self, gentity_t * other, gentity_t * activator)
{ {
if (self->r.linked) { if (self->r.linked) {
trap_UnlinkEntity(self); trap_RQ3UnlinkEntity(self, __LINE__, __FILE__);
} else { } else {
trap_LinkEntity(self); trap_RQ3LinkEntity(self, __LINE__, __FILE__);
} }
} }
@ -500,10 +503,10 @@ void SP_trigger_hurt(gentity_t * self)
// link in to the world if starting active // link in to the world if starting active
if (!(self->spawnflags & 1)) { if (!(self->spawnflags & 1)) {
trap_LinkEntity(self); trap_RQ3LinkEntity(self, __LINE__, __FILE__);
} else { } else {
//Makro - added //Makro - added
trap_UnlinkEntity(self); trap_RQ3UnlinkEntity(self, __LINE__, __FILE__);
} }
} }

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.2 2003/03/22 20:29:26 jbravo
// wrapping linkent and unlinkent calls
//
// Revision 1.1 2003/03/09 21:32:23 jbravo // Revision 1.1 2003/03/09 21:32:23 jbravo
// *** empty log message *** // *** empty log message ***
// //
@ -190,7 +193,7 @@ void G_TimeShiftClient(gentity_t * ent, int time, qboolean debug, gentity_t * de
trap_SendServerCommand(debugger - g_entities, msg); trap_SendServerCommand(debugger - g_entities, msg);
} }
// this will recalculate absmin and absmax // this will recalculate absmin and absmax
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} else { } else {
// we wrapped, so grab the earliest // we wrapped, so grab the earliest
VectorCopy(ent->client->history[k].currentOrigin, ent->r.currentOrigin); VectorCopy(ent->client->history[k].currentOrigin, ent->r.currentOrigin);
@ -198,7 +201,7 @@ void G_TimeShiftClient(gentity_t * ent, int time, qboolean debug, gentity_t * de
VectorCopy(ent->client->history[k].maxs, ent->r.maxs); VectorCopy(ent->client->history[k].maxs, ent->r.maxs);
// this will recalculate absmin and absmax // this will recalculate absmin and absmax
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
} else { } else {
// this only happens when the client is using a negative timenudge, because that // this only happens when the client is using a negative timenudge, because that
@ -297,7 +300,7 @@ void G_UnTimeShiftClient(gentity_t * ent)
ent->client->saved.leveltime = 0; ent->client->saved.leveltime = 0;
// this will recalculate absmin and absmax // this will recalculate absmin and absmax
trap_LinkEntity(ent); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
} }

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.20 2003/03/22 20:29:26 jbravo
// wrapping linkent and unlinkent calls
//
// Revision 1.19 2002/08/24 07:58:15 niceass // Revision 1.19 2002/08/24 07:58:15 niceass
// moved sanitizestring to g_util // moved sanitizestring to g_util
// //
@ -462,7 +465,7 @@ Marks the entity as free
void G_FreeEntity(gentity_t * ed) void G_FreeEntity(gentity_t * ed)
{ {
trap_UnlinkEntity(ed); // unlink from world trap_RQ3UnlinkEntity(ed, __LINE__, __FILE__); // unlink from world
if (ed->neverFree) { if (ed->neverFree) {
return; return;
@ -500,7 +503,7 @@ gentity_t *G_TempEntity(vec3_t origin, int event)
G_SetOrigin(e, snapped); G_SetOrigin(e, snapped);
// find cluster for PVS // find cluster for PVS
trap_LinkEntity(e); trap_RQ3LinkEntity(e, __LINE__, __FILE__);
return e; return e;
} }
@ -529,7 +532,7 @@ gentity_t *G_TempEntity2(vec3_t origin, int event, int eParm)
G_SetOrigin(e, snapped); G_SetOrigin(e, snapped);
// find cluster for PVS // find cluster for PVS
trap_LinkEntity(e); trap_RQ3LinkEntity(e, __LINE__, __FILE__);
return e; return e;
} }

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.87 2003/03/22 20:29:26 jbravo
// wrapping linkent and unlinkent calls
//
// Revision 1.86 2003/03/09 21:30:38 jbravo // Revision 1.86 2003/03/09 21:30:38 jbravo
// Adding unlagged. Still needs work. // Adding unlagged. Still needs work.
// //
@ -840,7 +843,7 @@ void weapon_railgun_fire(gentity_t * ent)
break; // we hit something solid enough to stop the beam break; // we hit something solid enough to stop the beam
} }
// unlink this entity, so the next trace will go past it // unlink this entity, so the next trace will go past it
trap_UnlinkEntity(traceEnt); trap_RQ3UnlinkEntity(traceEnt, __LINE__, __FILE__);
unlinkedEntities[unlinked] = traceEnt; unlinkedEntities[unlinked] = traceEnt;
unlinked++; unlinked++;
} while (unlinked < MAX_RAIL_HITS); } while (unlinked < MAX_RAIL_HITS);
@ -848,7 +851,7 @@ void weapon_railgun_fire(gentity_t * ent)
// link back in any entities we unlinked // link back in any entities we unlinked
for (i = 0; i < unlinked; i++) { for (i = 0; i < unlinked; i++) {
trap_LinkEntity(unlinkedEntities[i]); trap_RQ3LinkEntity(unlinkedEntities[i], __LINE__, __FILE__);
} }
// the final trace endpos will be the terminal point of the rail trail // the final trace endpos will be the terminal point of the rail trail
@ -1370,7 +1373,7 @@ void Weapon_SSG3000_Fire(gentity_t * ent)
if (hitBreakable == qfalse || if (hitBreakable == qfalse ||
OnSameTeam(traceEnt, ent) ) { OnSameTeam(traceEnt, ent) ) {
trap_UnlinkEntity(traceEnt); trap_RQ3UnlinkEntity(traceEnt, __LINE__, __FILE__);
unlinkedEntities[unlinked] = traceEnt; unlinkedEntities[unlinked] = traceEnt;
unlinked++; unlinked++;
} }
@ -1379,7 +1382,7 @@ void Weapon_SSG3000_Fire(gentity_t * ent)
// link back in any entities we unlinked // link back in any entities we unlinked
for (i = 0; i < unlinked; i++) { for (i = 0; i < unlinked; i++) {
trap_LinkEntity(unlinkedEntities[i]); trap_RQ3LinkEntity(unlinkedEntities[i], __LINE__, __FILE__);
} }
// snap the endpos to integers to save net bandwidth, but nudged towards the line // snap the endpos to integers to save net bandwidth, but nudged towards the line
@ -1885,7 +1888,7 @@ void Laser_Think(gentity_t * self)
//Did you not hit anything? //Did you not hit anything?
if (tr.surfaceFlags & SURF_NOIMPACT || tr.surfaceFlags & SURF_SKY) { if (tr.surfaceFlags & SURF_NOIMPACT || tr.surfaceFlags & SURF_SKY) {
self->nextthink = level.time + 10; self->nextthink = level.time + 10;
trap_UnlinkEntity(self); trap_RQ3UnlinkEntity(self, __LINE__, __FILE__);
return; return;
} }
@ -1905,7 +1908,7 @@ void Laser_Think(gentity_t * self)
vectoangles(tr.plane.normal, self->s.angles); vectoangles(tr.plane.normal, self->s.angles);
trap_LinkEntity(self); trap_RQ3LinkEntity(self, __LINE__, __FILE__);
//Prep next move //Prep next move
self->nextthink = level.time + 10; self->nextthink = level.time + 10;