From ce544b23e69b59757d1fe5031cb6be8b637c66b8 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 14 Sep 2009 23:01:49 +0000 Subject: [PATCH] Try to catch some NaNs that are almost certainly a compiler optimization bug. Fixes Bugzilla #2998. --- code/renderer/tr_scene.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/renderer/tr_scene.c b/code/renderer/tr_scene.c index 4802bcb1..dc76e0e9 100644 --- a/code/renderer/tr_scene.c +++ b/code/renderer/tr_scene.c @@ -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 ); }