about summary refs log tree commit diff
path: root/src/game/client/components/menus_settings.cpp
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-09-12 17:15:09 +0200
committeroy <Tom_Adams@web.de>2010-09-12 17:15:09 +0200
commitc52ee7baa9b4bf5845b2eeff63b4f6b713341c86 (patch)
tree6bb7f41b05f9566bc29b6874d5b6a17baf641799 /src/game/client/components/menus_settings.cpp
parent901427809fe6aeee7b3b820f5447f59955269ff9 (diff)
downloadzcatch-c52ee7baa9b4bf5845b2eeff63b4f6b713341c86.tar.gz
zcatch-c52ee7baa9b4bf5845b2eeff63b4f6b713341c86.zip
unbind a key with right mouse button in the controls menu. Closes #67
Diffstat (limited to 'src/game/client/components/menus_settings.cpp')
-rw-r--r--src/game/client/components/menus_settings.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp
index c7ecbf2f..b4c82c63 100644
--- a/src/game/client/components/menus_settings.cpp
+++ b/src/game/client/components/menus_settings.cpp
@@ -337,8 +337,10 @@ void CMenus::UiDoGetButtons(int Start, int Stop, CUIRect View)
 		int NewId = DoKeyReader((void *)&gs_aKeys[i].m_Name, &Button, OldId);
 		if(NewId != OldId)
 		{
-			m_pClient->m_pBinds->Bind(OldId, "");
-			m_pClient->m_pBinds->Bind(NewId, gs_aKeys[i].m_pCommand);
+			if(OldId != 0 || NewId == 0)
+				m_pClient->m_pBinds->Bind(OldId, "");
+			if(NewId != 0)
+				m_pClient->m_pBinds->Bind(NewId, gs_aKeys[i].m_pCommand);
 		}
 		View.HSplitTop(5.0f, 0, &View);
 	}