89555459_ners___Pokémon_Essentials_Wiki__What_it_means
[Comment] EndIfSwitch: 42 [What it means] 
If the Global Switch with this number is ON, the battle is treated as already over. Typically used for trainers in a Pokémon Gym, which are deactivated after beating the Leader, regardless of whether they have been battled themselves.
Trainers - Pokémon Essentials Wiki
What it means