Skip to content

Commit f2d6cb8

Browse files
gunslingermodXottab-DUTY
authored andcommitted
[Bugfix] Corrected zooming in/out command handler
If you bind zoom in/out commands to keys and then try to use zoom, you will find that zooming works incorrectly. Game would switch 2 zoomsteps per 1 keypress. It happens because the handler changes zoomstep twice: when you press the key and when you release it. Fix makes zoomstep changing only when key is pressed, not released.
1 parent b4c412f commit f2d6cb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/xrGame/Weapon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ bool CWeapon::Action(u16 cmd, u32 flags)
968968

969969
case kWPN_ZOOM_INC:
970970
case kWPN_ZOOM_DEC:
971-
if (IsZoomEnabled() && IsZoomed())
971+
if (IsZoomEnabled() && IsZoomed() && (flags&CMD_START) )
972972
{
973973
if (cmd == kWPN_ZOOM_INC)
974974
ZoomInc();

0 commit comments

Comments
 (0)