Need an expert to solve a problem involving desynchronization.

Azlier

Old World Ghost
Reaction score
461
Pan camera as necessary uses GetLocalPlayer(), and incorrectly at that. I don't know why your map is desync central.

JASS:
function SmartCameraPanBJ takes player whichPlayer, location loc, real duration returns nothing
    local real dist
    if (GetLocalPlayer() == whichPlayer) then
        // Use only local code (no net traffic) within this block to avoid desyncs.

        set dist = DistanceBetweenPoints(loc, GetCameraTargetPositionLoc())
        if (dist >= bj_SMARTPAN_TRESHOLD_SNAP) then
            // If the user is too far away, snap the camera.
            call PanCameraToTimed(GetLocationX(loc), GetLocationY(loc), 0)
        elseif (dist >= bj_SMARTPAN_TRESHOLD_PAN) then
            // If the user is moderately close, pan the camera.
            call PanCameraToTimed(GetLocationX(loc), GetLocationY(loc), duration)
        else
            // User is close enough, so don't touch the camera.
        endif
    endif
endfunction
 

Jesus4Lyf

Good Idea™
Reaction score
397
Trigger:
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: if GetLocalPlayer() == Player(15) then
      • Item - Create Tome of Experience at (Center of (Playable map area))
      • Custom script: endif

I'm pretty sure that does nothing rather than desynch. :p
My assumption is that GetLocalPlayer won't ever be Player(15) (Neutral Passve?). XD
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top