stop steering wheel from moving when steering with mouse

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7814 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: c0e44d064efb1adb8edc7313f33eef0c3e2036a3
Former-commit-id: 03b960771459ecdcead9e9be0fe7d7dc1c6e7636
This commit is contained in:
iobyte 2021-12-12 21:51:54 +00:00
parent 543df0330d
commit 51fa75318c

View file

@ -812,7 +812,7 @@ void HumanDriver::resume_race(int index, tCarElt* car, tSituation *s)
#if SDL_FORCEFEEDBACK
//restore force feedback effect to the wheel (if was set)
if(HCtx[idx]->lastForceFeedbackLevel) {
if(cmd[CMD_LEFTSTEER].type != GFCTRL_TYPE_KEYBOARD){
if(cmd[CMD_LEFTSTEER].type != GFCTRL_TYPE_KEYBOARD && cmd[CMD_LEFTSTEER].type != GFCTRL_TYPE_MOUSE_AXIS){
HCtx[idx]->lastForceFeedbackIndex = int((cmd[CMD_LEFTSTEER].val) / GFCTRL_JOY_NUMBER);
gfctrlJoyConstantForce(
HCtx[idx]->lastForceFeedbackIndex,
@ -1225,7 +1225,7 @@ static void common_drive(const int index, tCarElt* car, tSituation *s)
//send force feedback effect to the wheel
//dont' even try to do it if steer command is on a keyboard because it somehow manage to crash (unable to identify the joystic to send FF to?)
if(cmd[CMD_LEFTSTEER].type != GFCTRL_TYPE_KEYBOARD){
if(cmd[CMD_LEFTSTEER].type != GFCTRL_TYPE_KEYBOARD && cmd[CMD_LEFTSTEER].type != GFCTRL_TYPE_MOUSE_AXIS){
// v<- this controller detenction does not make ->v
// v<- sense to me ->v
HCtx[idx]->lastForceFeedbackIndex = int((cmd[CMD_LEFTSTEER].val) / GFCTRL_JOY_NUMBER);