Probably there is another easy or correct way to do it, but if you use c_trace you can use scan_texture and retrieve the tex_name string of the object texture and then check that information to remove or bounce the bullet.
Just an idea.