Getting rid of the trap_RQ3UnlinkEntity debug function

This commit is contained in:
Richard Allen 2011-07-14 18:37:19 +00:00
parent 9022235d4b
commit 4c859d1acd
12 changed files with 26 additions and 48 deletions

View file

@ -560,7 +560,7 @@ void SpectatorThink(gentity_t * ent, usercmd_t * ucmd)
VectorCopy(client->ps.origin, ent->s.origin);
G_TouchTriggers(ent);
trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
trap_UnlinkEntity(ent);
}
// JBravo: Lets not allow bots to use any specmode other than FREE
if (ent->r.svFlags & SVF_BOT)

View file

@ -694,7 +694,7 @@ void ClearBodyQue(void)
level.bodyQueIndex = 0;
for (i = 0; i < BODY_QUEUE_SIZE; i++) {
ent = level.bodyQue[i];
trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
trap_UnlinkEntity(ent);
ent->physicsObject = qfalse;
}
}
@ -714,7 +714,7 @@ void BodySink(gentity_t * ent)
if (level.time - ent->timestamp > 6500) {
// the body ques are never actually freed, they are just unlinked
trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
trap_UnlinkEntity(ent);
ent->physicsObject = qfalse;
return;
}
@ -735,7 +735,7 @@ void CopyToBodyQue(gentity_t * ent)
gentity_t *body;
int contents;
trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
trap_UnlinkEntity(ent);
// if client is in a nodrop area, don't leave the body
contents = trap_PointContents(ent->s.origin, -1);
@ -746,7 +746,7 @@ void CopyToBodyQue(gentity_t * ent)
body = level.bodyQue[level.bodyQueIndex];
level.bodyQueIndex = (level.bodyQueIndex + 1) % BODY_QUEUE_SIZE;
trap_RQ3UnlinkEntity(body, __LINE__, __FILE__);
trap_UnlinkEntity(body);
body->s = ent->s;
@ -1417,7 +1417,7 @@ void ClientBegin(int clientNum)
client = level.clients + clientNum;
if (ent->r.linked) {
trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
trap_UnlinkEntity(ent);
}
G_InitGentity(ent);
@ -2038,7 +2038,7 @@ void ClientDisconnect(int clientNum)
ClientUserinfoChanged(level.sortedClients[0]);
}
trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
trap_UnlinkEntity(ent);
ent->s.modelindex = 0;
ent->inuse = qfalse;
ent->classname = "disconnected";

View file

@ -1595,14 +1595,14 @@ void player_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, i
//GibEntity (self, killer);
G_TempEntity(self->r.currentOrigin, EV_GIB_PLAYER);
self->client->gibbed = qtrue;
trap_RQ3UnlinkEntity(self, __LINE__, __FILE__);
trap_UnlinkEntity(self);
}
} else if (meansOfDeath == MOD_HANDCANNON && g_RQ3_gib.integer > 1 && self->health <= -15) {
self->client->noHead = qfalse;
//GibEntity (self, killer);
G_TempEntity(self->r.currentOrigin, EV_GIB_PLAYER);
self->client->gibbed = qtrue;
trap_RQ3UnlinkEntity(self, __LINE__, __FILE__);
trap_UnlinkEntity(self);
}
}
// never gib in a nodrop

View file

@ -1305,7 +1305,6 @@ void QDECL G_Error(const char *fmt, ...);
void RQ3_StartUniqueItems(void);
// JBravo: added
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

View file

@ -829,27 +829,6 @@ void QDECL G_Error(const char *fmt, ...)
trap_Error(text);
}
void trap_RQ3UnlinkEntity(gentity_t *ent, int line, char *file)
{
if (ent == NULL) {
trap_SendServerCommand(-1, va("print \"^1trap_UnlinkEntity got called with a NULL ent from line %d of file %s. PLEASE report this to the RQ3 team\n\"", line, file));
G_Printf("^1trap_UnlinkEntity got called with a NULL ent from line %d of file %s. PLEASE report this to the RQ3 team\n", line, file);
G_LogPrintf("trap_UnlinkEntity got called with a NULL ent from line %d of file %s. PLEASE report this to the RQ3 team\n", line, file);
}
if (ent-g_entities < 0 || ent-g_entities > level.num_entities) {
trap_SendServerCommand(-1, va("print \"^1trap_UnlinkEntity got called with a unaligned ent from line %d of file %s. PLEASE report this to the RQ3 team\n\"", line, file));
G_Printf("^1trap_UnlinkEntity got called with a unaligned ent from line %d of file %s. PLEASE report this to the RQ3 team\n", line, file);
G_LogPrintf("trap_UnlinkEntity got called with a unaligned ent from line %d of file %s. PLEASE report this to the RQ3 team\n", line, file);
}
if (ent->s.number <0 || ent->s.number > level.num_entities) {
trap_SendServerCommand(-1, va("print \"^1trap_UnlinkEntity got called with s.number outof range from line %d of file %s. PLEASE report this to the RQ3 team\n\"", line, file));
G_Printf("^1trap_UnlinkEntity got called with s.number outof range from line %d of file %s. PLEASE report this to the RQ3 team\n", line, file);
G_LogPrintf("trap_UnlinkEntity got called with s.number outof range from line %d of file %s. PLEASE report this to the RQ3 team\n", line, file);
}
trap_UnlinkEntity(ent);
}
void trap_RQ3AdjustAreaPortalState(gentity_t *ent, qboolean open, int line, char *file)
{
if (ent == NULL) {
@ -2854,7 +2833,7 @@ void G_RunFrame(int levelTime)
} else if (ent->unlinkAfterEvent) {
// items that will respawn will hide themselves after their pickup event
ent->unlinkAfterEvent = qfalse;
trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
trap_UnlinkEntity(ent);
}
}
// temporary entities don't think

