Good day!
The problem with the script, tried every possible way to solve it.
Take a look
P.S // L_TMP - paraynoya
P.S // L_TMP - paraynoya
// udg_PlayableMapArea - predefined rect
It works fine, but causes a memory leak. 120 mb, 200, 300, 400, crash...
I've tried everything, a memory leak continues.
The problem with the script, tried every possible way to solve it.
Take a look
JASS:
function Trig_WoodCreateTest_Actions takes nothing returns nothing
local real L_Tree_X = 0.0
local real L_Tree_Y = 0.0
local real L_TreeFacing = 0.0
local destructable L_TMP = null
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 100000
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set L_Tree_X = GetRandomReal(GetRectMinX(udg_PlayableMapArea), GetRectMaxX(udg_PlayableMapArea))
set L_Tree_Y = GetRandomReal(GetRectMinY(udg_PlayableMapArea), GetRectMaxY(udg_PlayableMapArea))
set L_TreeFacing = GetRandomReal(0, 360)
set L_TMP = CreateDestructable('LTlt', L_Tree_X, L_Tree_Y, L_TreeFacing, 1, 0)
set L_TMP = null
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_WoodCreateTest takes nothing returns nothing
set gg_trg_WoodCreateTest = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_WoodCreateTest, 2.00 )
call TriggerRegisterPlayerChatEvent( gg_trg_WoodCreateTest, Player(0), "create", true )
call TriggerAddAction( gg_trg_WoodCreateTest, function Trig_WoodCreateTest_Actions )
endfunction
P.S // L_TMP - paraynoya
JASS:
function Trig_WoodDie_Func002A takes nothing returns nothing
local destructable L_TMP = null
set L_TMP = GetEnumDestructable()
call RemoveDestructable(L_TMP)
set L_TMP = null
endfunction
function Trig_WoodDie_Actions takes nothing returns nothing
call EnumDestructablesInRectAll( udg_PlayableMapArea, function Trig_WoodDie_Func002A )
endfunction
//===========================================================================
function InitTrig_WoodDie takes nothing returns nothing
set gg_trg_WoodDie = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_WoodDie, 1.50 )
call TriggerAddAction( gg_trg_WoodDie, function Trig_WoodDie_Actions )
endfunction
P.S // L_TMP - paraynoya
// udg_PlayableMapArea - predefined rect
It works fine, but causes a memory leak. 120 mb, 200, 300, 400, crash...
I've tried everything, a memory leak continues.