Changeset - r12019:7fabc7bfef6d
[Not reviewed]
master
0 1 0
yexo - 15 years ago 2009-05-26 12:53:34
yexo@openttd.org
(svn r16431) -Fix (16429): Company settings can also be changed in multiplayer games
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/settings_gui.cpp
Show inline comments
 
@@ -1010,13 +1010,13 @@ void SettingEntry::DrawSetting(GameSetti
 
	const SettingDescBase *sdb = &sd->desc;
 
	const void *var = ResolveVariableAddress(settings_ptr, sd);
 
	bool editable = true;
 
	bool disabled = false;
 

	
 
	/* We do not allow changes of some items when we are a client in a networkgame */
 
	if (!(sd->save.conv & SLF_NETWORK_NO) && _networking && !_network_server) editable = false;
 
	if (!(sd->save.conv & SLF_NETWORK_NO) && _networking && !_network_server && !(sdb->flags & SGF_PER_COMPANY)) editable = false;
 
	if ((sdb->flags & SGF_NETWORK_ONLY) && !_networking) editable = false;
 
	if ((sdb->flags & SGF_NO_NETWORK) && _networking) editable = false;
 

	
 
	if (sdb->cmd == SDT_BOOLX) {
 
		static const Colours _bool_ctabs[2][2] = {{COLOUR_CREAM, COLOUR_RED}, {COLOUR_DARK_GREEN, COLOUR_GREEN}};
 
		/* Draw checkbox for boolean-value either on/off */
 
@@ -1443,13 +1443,13 @@ struct GameSettingsWindow : Window {
 
		}
 

	
 
		assert((pe->flags & SEF_KIND_MASK) == SEF_SETTING_KIND);
 
		const SettingDesc *sd = pe->d.entry.setting;
 

	
 
		/* return if action is only active in network, or only settable by server */
 
		if (!(sd->save.conv & SLF_NETWORK_NO) && _networking && !_network_server) return;
 
		if (!(sd->save.conv & SLF_NETWORK_NO) && _networking && !_network_server && !(sd->desc.flags & SGF_PER_COMPANY)) return;
 
		if ((sd->desc.flags & SGF_NETWORK_ONLY) && !_networking) return;
 
		if ((sd->desc.flags & SGF_NO_NETWORK) && _networking) return;
 

	
 
		const void *var = ResolveVariableAddress(settings_ptr, sd);
 
		int32 value = (int32)ReadValue(var, sd->save.conv);
 

	
0 comments (0 inline, 0 general)