View file

@ -626,7 +626,7 @@ void TeleportPlayer(gentity_t * player, vec3_t origin, vec3_t angles)
tent->s.clientNum = player->s.clientNum;
}
// unlink to make sure it can't possibly interfere with G_KillBox
trap_RQ3UnlinkEntity(player, __LINE__, __FILE__);
trap_UnlinkEntity(player);
VectorCopy(origin, player->client->ps.origin);
player->client->ps.origin[2] += 1;
@ -996,7 +996,7 @@ void func_breakable_die(gentity_t * self, gentity_t * inflictor, gentity_t * att
if (self->damage > 0 && self->damage_radius > 0)
G_RadiusDamage(impactPoint, attacker, self->damage, self->damage_radius, self, meansOfDeath);
// radius damage
trap_RQ3UnlinkEntity(self, __LINE__, __FILE__);
trap_UnlinkEntity(self);
}
@ -1377,7 +1377,7 @@ void G_BreakGlass(gentity_t * ent, gentity_t * inflictor, gentity_t * attacker,
//tent = G_TempEntity( center, EV_BREAK_GLASS );
//tent->s.eventParm = eParm;
//unlink it instead of freeing
trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
trap_UnlinkEntity(ent);
} else if (ent->chippable) {
//Stil has some life left, so chip it

View file

@ -501,7 +501,7 @@ 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
trap_RQ3UnlinkEntity(pusher, __LINE__, __FILE__);
trap_UnlinkEntity(pusher);
listedEntities = trap_EntitiesInBox(totalMins, totalMaxs, entityList, MAX_GENTITIES);

View file

@ -81,7 +81,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
t->nextthink = 0;
trap_RQ3UnlinkEntity(t, __LINE__, __FILE__);
trap_UnlinkEntity(t);
}
}
@ -365,7 +365,7 @@ void target_laser_on(gentity_t * self)
void target_laser_off(gentity_t * self)
{
trap_RQ3UnlinkEntity(self, __LINE__, __FILE__);
trap_UnlinkEntity(self);
self->nextthink = 0;
}

View file

@ -1506,7 +1506,7 @@ void MakeSpectator(gentity_t * ent)
}
ClientSpawn(ent);
ent->client->gibbed = qtrue;
trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
trap_UnlinkEntity(ent);
return;
}
if (ent->r.svFlags & SVF_BOT)

View file

@ -254,7 +254,7 @@ void trigger_always_think(gentity_t * ent)
//Makro - we want to be able to re-use this entity (round-based gametypes)
//so we're not going to free it
//G_FreeEntity(ent, __LINE__, __FILE__);
trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
trap_UnlinkEntity(ent);
}
//Makro - reset function
@ -542,14 +542,14 @@ void hurt_reset(gentity_t *ent)
trap_LinkEntity(ent);
} else {
//Makro - added
trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
trap_UnlinkEntity(ent);
}
}
void hurt_use(gentity_t * self, gentity_t * other, gentity_t * activator)
{
if (self->r.linked) {
trap_RQ3UnlinkEntity(self, __LINE__, __FILE__);
trap_UnlinkEntity(self);
} else {
trap_LinkEntity(self);
}
@ -618,7 +618,7 @@ void SP_trigger_hurt(gentity_t * self)
trap_LinkEntity(self);
} else {
//Makro - added
trap_RQ3UnlinkEntity(self, __LINE__, __FILE__);
trap_UnlinkEntity(self);
}
}

View file

@ -591,7 +591,7 @@ void G_FreeEntity(gentity_t * ed, int line, char *file)
return;
}
trap_RQ3UnlinkEntity(ed, __LINE__, __FILE__); // unlink from world
trap_UnlinkEntity(ed); // unlink from world
if (ed->neverFree) {
return;
@ -611,7 +611,7 @@ void G_RealFreeEntity(gentity_t * ed)
return;
}
trap_RQ3UnlinkEntity(ed, __LINE__, __FILE__); // unlink from world
trap_UnlinkEntity(ed); // unlink from world
if (ed->neverFree) {
return;

View file

@ -881,7 +881,7 @@ void weapon_railgun_fire(gentity_t * ent)
break; // we hit something solid enough to stop the beam
}
// unlink this entity, so the next trace will go past it
trap_RQ3UnlinkEntity(traceEnt, __LINE__, __FILE__);
trap_UnlinkEntity(traceEnt);
unlinkedEntities[unlinked] = traceEnt;
unlinked++;
} while (unlinked < MAX_RAIL_HITS);
@ -1422,7 +1422,7 @@ void Weapon_SSG3000_Fire(gentity_t * ent)
if (hitBreakable == qfalse ||
OnSameTeam(traceEnt, ent) ) {
trap_RQ3UnlinkEntity(traceEnt, __LINE__, __FILE__);
trap_UnlinkEntity(traceEnt);
unlinkedEntities[unlinked] = traceEnt;
unlinked++;
}
@ -1947,7 +1947,7 @@ void Laser_Think(gentity_t * self)
//Did you not hit anything?
if (tr.surfaceFlags & SURF_NOIMPACT || tr.surfaceFlags & SURF_SKY) {
self->nextthink = level.time + 10;
trap_RQ3UnlinkEntity(self, __LINE__, __FILE__);
trap_UnlinkEntity(self);
return;
}