Fixed a bug which made the function always return false, fixes #1348

Signed-off-by: Roman Schmerold (BNoiZe) <bnoize@froxlor.org>