about summary refs log tree commit diff
path: root/src/engine/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/client')
-rw-r--r--src/engine/client/ui.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/engine/client/ui.cpp b/src/engine/client/ui.cpp
index 3353feca..0f42e435 100644
--- a/src/engine/client/ui.cpp
+++ b/src/engine/client/ui.cpp
@@ -97,12 +97,19 @@ int ui_do_button(void *id, const char *text, int checked, float x, float y, floa
 			ui_set_active_item(id);
 	}
 
+	// this gets rid of an annoying bug :<
+	if (!inside && ui_active_item() == id && !ui_mouse_button(0))
+		ui_set_active_item(0);
+
 	if(ui_active_item() == id && ui_hot_item() == id && !ui_mouse_button(0))
 	{
 		ui_set_active_item(0);
 		r = 1;
 	}
 
+	if (!inside && ui_hot_item() == id)
+		ui_set_hot_item(0);
+
     draw_func(id, text, checked, x, y, w, h, extra);
 
     return r;