The `CreateProjectile` doxycomment says "returns <0 on failure", so you should compare for negative, not for -1.