• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Leak! Please help!

Status
Not open for further replies.
Level 2
Joined
Oct 13, 2018
Messages
7
Guys, where is leak in this code?

Posting GUY -> JASS cuz my editor is in Russian.

function Trig_LocCamLock_JASS_Func001Func004Func003C takes nothing returns boolean
if ( not ( IsPlayerInForce(GetOwningPlayer(GetEnumUnit()), udg_Inventory_Players) == false ) ) then
return false
endif
return true
endfunction

function Trig_LocCamLock_JASS_Func001Func004A takes nothing returns nothing
// Убираем из КамераПлеерс для лока камеры
call ForceRemovePlayerSimple( GetOwningPlayer(GetEnumUnit()), udg_CameraAnglePlayers )
if ( Trig_LocCamLock_JASS_Func001Func004Func003C() ) then
call CameraSetupApplyForPlayer( true, udg_rg_camlocking_cam[GetForLoopIndexA()], GetOwningPlayer(GetEnumUnit()), 0 )
else
endif
endfunction

function Trig_LocCamLock_JASS_Actions takes nothing returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 500
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
// Устанавливаем Отряд [Массив] = Юниты в областях [Массив]
set udg_locations_system_unit_camgroup[GetForLoopIndexA()] = GetUnitsInRectAll(udg_rg_camlocking[GetForLoopIndexA()])
// Берем каждого юнита из Отрядов [Массив]
call ForGroupBJ( udg_locations_system_unit_camgroup[GetForLoopIndexA()], function Trig_LocCamLock_JASS_Func001Func004A )
call DestroyGroup( udg_locations_system_unit_camgroup[GetForLoopIndexA()] )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction

//===========================================================================
function InitTrig_LocCamLock_JASS takes nothing returns nothing
set gg_trg_LocCamLock_JASS = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_LocCamLock_JASS, 0.05 )
call TriggerAddAction( gg_trg_LocCamLock_JASS, function Trig_LocCamLock_JASS_Actions )
endfunction

Russian GUI version:

NQL15JO7vkQ.jpg
 
Level 2
Joined
Oct 13, 2018
Messages
7
Function GetUnitsInRectAll called by GetUnitsInRectAll was leaking.

Solved by following: (sry for rus lang)

sB2NXbv4ksI.jpg
 
Last edited:
Status
Not open for further replies.
Top