Skip to content

Commit

Permalink
Fixed:1軸Ctrler車両操作時にBrakeが正常に解除されないBug
Browse files Browse the repository at this point in the history
  • Loading branch information
TetsuOtter committed May 26, 2019
1 parent d9a4bc8 commit 51c0db3
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions BIDSSMemLib/InputDevice.bve5.cs
Expand Up @@ -32,17 +32,27 @@ public void Configure(IWin32Window owner)

public void Load(string settingsPath) => ci = new CtrlInput();

public void SetAxisRanges(int[][] ranges) { }
bool IsOneHandle = false;
public void SetAxisRanges(int[][] ranges) => IsOneHandle = ranges[3][0] < 0 && 0 < ranges[3][1];

public void Tick()
{
Hand hd = ci?.GetHandD() ?? new Hand();
bool[] kd = ci?.GetIsKeyPushed() ?? new bool[CtrlInput.KeyArrSizeMax];
if (!Equals(h, hd))
{
if (h.R != hd.R) LM(Axis.Reverser, hd.R);
if (h.P != hd.P) LM(Axis.Power, hd.P);
if (h.B != hd.B) LM(Axis.Brake, hd.B);
LM(Axis.Reverser, hd.R);
if (IsOneHandle)
{
int Pos = -hd.B;
if (Pos == 0) Pos = hd.P;
LM(Axis.SHandle, Pos);
}
else
{
LM(Axis.Power, hd.P);
LM(Axis.Brake, hd.B);
}
h = hd;
}
for (int i = 0; i < 20; i++)
Expand Down

0 comments on commit 51c0db3

Please sign in to comment.