function Get_LocalPlayer takes nothing returns nothing
call ShowUnitHide(GetTriggerUnit())
if GetLocalPlayer() == Player(0) then
call ShowUnit(GetTriggerUnit())
endif
endfunction
PurplePoot said:Diablo, funnily enough, that causes a desynch when the unit dies, not when it's created, if it has the same damage, life, etc (though the model, name, and scale can change)
(and the owner of the killer/dier won't get desynched)
if (GetLocalPlayer() == whichPlayer) then
// Use only local code (no net traffic) within this block to avoid desyncs.
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
function PanCameraToLocForPlayer takes player whichPlayer, location loc returns nothing
if (GetLocalPlayer() == whichPlayer) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call PanCameraTo(GetLocationX(loc), GetLocationY(loc))
endif
endfunction
I do, but it isn't those who cause the desync. They create an location with GetCameraTargetPositionLoc.Notice the global variables.