Don't stop Naija when the joystick goes to neutral. achurch-control-tweaks
authorAndrew Church <achurch@achurch.org>
Sat, 16 Apr 2011 00:00:00 +0900
branchachurch-control-tweaks
changeset 140 6c2e9611bf2b
parent 139 86743ba66f94
child 141 bf96717e5aff
Don't stop Naija when the joystick goes to neutral. When using joystick or keyboard control for swimming, returning the joystick to neutral or releasing the "Swim Up/Down/Left/Right" keys formerly caused Naija to immediately stop moving. This patch makes Naija instead continue moving under inertia (as when the mouse button is released while swimming), allowing the same fluid swimming control as is possible using a mouse. It's still possible to stop Naija immediately by pressing the Primary Action (or left mouse button equivalent) control.
Aquaria/Avatar.cpp
--- a/Aquaria/Avatar.cpp	Sat Apr 16 00:00:00 2011 +0900
+++ b/Aquaria/Avatar.cpp	Sat Apr 16 00:00:00 2011 +0900
@@ -8567,7 +8567,11 @@
 					else
 					{
 						// stop movement
-						if (addVec.isLength2DIn(STOP_DISTANCE))
+						// For joystick/keyboard control, don't stop unless
+						// the Swim (primary action) button is pressed with
+						// no movement input.  --achurch
+						if ((dsq->inputMode == INPUT_MOUSE || isActing(ACTION_PRIMARY))
+							&& addVec.isLength2DIn(STOP_DISTANCE))
 						{
 							vel *= 0.9f;
 							if (!rolling)