Собственно вопрос простой. Удаляется ли в данной функции texttag или он остается в памяти и вызывает утечку? Или нужно потом удалять его через таймер самому?
    function colored_txt_xy takes string msg, real time, real spd, real x, real y, real z, integer r, integer g, integer b, real size, player p  returns nothing
        local texttag txt = CreateTextTag()
        call SetTextTagText ( txt, msg, size * 0.023 / 10)
        call SetTextTagPos ( txt, x, y, z )
        call SetTextTagColor ( txt, r, g, b, 100 )
        
        call SetTextTagVelocityBJ( txt, spd, 90.00 )
        call SetTextTagPermanent( txt, false )
        call SetTextTagLifespan( txt, time )
        call SetTextTagFadepoint( txt, 0.0 )
        if ( p != null) then
            call ShowTextTagForceBJ ( false, txt, GetPlayersAll () )
            call ShowTextTagForceBJ ( true, txt, GetForceOfPlayer ( p ) )
        endif
        set txt = null
    endfunction

вопрос простой, а поиск сложный
`
ОЖИДАНИЕ РЕКЛАМЫ...

Показан только небольшой набор комментариев вокруг указанного. Перейти к актуальным.
22
а не делай 100 текстаг а оптимизируй например для атаки с таймером что могут одновремено 4 наносить и вы не увидите что в ней и сколько но соединять с промежутке урона 0.03 времени думаю меньше станет и многое...
18
HandleCounter, нашел на xgm
//===========================================================================
//    A simple handle counter that shows:
//          * Maximum handles reached
//          * Elapsed seconds
//
//========== FOR VERSION 1.24+ ONLY ==========
//
//    The leaderboard can be accessed with
//          HandleCounter_LEADERBOARD
//    The clock (timer) can be accessed with
//          HandleCounter_CLOCK
//
//    This could be useful only if you'd like to see
//    if your map is leaking a lot of handles.
//    Otherwise it isn't really needed.
//
//    Requires a vJASS compiler to work.
//
//    To use: 
//          Create a trigger named HandleCounter,
//          convert to custom script and paste this.
//===========================================================================
library HandleCounter initializer Init
//===========================================================================
// Configurables
//===========================================================================
globals
// Leaderboard title/name.
    private constant string TITLE = "Handle Counter"
// Text that represents the time.
    private constant string TIME_TEXT = "Elapsed Time:"
// Should the leaderboard show time as well? True or false.
    private constant boolean SHOW_TIME = true
// How often should the handle count update (of course this is not for the clock).
    private constant real UPDATE_PERIOD = 0.25
// Number of locations created for better counting result.
    private constant integer STACK_END_TRESHOLD = 15
// Player(0) = Player 1 (Red); Player(1) = Player 2 (Blue); etc.

// Player color of the maximum handles text.
    private constant player MAX = Player(0)
// Player color of the time text.
    private constant player TIME = Player(1)
endglobals
//===========================================================================
// Do not edit bellow this point unless you know what you're doing.
//===========================================================================
globals
    public leaderboard LEADERBOARD = null 
    public timer CLOCK = null
    private integer CURRENT_HANDLE = 0
    private integer MAX_HANDLE = 0
    private integer SECONDS = 0
endglobals
private function UpdateTime takes nothing returns nothing
    set SECONDS = SECONDS + 1
    call LeaderboardSetItemLabel(LEADERBOARD, 1, TIME_TEXT)
    call LeaderboardSetItemValue(LEADERBOARD, 1, SECONDS)
endfunction
private function Callback takes nothing returns nothing
    local location array loc
    local integer a = 0
    local integer index 
    local integer prevIndex = 0
    local integer next = 0
    loop
        set loc[a] = Location(0., 0.)
        set index = GetHandleId(loc[a]) - 0x100000
        set a = a + 1
        if index == prevIndex + 1 then
            set next = next + 1
        else
            set next = 0
        endif
        set prevIndex = index
        exitwhen next >= STACK_END_TRESHOLD
    endloop
    call LeaderboardSetItemValue(LEADERBOARD, 0, index - a)
    loop
        set a = a - 1
        call RemoveLocation(loc[a])
        set loc[a] = null
        exitwhen a <= 0
    endloop
endfunction
private function Actions takes nothing returns nothing
    local timer tim = GetExpiredTimer()
    set LEADERBOARD = CreateLeaderboard()
    call LeaderboardSetLabel(LEADERBOARD, TITLE)
    call PlayerSetLeaderboard(GetLocalPlayer(), LEADERBOARD)
    call LeaderboardDisplay(LEADERBOARD, true)
    call TimerStart(tim, UPDATE_PERIOD, true, function Callback)
    call LeaderboardAddItem(LEADERBOARD, "Max Handles", 0, MAX)
    call LeaderboardSetSizeByItemCount(LEADERBOARD, 1)
    if SHOW_TIME then
        set CLOCK = CreateTimer()
        call TimerStart(CLOCK, 1., true, function UpdateTime)
        call LeaderboardAddItem(LEADERBOARD, "", 1, TIME)
        // Prevent leaderboard showing "1" during the first second.
        call LeaderboardSetItemLabel(LEADERBOARD, 1, TIME_TEXT)
        call LeaderboardSetItemValue(LEADERBOARD, 1, SECONDS)
        call LeaderboardSetSizeByItemCount(LEADERBOARD, 2)
    endif
    set tim = null
endfunction
private function Init takes nothing returns nothing
    call TimerStart(CreateTimer() , 0., false, function Actions)
endfunction
endlibrary 
Я так однажды понял что TriggerSleepAction тоже имеет хендл)
28
HandleCounter, нашел на xgm
Эта вещь вообще мало чего общего с реальностью имеет. У меня так однажды было отрицательное кол-во хендлов.
22
PT153, зато помогает устранять утечки например мой карта ни 1 утечка не утекает =)
28
мой карта ни 1 утечка не утекает =)
Сильное заявление.
26
pro100master:
PT153, зато помогает устранять утечки например мой карта ни 1 утечка не утекает =)
знающим людям это не нужно т.к. они и так знают что и где утекает, а как раз таки узнать что течет большого ума не составляет, благо инфы навалом
30
HandleCounter, нашел на xgm
Я себе попроще сделал
//! zinc
library HandleCounter {
    leaderboard HandleBoard;
    
    function onInit(){
        TimerStart(CreateTimer(), 0, false, function () {
            HandleBoard = CreateLeaderboard();
            LeaderboardSetLabel(HandleBoard, "Handle Counter");
            PlayerSetLeaderboard(GetLocalPlayer(), HandleBoard);
            LeaderboardDisplay(HandleBoard, true);
            LeaderboardAddItem(HandleBoard, "Handles", 0, Player(0));
            LeaderboardSetSizeByItemCount(HandleBoard, 1);
            TimerStart(GetExpiredTimer(), 0.05, true, function(){            
                integer id, i = 0;
                location P[];
                real result = 0;
                
                while(i < 50){
                    i = i + 1;
                    P[i] = Location(0, 0);
                    id = GetHandleId(P[i]);
                    result = result + (id - 0x100000);
                }
                result = result/i-i/2 ;
                
                while(i >= 0){
                    RemoveLocation(P[i]);
                    P[i] = null;
                    i = i - 1;
                } 
                
                LeaderboardSetItemValue(HandleBoard, 0, R2I(result));
            });
        });
    }
}
//! endzinc
мой карта ни 1 утечка не утекает =)
Что впринципе можно о любой melee карте сказать))
знающим людям это не нужно т.к. они и так знают что и где утекает
Я както спросонья учудил
real x = GetLocationX(GetSpellTargetLoc());
real y = GetLocationY(GetSpellTargetLoc());
И если бы не счётчик, то не зметил бы 2 утекающих хэндла)
22
NazarPunk, какой melee у мя бесконечная арена с генератор рандомов.
Показан только небольшой набор комментариев вокруг указанного. Перейти к актуальным.
Чтобы оставить комментарий, пожалуйста, войдите на сайт.