From 4c859d1acd176e664eaf1cc154a878611a81b5a1 Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Thu, 14 Jul 2011 18:37:19 +0000 Subject: [PATCH] Getting rid of the trap_RQ3UnlinkEntity debug function --- reaction/code/game/g_active.c | 2 +- reaction/code/game/g_client.c | 12 ++++++------ reaction/code/game/g_combat.c | 4 ++-- reaction/code/game/g_local.h | 1 - reaction/code/game/g_main.c | 23 +---------------------- reaction/code/game/g_misc.c | 6 +++--- reaction/code/game/g_mover.c | 2 +- reaction/code/game/g_target.c | 4 ++-- reaction/code/game/g_teamplay.c | 2 +- reaction/code/game/g_trigger.c | 8 ++++---- reaction/code/game/g_utils.c | 4 ++-- reaction/code/game/g_weapon.c | 6 +++--- 12 files changed, 26 insertions(+), 48 deletions(-) diff --git a/reaction/code/game/g_active.c b/reaction/code/game/g_active.c index 7f187226..9debafb9 100644 --- a/reaction/code/game/g_active.c +++ b/reaction/code/game/g_active.c @@ -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) diff --git a/reaction/code/game/g_client.c b/reaction/code/game/g_client.c index 58e46a89..e070f39d 100644 --- a/reaction/code/game/g_client.c +++ b/reaction/code/game/g_client.c @@ -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"; diff --git a/reaction/code/game/g_combat.c b/reaction/code/game/g_combat.c index df42cbbe..9fc3d48b 100644 --- a/reaction/code/game/g_combat.c +++ b/reaction/code/game/g_combat.c @@ -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 diff --git a/reaction/code/game/g_local.h b/reaction/code/game/g_local.h index 5357cf4a..831f307f 100644 --- a/reaction/code/game/g_local.h +++ b/reaction/code/game/g_local.h @@ -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 diff --git a/reaction/code/game/g_main.c b/reaction/code/game/g_main.c index 3b999f9c..d826bea9 100644 --- a/reaction/code/game/g_main.c +++ b/reaction/code/game/g_main.c @@ -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 diff --git a/reaction/code/game/g_misc.c b/reaction/code/game/g_misc.c index d3c3c4bb..f826e950 100644 --- a/reaction/code/game/g_misc.c +++ b/reaction/code/game/g_misc.c @@ -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 diff --git a/reaction/code/game/g_mover.c b/reaction/code/game/g_mover.c index 05aa942e..9d6f8bae 100644 --- a/reaction/code/game/g_mover.c +++ b/reaction/code/game/g_mover.c @@ -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); diff --git a/reaction/code/game/g_target.c b/reaction/code/game/g_target.c index eb7dbef5..1e9c43a6 100644 --- a/reaction/code/game/g_target.c +++ b/reaction/code/game/g_target.c @@ -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; } diff --git a/reaction/code/game/g_teamplay.c b/reaction/code/game/g_teamplay.c index f88a3a72..8f8dfe34 100644 --- a/reaction/code/game/g_teamplay.c +++ b/reaction/code/game/g_teamplay.c @@ -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) diff --git a/reaction/code/game/g_trigger.c b/reaction/code/game/g_trigger.c index 3041fbb8..8925fc60 100644 --- a/reaction/code/game/g_trigger.c +++ b/reaction/code/game/g_trigger.c @@ -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); } } diff --git a/reaction/code/game/g_utils.c b/reaction/code/game/g_utils.c index ab7f4665..6d568eec 100644 --- a/reaction/code/game/g_utils.c +++ b/reaction/code/game/g_utils.c @@ -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; diff --git a/reaction/code/game/g_weapon.c b/reaction/code/game/g_weapon.c index 240bb080..24f0353d 100644 --- a/reaction/code/game/g_weapon.c +++ b/reaction/code/game/g_weapon.c @@ -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; }