Fixed minor Coverity issue (CID 1446646)

This commit is contained in:
tomcw 2020-11-21 17:05:02 +00:00
parent d6a2339ff0
commit 8fbf09d1c7

View File

@ -507,7 +507,7 @@ static void DoAutofire(UINT uButton, BOOL& pressed)
BOOL nowPressed = pressed; BOOL nowPressed = pressed;
if (sg_PropertySheet.GetAutofire(uButton) && pressed) if (sg_PropertySheet.GetAutofire(uButton) && pressed)
{ {
toggle[uButton] = (!lastPressed[uButton]) ? TRUE : toggle[uButton] = !toggle[uButton]; toggle[uButton] = (!lastPressed[uButton]) ? TRUE : !toggle[uButton];
pressed = pressed && toggle[uButton]; pressed = pressed && toggle[uButton];
} }
lastPressed[uButton] = nowPressed; lastPressed[uButton] = nowPressed;