aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoricculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea>2009-09-14 23:01:49 +0000
committericculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea>2009-09-14 23:01:49 +0000
commitfe9edcfad4560857fad76f69ce17f9f7c1c87958 (patch)
tree6acf0900fa676689d160ced538852ce722b9bb14
parent83165ea05edee6ed7ee33f951e90bfbdadb977f8 (diff)
downloadioquake3-aero-fe9edcfad4560857fad76f69ce17f9f7c1c87958.tar.gz
ioquake3-aero-fe9edcfad4560857fad76f69ce17f9f7c1c87958.zip
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
-rw-r--r--code/renderer/tr_scene.c8
1 files changed, 8 insertions, 0 deletions
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 );
}