shithub: battleship

Download patch

ref: 48fe28aa56b83af341957b472c023a667639776c
parent: 651db54ad2917ea0e055b74047201ef0b6022e63
author: rodri <rgl@antares-labs.eu>
date: Fri Sep 15 18:15:25 EDT 2023

fix mouse button handling.

--- a/bts.c
+++ b/bts.c
@@ -645,18 +645,18 @@
 		else
 			csetcursor(mctl, nil);
 
-	switch(mc->buttons){
-	case 1:
-		lmb(mc);
-		break;
-	case 2:
-		if(oldm.buttons != 2)
+	if(oldm.buttons != mc->buttons)
+		switch(mc->buttons){
+		case 1:
+			lmb(mc);
+			break;
+		case 2:
 			mmb(mc);
-		break;
-	case 4:
-		rmb(mc);
-		break;
-	}
+			break;
+		case 4:
+			rmb(mc);
+			break;
+		}
 
 	oldm = mc->Mouse;
 }