When a weapon runs out of ammo, it will automatically switch to another weapon when the boolean is 1. This property is 0 by default, i.e. the weapon does not change. It is set to 1 in BF 1942 for grenades, landmines, and exppacks, i.e. when you run out of these, you switch to your main weapon.
Source and more details