- Joined
- Jul 1, 2008
- Messages
- 1,314
Hey guys,
Thanks for taking the time to read through this.
Well, so basically I am trying to create a custom EnumDestructable Function - which evoids creating a location each time, because I am calling it every 0.3 seconds.
First, here are blizzards functions to do this:
This is my Own Code to mimic this BJs (which is as I said basically everything, they did but without a location).
The action function and condition function are exactly the same in BJs and my own enum function, so I really do not get, where the problem is

Could you maybe point out, what I might have missed?
Problem in short:
I am grateful for any help
Good evening, everyone!
Thanks for taking the time to read through this.
Well, so basically I am trying to create a custom EnumDestructable Function - which evoids creating a location each time, because I am calling it every 0.3 seconds.
First, here are blizzards functions to do this:
JASS:
function GetRectFromCircleBJ takes location center, real radius returns rect
local real centerX = GetLocationX(center)
local real centerY = GetLocationY(center)
return Rect(centerX - radius, centerY - radius, centerX + radius, centerY + radius)
endfunction
function EnumDestructablesInCircleBJ takes real radius, location loc, code actionFunc returns nothing
local rect r
if (radius >= 0) then
set bj_enumDestructableCenter = loc
set bj_enumDestructableRadius = radius
set r = GetRectFromCircleBJ(loc, radius)
call EnumDestructablesInRect(r, filterEnumDestructablesInCircleBJ, actionFunc)
call RemoveRect(r)
endif
endfunction
This is my Own Code to mimic this BJs (which is as I said basically everything, they did but without a location).
JASS:
function DestructableConditions takes destructable Temp returns boolean
// My conditions
endfunction
function HM_DestructableCloseUpCameraDecision takes nothing returns nothing
local destructable Temp = GetEnumDestructable()
local integer playerId = udg_KAMERA_TempInteger
if DestructableConditions(Temp) == false then
// if no tree, do nothing
else
// set camera for playerId
endif
set Temp = null
endfunction
function HM_DestructableManager takes real radius, integer playerId, real centerX, real centerY returns nothing
local rect r = Rect(centerX - radius, centerY - radius, centerX + radius, centerY + radius)
set udg_KAMERA_TempInteger = playerId
// preset camera and enum destructables
call EnumDestructablesInRect(r, null, function HM_DestructableCloseUpCameraDecision)
// Remove Leaks
call RemoveRect( r)
set r = null
endfunction
The action function and condition function are exactly the same in BJs and my own enum function, so I really do not get, where the problem is


Could you maybe point out, what I might have missed?
Problem in short:
JASS:
What happens, when I come closer to a desired destructable:
A) BJ FUNCTION: CAMERA CHANGES
B) MY OWN FUNCTION: NO REACTION
I am grateful for any help
Good evening, everyone!