A gun is a terrible close quarters weapon. A gun is so good at long range that you can typically ensure you never get into a close quarters fight, but once it becomes close quarters you want something else. (with a gun you do have to keep the muzzle pointed away from you - but one hit with the bat will damage the barrel enough that it isn't safe to fire)