Try to catch some NaNs that are almost certainly a compiler optimization bug.

Fixes Bugzilla #2998.
This commit is contained in:
Ryan C. Gordon 2009-09-14 23:01:49 +00:00
parent b096ca1d04
commit ce544b23e6
1 changed files with 8 additions and 0 deletions

View File

@ -211,6 +211,14 @@ void RE_AddRefEntityToScene( const refEntity_t *ent ) {
if ( r_numentities >= MAX_ENTITIES ) {
return;
}
if ( Q_isnan(ent->origin[0]) || Q_isnan(ent->origin[1]) || Q_isnan(ent->origin[2]) ) {
static qboolean first_time = qtrue;
if (first_time) {
first_time = qfalse;
Com_Printf(S_COLOR_YELLOW "WARNING: You might have built ioquake3 with a buggy compiler!\n");
}
return;
}
if ( ent->reType < 0 || ent->reType >= RT_MAX_REF_ENTITY_TYPE ) {
ri.Error( ERR_DROP, "RE_AddRefEntityToScene: bad reType %i", ent->reType );
}