Getting rid of the trap_RQ3LinkEntity debug function

This commit is contained in:
Richard Allen 2011-07-14 18:29:55 +00:00
parent cd32356114
commit 9022235d4b
17 changed files with 67 additions and 96 deletions

View file

@ -1257,7 +1257,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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
if (!ent->client->noclip) { if (!ent->client->noclip) {
G_TouchTriggers(ent); G_TouchTriggers(ent);
} }

View file

@ -162,7 +162,7 @@ static gentity_t *SpawnModelOnVictoryPad(gentity_t * pad, vec3_t offset, gentity
G_SetOrigin(body, vec); G_SetOrigin(body, vec);
trap_RQ3LinkEntity(body, __LINE__, __FILE__); trap_LinkEntity(body);
body->count = place; body->count = place;
@ -283,7 +283,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_RQ3LinkEntity(podium, __LINE__, __FILE__); trap_LinkEntity(podium);
podium->think = PodiumPlacementThink; podium->think = PodiumPlacementThink;
podium->nextthink = level.time + 100; podium->nextthink = level.time + 100;

View file

@ -814,7 +814,7 @@ void CopyToBodyQue(gentity_t * ent)
} }
VectorCopy(body->s.pos.trBase, body->r.currentOrigin); VectorCopy(body->s.pos.trBase, body->r.currentOrigin);
trap_RQ3LinkEntity(body, __LINE__, __FILE__); trap_LinkEntity(body);
} }
//====================================================================== //======================================================================
@ -1798,7 +1798,7 @@ void ClientSpawn(gentity_t * ent)
} else { } else {
G_KillBox(ent); G_KillBox(ent);
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
// force the base weapon up // force the base weapon up
//Blaze: Changed WP_MACHINEGUN to WP_PISTOL //Blaze: Changed WP_MACHINEGUN to WP_PISTOL
@ -1893,7 +1893,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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
// 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

View file

@ -1658,7 +1658,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_RQ3LinkEntity(self, __LINE__, __FILE__); trap_LinkEntity(self);
} }
/* /*

View file

@ -496,7 +496,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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
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
@ -767,7 +767,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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
//====================================================================== //======================================================================
@ -872,7 +872,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_RQ3LinkEntity(dropped, __LINE__, __FILE__); trap_LinkEntity(dropped);
return dropped; return dropped;
} }
@ -1027,7 +1027,7 @@ void FinishSpawningItem(gentity_t * ent)
return; return;
} }
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
qboolean itemRegistered[MAX_ITEMS]; qboolean itemRegistered[MAX_ITEMS];
@ -1071,7 +1071,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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
// NiceAss: Find the blue flag // NiceAss: Find the blue flag
@ -1088,7 +1088,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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
} }
} }
@ -1374,7 +1374,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_RQ3LinkEntity(ent, __LINE__, __FILE__); // FIXME: avoid this for stationary? trap_LinkEntity(ent); // FIXME: avoid this for stationary?
// check think function // check think function
G_RunThink(ent); G_RunThink(ent);

View file

@ -1305,7 +1305,6 @@ void QDECL G_Error(const char *fmt, ...);
void RQ3_StartUniqueItems(void); void RQ3_StartUniqueItems(void);
// JBravo: added // JBravo: added
void trap_RQ3LinkEntity(gentity_t *ent, int line, char *file);
void trap_RQ3UnlinkEntity(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); void trap_RQ3AdjustAreaPortalState(gentity_t *ent, qboolean open, int line, char *file);

View file

@ -829,35 +829,6 @@ 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) {
trap_SendServerCommand(-1, va("print \"^1trap_LinkEntity 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_LinkEntity 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_LinkEntity 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_LinkEntity 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_LinkEntity 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_LinkEntity 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_LinkEntity 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_LinkEntity 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_LinkEntity got called with s.number outof range from line %d of file %s. PLEASE report this to the RQ3 team\n", line, file);
}
trap_LinkEntity(ent);
}
void trap_RQ3UnlinkEntity(gentity_t *ent, int line, char *file) void trap_RQ3UnlinkEntity(gentity_t *ent, int line, char *file)
{ {
if (ent == NULL) { if (ent == NULL) {
@ -1230,7 +1201,7 @@ void G_InitMoveParents( void )
//this is so cgame knows which entity is the moveparent //this is so cgame knows which entity is the moveparent
ent->s.time2 = ent->moveParent_ent - g_entities; ent->s.time2 = ent->moveParent_ent - g_entities;
if (ent->r.linked) if (ent->r.linked)
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
break; break;
} }
} }
@ -2822,7 +2793,7 @@ void G_RunAttachedEnt(gentity_t *ent)
VectorCopy(ent->moveParent_ent->r.currentOrigin, ent->s.origin2); VectorCopy(ent->moveParent_ent->r.currentOrigin, ent->s.origin2);
} }
if (ent->r.linked) if (ent->r.linked)
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
/* /*

View file

@ -461,14 +461,14 @@ void SP_dlight(gentity_t * ent)
VectorCopy(ent->s.origin, ent->s.pos.trBase); VectorCopy(ent->s.origin, ent->s.pos.trBase);
ent->s.eType = ET_DLIGHT; ent->s.eType = ET_DLIGHT;
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
/* /*
// Nothing significant to do // Nothing significant to do
void G_RunDlight(gentity_t * ent) void G_RunDlight(gentity_t * ent)
{ {
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
*/ */
@ -592,7 +592,7 @@ void SP_func_shadow(gentity_t *ent)
trap_SetConfigstring(CS_SHADOWS, info); trap_SetConfigstring(CS_SHADOWS, info);
ent->s.eType = ET_SHADOW; ent->s.eType = ET_SHADOW;
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
@ -600,7 +600,7 @@ void SP_misc_corona(gentity_t *ent)
{ {
ent->s.eType = ET_CORONA; ent->s.eType = ET_CORONA;
//ent->r.svFlags = SVF_NOCLIENT; //ent->r.svFlags = SVF_NOCLIENT;
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
@ -657,7 +657,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_RQ3LinkEntity(player, __LINE__, __FILE__); trap_LinkEntity(player);
} }
} }
@ -682,7 +682,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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
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);
@ -757,7 +757,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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
ent->r.svFlags = SVF_PORTAL; ent->r.svFlags = SVF_PORTAL;
ent->s.eType = ET_PORTAL; ent->s.eType = ET_PORTAL;
@ -798,7 +798,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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
G_SpawnFloat("roll", "0", &roll); G_SpawnFloat("roll", "0", &roll);
@ -864,7 +864,7 @@ void SP_misc_sky_portal(gentity_t * ent)
ent->think = Think_SetupSkyPortal; ent->think = Think_SetupSkyPortal;
ent->nextthink = level.time + FRAMETIME; ent->nextthink = level.time + FRAMETIME;
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
/* /*
@ -941,7 +941,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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
/*QUAKED shooter_rocket (1 0 0) (-16 -16 -16) (16 16 16) /*QUAKED shooter_rocket (1 0 0) (-16 -16 -16) (16 16 16)
@ -1051,7 +1051,7 @@ If you wish to add a custom breakable to your map, please include your mapname (
void reset_breakable(gentity_t *ent) void reset_breakable(gentity_t *ent)
{ {
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
ent->exploded = qfalse; ent->exploded = qfalse;
ent->takedamage = qtrue; ent->takedamage = qtrue;
@ -1274,7 +1274,7 @@ void SP_func_breakable(gentity_t * ent)
//ent->think = Think_SpawnNewDoorTrigger; //ent->think = Think_SpawnNewDoorTrigger;
ent->r.svFlags |= SVF_USE_CURRENT_ORIGIN; ent->r.svFlags |= SVF_USE_CURRENT_ORIGIN;
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
@ -1435,7 +1435,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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
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

@ -140,7 +140,7 @@ void G_ExplodeMissile(gentity_t * ent)
} }
//Elder: huhh? //Elder: huhh?
//G_Printf("exploding knife\n"); //G_Printf("exploding knife\n");
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
/* /*
@ -231,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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
trap_RQ3LinkEntity(nent, __LINE__, __FILE__); trap_LinkEntity(nent);
return; return;
} }
@ -351,7 +351,7 @@ void G_MissileImpact(gentity_t * ent, trace_t * trace)
} }
} }
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
/* /*
@ -387,7 +387,7 @@ void G_RunMissile(gentity_t * ent)
VectorCopy(tr.endpos, ent->r.currentOrigin); VectorCopy(tr.endpos, ent->r.currentOrigin);
} }
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
if (tr.fraction != 1) { if (tr.fraction != 1) {
// never explode or bounce on sky // never explode or bounce on sky

View file

@ -368,7 +368,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_RQ3LinkEntity(check, __LINE__, __FILE__); trap_LinkEntity(check);
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
@ -438,7 +438,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_RQ3LinkEntity(check, __LINE__, __FILE__); trap_LinkEntity(check);
} }
return ret; return ret;
} }
@ -508,7 +508,7 @@ qboolean G_MoverPush(gentity_t * pusher, vec3_t move, vec3_t amove, gentity_t **
// 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_RQ3LinkEntity(pusher, __LINE__, __FILE__); trap_LinkEntity(pusher);
// 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++) {
@ -581,7 +581,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_RQ3LinkEntity (p->ent, __LINE__, __FILE__); // trap_LinkEntity (p->ent);
} }
// return qfalse; // return qfalse;
continue; continue;
@ -605,7 +605,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_RQ3LinkEntity(p->ent, __LINE__, __FILE__); trap_LinkEntity(p->ent);
} }
return qfalse; return qfalse;
} }
@ -652,7 +652,7 @@ void G_MoverTeam(gentity_t * ent)
G_EvaluateTrajectoryEx(part, level.time, part->r.currentOrigin, part->r.currentAngles); G_EvaluateTrajectoryEx(part, level.time, part->r.currentOrigin, part->r.currentAngles);
//Makro - set blocked flag so that clients don't predict movement for this frame //Makro - set blocked flag so that clients don't predict movement for this frame
part->s.eFlags |= EF_MOVER_BLOCKED; part->s.eFlags |= EF_MOVER_BLOCKED;
trap_RQ3LinkEntity(part, __LINE__, __FILE__); trap_LinkEntity(part);
} }
// if the pusher has a "blocked" function, call it // if the pusher has a "blocked" function, call it
@ -784,7 +784,7 @@ void SetMoverState(gentity_t * ent, moverState_t moverState, int time)
//G_EvaluateTrajectory(&ent->s.apos, level.time, ent->r.currentAngles); //G_EvaluateTrajectory(&ent->s.apos, level.time, ent->r.currentAngles);
G_EvaluateTrajectoryEx(ent, level.time, ent->r.currentOrigin, ent->r.currentAngles); G_EvaluateTrajectoryEx(ent, level.time, ent->r.currentOrigin, ent->r.currentAngles);
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
/* /*
@ -1263,7 +1263,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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
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);
@ -1510,7 +1510,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_RQ3LinkEntity(other, __LINE__, __FILE__); trap_LinkEntity(other);
} }
//Makro - some doors shouldn't have triggers for spectators //Makro - some doors shouldn't have triggers for spectators
if (!ent->explosive) { if (!ent->explosive) {
@ -1538,7 +1538,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_RQ3LinkEntity(other, __LINE__, __FILE__); trap_LinkEntity(other);
} }
MatchTeam(ent, ent->moverState, level.time); MatchTeam(ent, ent->moverState, level.time);
@ -1965,7 +1965,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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
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);
@ -2069,7 +2069,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_RQ3LinkEntity(trigger, __LINE__, __FILE__); trap_LinkEntity(trigger);
} }
/*QUAKED func_plat (0 .5 .8) ? /*QUAKED func_plat (0 .5 .8) ?
@ -2661,7 +2661,7 @@ void SP_func_static(gentity_t * ent)
ent->use = use_func_static; ent->use = use_func_static;
ent->reset = reset_func_static; ent->reset = reset_func_static;
ent->reset(ent); ent->reset(ent);
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
/* /*
@ -2709,7 +2709,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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
/* /*

View file

@ -317,7 +317,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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
//========================================================== //==========================================================
@ -352,7 +352,7 @@ void target_laser_think(gentity_t * self)
VectorCopy(tr.endpos, self->s.origin2); VectorCopy(tr.endpos, self->s.origin2);
trap_RQ3LinkEntity(self, __LINE__, __FILE__); trap_LinkEntity(self);
self->nextthink = level.time + FRAMETIME; self->nextthink = level.time + FRAMETIME;
} }

View file

@ -1047,7 +1047,7 @@ void SpawnPlayers()
ent = &g_entities[i]; ent = &g_entities[i];
if (ent != NULL && ent->classname != NULL && !strcmp(ent->classname, "func_breakable")) { if (ent != NULL && ent->classname != NULL && !strcmp(ent->classname, "func_breakable")) {
//re-link all unlinked breakables //re-link all unlinked breakables
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
ent->exploded = qfalse; ent->exploded = qfalse;
ent->takedamage = qtrue; ent->takedamage = qtrue;

View file

@ -237,7 +237,7 @@ void SP_trigger_multiple(gentity_t * ent)
ent->reset = Reset_Multi; ent->reset = Reset_Multi;
InitTrigger(ent); InitTrigger(ent);
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
/* /*
@ -260,7 +260,7 @@ void trigger_always_think(gentity_t * ent)
//Makro - reset function //Makro - reset function
void trigger_always_reset(gentity_t *ent) void trigger_always_reset(gentity_t *ent)
{ {
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
ent->nextthink = level.time + 300; ent->nextthink = level.time + 300;
ent->think = trigger_always_think; ent->think = trigger_always_think;
} }
@ -392,7 +392,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_RQ3LinkEntity(self, __LINE__, __FILE__); trap_LinkEntity(self);
} }
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)
@ -511,7 +511,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_RQ3LinkEntity(self, __LINE__, __FILE__); trap_LinkEntity(self);
} }
/* /*
@ -539,7 +539,7 @@ void hurt_reset(gentity_t *ent)
{ {
ent->timestamp = level.time; ent->timestamp = level.time;
if (!(ent->spawnflags & 1)) { if (!(ent->spawnflags & 1)) {
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} else { } else {
//Makro - added //Makro - added
trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__); trap_RQ3UnlinkEntity(ent, __LINE__, __FILE__);
@ -551,7 +551,7 @@ void hurt_use(gentity_t * self, gentity_t * other, gentity_t * activator)
if (self->r.linked) { if (self->r.linked) {
trap_RQ3UnlinkEntity(self, __LINE__, __FILE__); trap_RQ3UnlinkEntity(self, __LINE__, __FILE__);
} else { } else {
trap_RQ3LinkEntity(self, __LINE__, __FILE__); trap_LinkEntity(self);
} }
} }
@ -615,7 +615,7 @@ 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_RQ3LinkEntity(self, __LINE__, __FILE__); trap_LinkEntity(self);
} else { } else {
//Makro - added //Makro - added
trap_RQ3UnlinkEntity(self, __LINE__, __FILE__); trap_RQ3UnlinkEntity(self, __LINE__, __FILE__);

View file

@ -197,7 +197,7 @@ Move a client back to where he was at the specified "time"
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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} 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);
@ -205,7 +205,7 @@ Move a client back to where he was at the specified "time"
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_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
} 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
@ -304,7 +304,7 @@ Move a client back to where he was before the time shift
ent->client->saved.leveltime = 0; ent->client->saved.leveltime = 0;
// this will recalculate absmin and absmax // this will recalculate absmin and absmax
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_LinkEntity(ent);
} }
} */ } */

