mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 09:15:29 +01:00 
			
		
		
		
	Touchscreen: Fix virtual joystick sometimes going backwards
This fixes a regression introduced by 34286d77c7 / #14075.
			
			
This commit is contained in:
		@@ -237,7 +237,9 @@ float RealInputHandler::getMovementDirection()
 | 
			
		||||
 | 
			
		||||
	if (x != 0 || z != 0) /* If there is a keyboard event, it takes priority */
 | 
			
		||||
		return std::atan2(x, z);
 | 
			
		||||
	else if (g_touchscreengui && g_touchscreengui->getMovementDirection())
 | 
			
		||||
	// `getMovementDirection() == 0` means forward, so we cannot use
 | 
			
		||||
	// `getMovementDirection()` as a condition.
 | 
			
		||||
	else if (g_touchscreengui && g_touchscreengui->getMovementSpeed())
 | 
			
		||||
		return g_touchscreengui->getMovementDirection();
 | 
			
		||||
	return joystick.getMovementDirection();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user