Compare commits

...

3 commits

Author SHA1 Message Date
gamerbross
c4d18d3fc9
Merge 1107c1e160 into 55c2dabe84 2024-10-16 05:20:55 -04:00
gamerbross
1107c1e160 fix formatting :trollface: 2024-05-12 15:57:51 +02:00
gamerbross
8ca227c219 Fix Incorrect playerId use 2024-05-12 15:56:28 +02:00

View file

@ -861,9 +861,9 @@ class Save
switch (inputType)
{
case Keys:
return (playerId == 0) ? data?.options?.controls?.p1.keyboard : data?.options?.controls?.p2.keyboard;
return (playerId == 1) ? data?.options?.controls?.p1.keyboard : data?.options?.controls?.p2.keyboard;
case Gamepad(_):
return (playerId == 0) ? data?.options?.controls?.p1.gamepad : data?.options?.controls?.p2.gamepad;
return (playerId == 1) ? data?.options?.controls?.p1.gamepad : data?.options?.controls?.p2.gamepad;
}
}
@ -878,27 +878,7 @@ class Save
public function setControls(playerId:Int, inputType:Device, controls:SaveControlsData):Void
{
switch (inputType)
{
case Keys:
if (playerId == 0)
{
data.options.controls.p1.keyboard = controls;
}
else
{
data.options.controls.p2.keyboard = controls;
}
case Gamepad(_):
if (playerId == 0)
{
data.options.controls.p1.gamepad = controls;
}
else
{
data.options.controls.p2.gamepad = controls;
}
}
getControls(playerId, inputType) = controls;
flush();
}