Skip to content

Commit

Permalink
[Bugfix] Corrected zooming in/out command handler
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gunslingermod authored and Xottab-DUTY committed Aug 14, 2017
1 parent b4c412f commit f2d6cb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/xrGame/Weapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ bool CWeapon::Action(u16 cmd, u32 flags)

case kWPN_ZOOM_INC:
case kWPN_ZOOM_DEC:
if (IsZoomEnabled() && IsZoomed())
if (IsZoomEnabled() && IsZoomed() && (flags&CMD_START) )
{
if (cmd == kWPN_ZOOM_INC)
ZoomInc();
Expand Down

0 comments on commit f2d6cb8

Please sign in to comment.