jg18's patch -- don't do irrelevant stuff when we're only querying for flags
see http://www.hard-light.net/forums/index.php?topic=83315.0

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9493 387891d4-d844-0410-90c0-e4c51a9137d3