From fe9edcfad4560857fad76f69ce17f9f7c1c87958 Mon Sep 17 00:00:00 2001 From: icculus Date: Mon, 14 Sep 2009 23:01:49 +0000 Subject: Try to catch some NaNs that are almost certainly a compiler optimization bug. Fixes Bugzilla #2998. git-svn-id: svn://svn.icculus.org/quake3/trunk@1595 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/renderer/tr_scene.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'code') diff --git a/code/renderer/tr_scene.c b/code/renderer/tr_scene.c index 4802bcb..dc76e0e 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 ); } -- cgit v1.2.3