]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
chnage "negative zero" check to actually check the bit pattern of IEEE negative zeros...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 24 Aug 2009 05:41:33 +0000 (05:41 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 24 Aug 2009 05:41:33 +0000 (05:41 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9141 d7cf8633-e32d-0410-b094-e92efae38249

prvm_execprogram.h

index 97bf15d729d5838ca67b65f9fd82a0547be1f09b..f29299d21a599619f2436e0061a97a726a346abf 100644 (file)
                //==================
 
                        case OP_IFNOT:
-                               if (!OPA->_float)
-                               // TODO add an "int-ifnot"
+                               if (!(OPA->_int & 0x7FFFFFFF)) // also match "negative zero" floats of value 0x80000000
+                               // TODO add an "int-if", and change this one to OPA->_float
                                // although mostly unneeded, thanks to the only float being false being 0x0 and 0x80000000 (negative zero)
                                // and entity, string, field values can never have that value
                                {
                                break;
 
                        case OP_IF:
-                               if (OPA->_float)
-                               // TODO add an "int-if"
+                               if (!(OPA->_int & 0x7FFFFFFF)) // also match "negative zero" floats of value 0x80000000
+                               // TODO add an "int-if", and change this one to OPA->_float
                                // although mostly unneeded, thanks to the only float being false being 0x0 and 0x80000000 (negative zero)
                                // and entity, string, field values can never have that value
                                {