EMI: Precompute the vector of enabled lights and the hasAmbient flag.
EMI: Fixed compatibility with older savegames.