fixed wrong flag check
Merge pull request #527 from giastfader/engine

fixed wrong flag check