Refactor check_set_mode()

Duplicate "if/else" if statements removed, use one switch() at the end.
Hope that makes the code easier.
1 file changed