View file

@ -649,7 +649,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_RQ3LinkEntity(e, __LINE__, __FILE__); trap_LinkEntity(e);
return e; return e;
} }
@ -678,7 +678,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_RQ3LinkEntity(e, __LINE__, __FILE__); trap_LinkEntity(e);
return e; return e;
} }

View file

@ -889,7 +889,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_RQ3LinkEntity(unlinkedEntities[i], __LINE__, __FILE__); trap_LinkEntity(unlinkedEntities[i]);
} }
// 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
@ -1431,7 +1431,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_RQ3LinkEntity(unlinkedEntities[i], __LINE__, __FILE__); trap_LinkEntity(unlinkedEntities[i]);
} }
// 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
@ -1967,7 +1967,7 @@ void Laser_Think(gentity_t * self)
vectoangles(tr.plane.normal, self->s.angles); vectoangles(tr.plane.normal, self->s.angles);
trap_RQ3LinkEntity(self, __LINE__, __FILE__); trap_LinkEntity(self);
//Prep next move //Prep next move
self->nextthink = level.time + 10; self->nextthink = level.time + 10;

View file

@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
export ARCH=x86
export CC=i686-pc-mingw32-gcc export CC=i686-pc-mingw32-gcc
export WINDRES=i686-pc-mingw32-windres export WINDRES=i686-pc-mingw32-windres
export PLATFORM=mingw32 export PLATFORM=mingw32