Merged 15170:15635 from trunk (no conflicts or even merges)
[blender.git] / source / blender / nodes / intern / CMP_nodes / CMP_math.c
index e317998b5fc92c2471b323d5296e367f30a85d9e..421c1343df744d7cd286ab6afb7a360ac279248d 100644 (file)
@@ -57,7 +57,7 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
                break; 
        case 3: /* Divide */
                {
-                       if(in[1]==0)    /* We don't want to divide by zero. */
+                       if(in2[0]==0)   /* We don't want to divide by zero. */
                                out[0]= 0.0;
                        else
                                out[0]= in[0] / in2[0];
@@ -131,7 +131,23 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
                {
                                out[0]= (int)(in[0] + 0.5f);
                }
-               break; 
+               break;
+       case 15: /* Less Than */
+               {
+                       if( in[0] < in2[0] )
+                               out[0]= 1.0f;
+                       else
+                               out[0]= 0.0f;
+               }
+               break;
+       case 16: /* Greater Than */
+               {
+                       if( in[0] > in2[0] )
+                               out[0]= 1.0f;
+                       else
+                               out[0]= 0.0f;
+               }
+               break;
        }
 }