]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
better verifying
authorRudolf Polzer <divverent@xonotic.org>
Sat, 19 Nov 2011 15:29:58 +0000 (16:29 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Sat, 19 Nov 2011 15:29:58 +0000 (16:29 +0100)
qcsrc/server/w_tuba.qc

index 1e47a3b3d1b36a512a910b793a02fc04be498de4..9019866dc31cb6080f283ee9304cda22b30de578 100644 (file)
@@ -22,11 +22,13 @@ float W_Tuba_HasPlayed(entity pl, string melody)
        {
                vector v = pl.(tuba_lastnotes[mod(pl.tuba_lastnotes_last - i + MAX_TUBANOTES, MAX_TUBANOTES)]);
                float ai = stof(argv(n - i - 1));
+               float np = floor(ai);
+               float nl = ((ai == np) ? 0 : (1 / (ai - np)));
                // n counts the last played notes BACKWARDS
                // _x is start
                // _y is end
                // _z is note pitch
-               if(v_z != floor(ai))
+               if(v_z != np)
                        return FALSE;
                // FIXME verify rhythm
        }