As far as I know, setting SCAN_TEXTURE only fills the hit struct with texture information. The struct itself can still be used (only texture information is unavailable). In my code I only use hit->entity, which points to the target entity.