* Check whether the setting is editable in the current gamemode. * @param do_command true if this is about checking a command from the server. * @return true if editable. */
| 892 | * @return true if editable. |
| 893 | */ |
| 894 | bool SettingDesc::IsEditable(bool do_command) const |
| 895 | { |
| 896 | if (!do_command && !this->flags.Test(SettingFlag::NoNetworkSync) && _networking && !_network_server && !this->flags.Test(SettingFlag::PerCompany)) return false; |
| 897 | if (do_command && this->flags.Test(SettingFlag::NoNetworkSync)) return false; |
| 898 | if (this->flags.Test(SettingFlag::NetworkOnly) && !_networking && _game_mode != GM_MENU) return false; |
| 899 | if (this->flags.Test(SettingFlag::NoNetwork) && _networking) return false; |
| 900 | if (this->flags.Test(SettingFlag::NewgameOnly) && |
| 901 | (_game_mode == GM_NORMAL || |
| 902 | (_game_mode == GM_EDITOR && !this->flags.Test(SettingFlag::SceneditToo)))) return false; |
| 903 | if (this->flags.Test(SettingFlag::SceneditOnly) && _game_mode != GM_EDITOR) return false; |
| 904 | return true; |
| 905 | } |
| 906 | |
| 907 | /** |
| 908 | * Return the type of the setting. |
no test coverage detected