Skip to content

Commit

Permalink
Prevent desyncs with zoom function #224
Browse files Browse the repository at this point in the history
  • Loading branch information
SMUnlimited committed Jan 17, 2024
1 parent 38687e2 commit cc014a6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Blizzard.eai
Original file line number Diff line number Diff line change
Expand Up @@ -608,15 +608,17 @@ function InitZoom takes nothing returns nothing
call TriggerAddAction(ZoomSetx, function ZoomSet)
call TriggerAddAction(AdjustZoomUp , function ZoomUp)
call TriggerAddAction(AdjustZoomDown , function ZoomDown)
if (legacyCamera) then
set theCam = GetCurrentCameraSetup()
set current_zoom = CameraSetupGetFieldSwap(CAMERA_FIELD_TARGET_DISTANCE, theCam)
set theCam = null
endif
loop
exitwhen i >= GetBJMaxPlayers()
if (GetPlayerController(Player(i)) != MAP_CONTROL_COMPUTER) then
call DisplayTimedTextToPlayer(Player(i),0,0,7,"Set Zoom type: |c00d5f038-zoom1850|r")
call TriggerRegisterPlayerChatEvent( ZoomSetx, Player(i), "-zoom", false )
if (legacyCamera) then // Only required for legacy versions as no camera support built into the game
set theCam = GetCurrentCameraSetup()
set current_zoom = CameraSetupGetFieldSwap(CAMERA_FIELD_TARGET_DISTANCE, theCam)
set theCam = null
call TriggerRegisterPlayerKeyEventBJ( AdjustZoomUp, Player(i), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_UP )
call TriggerRegisterPlayerKeyEventBJ( AdjustZoomDown, Player(i), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_DOWN )
if IsPlayerObserver(Player(i)) then
Expand Down

0 comments on commit cc014a6

Please sign in to comment.