Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[JASS] i need help

Discussion in 'Triggers & Scripts' started by b_a_d, Oct 4, 2007.

  1. b_a_d

    b_a_d

    Joined:
    Sep 4, 2007
    Messages:
    161
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    Im new in jass and im trying this trigger that makes a unit for 8 lanes but when there are so many units out the game crashs

    Code (vJASS):
    function Trig_IncomeSends_Func011Func001C takes nothing returns boolean
        if ( not ( ConvertedPlayer(GetForLoopIndexA()) != GetOwningPlayer(GetTriggerUnit()) ) ) then
            return false
        endif
        if ( not ( IsPlayerInForce(ConvertedPlayer(GetForLoopIndexA()), udg_Players) == true ) ) then
            return false
        endif
        return true
    endfunction

    function Trig_IncomeSends_Actions takes nothing returns nothing
        set udg_IncomeSends[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = ( udg_IncomeSends[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] + GetUnitPointValue(GetTriggerUnit()) )
        set udg_Income[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = ( udg_Income[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] + GetUnitPointValue(GetTriggerUnit()) )
        set bj_forLoopAIndex = 1
        set bj_forLoopAIndexEnd = 8
        loop
            exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
            if ( Trig_IncomeSends_Func011Func001C() ) then
                call CreateUnitAtLoc(Player(11), GetUnitTypeId(GetSoldUnit()), GetRectCenter(udg_PlayerSpawnPoint[GetForLoopIndexA()]), 180.00 )
                call SetUnitUserData( GetTriggerUnit(), GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit())) )
                call SetUnitPathing( GetTriggerUnit(), false )
            else
            endif
            set bj_forLoopAIndex = bj_forLoopAIndex + 1
        endloop
        call RemoveUnit( GetSoldUnit() )
    endfunction

    //===========================================================================
    function InitTrig_IncomeSends takes nothing returns nothing
        set gg_trg_IncomeSends = CreateTrigger(  )
        call TriggerRegisterPlayerUnitEventSimple( gg_trg_IncomeSends, Player(0), EVENT_PLAYER_UNIT_SELL )
        call TriggerRegisterPlayerUnitEventSimple( gg_trg_IncomeSends, Player(1), EVENT_PLAYER_UNIT_SELL )
        call TriggerRegisterPlayerUnitEventSimple( gg_trg_IncomeSends, Player(2), EVENT_PLAYER_UNIT_SELL )
        call TriggerRegisterPlayerUnitEventSimple( gg_trg_IncomeSends, Player(3), EVENT_PLAYER_UNIT_SELL )
        call TriggerRegisterPlayerUnitEventSimple( gg_trg_IncomeSends, Player(4), EVENT_PLAYER_UNIT_SELL )
        call TriggerRegisterPlayerUnitEventSimple( gg_trg_IncomeSends, Player(5), EVENT_PLAYER_UNIT_SELL )
        call TriggerRegisterPlayerUnitEventSimple( gg_trg_IncomeSends, Player(6), EVENT_PLAYER_UNIT_SELL )
        call TriggerRegisterPlayerUnitEventSimple( gg_trg_IncomeSends, Player(7), EVENT_PLAYER_UNIT_SELL )
        call TriggerAddAction( gg_trg_IncomeSends, function Trig_IncomeSends_Actions )
    endfunction


    Thats the code im useing i was changing it from gui to jass. Thanks for any help
     
  2. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    HOLY MACAROLY
    You have it (nearly) all wrong.

    First, please explain your idea better.

    My exp: if you want to create a "wave" of units in all lanes you should do:
    1 - Create regions: Regions ARE necessessary, as they can be used to create, order and move units, thus making our job a lot easir.
    2 - Use locals instead of globals: locals are faster and take less memory.
    3 - Remove leaks: it prevents lag
    4 - Use a single player for the spwans: It makes your job easier

    I can make the job for you, but you have to tell me what you have in mind.
    Also, avoid loops, as they are very complicated for begginers (i have some little experience and i find them "a pain in the arse" if you understand what i mean)
    Also that GUI converted script is all messed up, no wonder it crashes.
     
  3. b_a_d

    b_a_d

    Joined:
    Sep 4, 2007
    Messages:
    161
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    ok thanks for the tips ill remake the trigger and try again
     
  4. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    Also, download JassCraft from this website, and use it when coding, as it is a really usefull program.

    EDIT: I have a demonstration about what you should do:

    Code (vJASS):
    globals
        rect create_point //Here you place your globals, like regions and timers
        rect end_point    // This is only needed in JassCraft, you don't need
        timer My_timer    // this "global" part in the trigger editor, as the computer
    endglobals            // already knows which globals he will use    
    //============================================================================================
    function Create_and_move_units takes nothing returns nothing  // This isa function, this function has all actions inside it
        local unit My_Unit // Here i create a local variable
        set My_Unit = CreateUnit(Player(0), 'h000', GetRectCenterX(create_point), GetRectCenterY(create_point), 270)
        //Here i set my unit variable. I changed my variable's value to create
        // a unit of type 'h000' for player 1 (Player(0)) at the region create_point
        call IssuePointOrder(My_Unit, "move", GetRectCenterX(end_point), GetRectCenterY(end_point))
        //Here i prder my created unit to move to the next
        //lLocation(end_point)
        set My_Unit = null  //as you can see, i have 2 dif ways of setting a var
        //Now to prevent leaks, i nullify my variabe to null
        // Unit vars take computer memory, and if not nullified
        // (like in GUI) they can cause serious lag in game
    endfunction
    //============================================================================================
    function Trig_name takes nothing returns nothing //This function, is the main function. It activates the actions when the timer expires
        local trigger My_trig = CreateTrigger( ) // Here is my local trigger  
        call TriggerRegisterTimerExpireEvent(My_trig, My_timer )// Thru this call, i tell the computer which event will run the trigger    
        call TriggerAddAction( My_trig, function Create_and_move_units ) //Thru this call, i tell the activated trigger, which actions he must do
        set My_trig = null // Again, to prevent leaks, i nullify my local trigger variable
    endfunction


    Now there are two ways of setting a local variable:
    Code (vJASS):
    local VarType VarName
    set VarNAme = VarValue

    Here you create the variable, and then give it a value on the next line.

    Code (vJASS):
    local VarType VarNAme = VarValue

    Here you create and give a value to the variable in the same line.

    You choose which options you prefer.
    Also, ALWAYS nullify a local variable, to prevent leaks and lag. The only variables you can NOT nullify are booleans, integers and reals.

    I used a local trigger in this example. There are also global triggers. Globals triggers are slower than local triggers and they can cause crashes and confusions some types. However in advantage you have more freedom to program stuff if you use them, as they allow you to do more things.

    Local triggers are 100% safe and faster, but they are more limited than global triggers.

    Using locals is always an advantage because you can nullify them and because by using the, the spell is automatically MUI (it means all players can use it at the same time).

    In these example i used a timer, a unit and two regions.
    When the timer expires, the trigger is activated, and it runs the actions. This means that when the timer expires, a single unit is created in Create_point and it is ordered to move to end_point. Once the order has been given, i nullify the variable, and i prevent leaks.

    Now this is the basic concept of a TD. You can use other events, as you may which, but these are the main ideas you should have in mind.

    Also visit some JASS tutorials from our JASS sections.
     
    Last edited: Oct 4, 2007
  5. HINDYhat

    HINDYhat

    Joined:
    Apr 22, 2007
    Messages:
    1,594
    Resources:
    3
    Maps:
    2
    Spells:
    1
    Resources:
    3
    I don't know if global triggers are slower than local triggers (...?... Where did you learn that?), but global triggers are defintely better to use, since the map will still generate the global trigger variable... you might aswell use it.

    Also, I believe that code variables don't have to be nulled, since they aren't handles either.

    Please, explain to me how local triggers are 'safer' and faster than global triggers...

    Also, try to avoid using location variables. They leak and have to be nulled/removed. Instead, you should use coordinates, since most (if not all) native functions use coordinates instead of locations. The functions that use locations are BJ's, which definitely slow your map, are unefficient and (sometimes) leak.

    Too nullify a local, you simply do this:
    Code (vJASS):
    set VarName=null

    You do that after the variable is no longer needed, but remember, ALL local variable types except integers, reals, booleans, strings and codes must be nulled after you are done using them, else they could leak.
     
  6. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    I know that locals are faster then globals because i read that in a Dealin tutorial and because i think PurplePoot said that as well (don't remember very well).

    Also, what he means, is that you should have a look my code.
    Also using regions is ok, since it is for a TD, there is no other way to do it.
    Finally, you can also nullify strings, and i advise you to do so every time you can.

    All types of variables MUST be nullified in order to avoid leaks, it is in our JASS tutorials and in JASS Vault.

    Loclas are safer then globals because when using them you don't have the risk of over-run a global var. With locals, every time a local var is fired, the computer creates new value that is nullified after (if you set it to null) thus being safier. With globals you have the risk of overruning that same value.
    Locals are faster, but Daeling doesn't explain why .. (at least i didn't find such info)
     
  7. HINDYhat

    HINDYhat

    Joined:
    Apr 22, 2007
    Messages:
    1,594
    Resources:
    3
    Maps:
    2
    Spells:
    1
    Resources:
    3
    FP, I don't think there's a difference in speed between local/global 'triggers', but in terms of units or something. Like instead of using
    Code (vJASS):
    local unit u=BLAH

    You'd have a pre-created global which would refer to BLAH. Locals, in that case, would be faster. I don't think there's a difference in speed between local and globals triggers.

    Also, no, FP. Only local handles have to be nulled. Handles are every type of variable except integer/real/string/code/boolean (just look at common.j, where it's written [type BLAH extends handle])

    And what's the point of nulling strings? I've already asked Poot about that, and he said it was unnecessary since strings are not handles.

    And FP, I really can't see a reason for someone to change the value of a global trigger -.-. I'd say they are safer than locals, since you'd HAVE to refer to either globals or gamecache (unsafe) to refer to that trigger in some other function. Might aswell use the gg_trg_ global...

    About regions, I was just speaking in general. And no, you don't need regions for ordering units to move to a location. Just use the coordinates (hover your mouse over a point in the world editor, and the x,y,z coordinates should pop up on the bottom left corner of the editor). You'd still need regions to detect when a unit gets to the target location, but still, you're best to avoid locations/regions when you can.

    I've also asked Poot about global/local triggers (I think), and he said that global triggers were better.
     
  8. PurplePoot

    PurplePoot

    Joined:
    Dec 14, 2005
    Messages:
    11,161
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    Using a global trigger is probably faster, and will be shorter in the map script once optimized as well.

    It's also nice if you ever need to access that trigger.
     
  9. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    OMG, you guys are both againts me lol ...

    Well, about strings, i can go to the JASS Vault and prove what i am saying.
    About locals ... all your JASS tutorials teach people to use local triggers and locals because they are safer and bla and bleu and bla bla bla, i will try to find a tutorial where that is explained (again).


    About regions , i think they don't leak much. I mean, b4 you set a region to null i think you must destroy it first and then nullify it, but if you destroy the region, you will loose the purpose why they were created. Regions are permanent, that's why they exist (mostly).

    Also, if you think using coordinates is the solution, please give an example to b_a_d about how to use coordinates instead of regions, like i did. Because i really don't see how to do it.

    EDIT
    Strings are not handles, but they can be nullified as well to prevent memory leakage.
    I tested my opinion and it worked. If you create a string to display and nullify it, the nest time it displays, the text will be "null". This null text is obviously inside the game memory, thus there is no way to remove it, but it proves my point, it is better then a memory text we insert on it.

    About locals
    I strongly remmember this setence, and it can be found at my 8 pages thread where i ask for help about my reward system. Just don't make me read it all again please. This is also 1 of the main reasons why i use locals.
    Ofc that is PurplePoot's opinion changed, well ... then i want to know why lol.

    Also agai as i say, if ALL our JASS tutorials advice the using of locals ... why use globals !? blarg, i feel like i am the bad guy here ... i do exactly what you guys teach us and still i feel i am defending a wrong (very wrong) concept.
    Perhaps you should change those tutorials ...
     
    Last edited: Oct 5, 2007
  10. HINDYhat

    HINDYhat

    Joined:
    Apr 22, 2007
    Messages:
    1,594
    Resources:
    3
    Maps:
    2
    Spells:
    1
    Resources:
    3
    Strings... don't need to be nulled... Any variable type can be null. Strings (I think) can't be removed and are permanent in memory, but they don't leak alot anyway.

    I asked some people if local triggers were better to use than global trigger, and everyone said globals were better -.- I just don't get WHY create a local trigger when the global trigger is automatically generated FOR you..? You would just be using up more memory by making a local trigger.

    Regions leak as much as every other handle. Regions are not permanent... where did you hear that?

    Instead of doing this:
    Code (vJASS):
    call IssuePointOrder(My_Unit, "move", GetRectCenterX(end_point), GetRectCenterY(end_point))

    Just do something like this:
    Code (vJASS):
    call IssuePointOrder(My_Unit, "move", SomeXCoordinate, SomeYCoordinate)

    And these coordinates would be the center of the moving rects. Instead of calling GetRectCenterX/Y each time, it would be more efficient (if it's a 'permanent' rect) to simply get the coordinates.

    Locals ARE faster than globals, but I don't think that local triggers RUN faster than global triggers. More like, assigning values to locals and using locals generally (not running on local triggers or local code vars) are faster than globals... I don't know if you understand.

    Globals are still very useful. They are alot faster than gamecache, and can be 'carried' throughout multiple functions. So in the end, if you REALLY want to use locals all the time, you'd have to pass by either globals or gamecache (for carrying locals throughout functions).
     
  11. b_a_d

    b_a_d

    Joined:
    Sep 4, 2007
    Messages:
    161
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    ok im lost on useing Coordinates i know how i can get them i just dont know how to use them in jass
     
  12. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    Strings can be nulled, as i already demonstrated .. Also, in conclusion, you and PurlplePoot say global triggers are better rit ?? i guess i will have to change all my map's triggers again lol ...

    Also, regions ARE permanent !! If you create a region with WE in the map, that region will be permanent in game, unless you destroy it. Regions are some kind of globals in a 3d plan.
    Also, if regions leak, they probably leak like locations, because that is what they are, one way or another (but not sure).

    Also, yes i understood your lcoals and globals point. Still, Globals are evil !! lol, that is why i avoid them so much !! You can use globals, but they get over runned all the time. That is why i believe locals are way much better. In GUI, you can only use globals, and it sux (lol, that is why we all are in JASS rit ?) because is it too much limited.

    ALso, in conclusion, you say that this code doesn't leak, rit?
    Code (vJASS):
    call IssuePointOrder(My_Unit, "move", 138.546282, 164.754756)


    If that is so, it also means that you can use
    Code (vJASS):
    CreateUnit( Player(0), 'hprt', 152.87879, 169.98617, 270.0)

    to create a unit instead of
    Code (vJASS):
    CreateUnit( P6, 'hprt', GetRectCenterX(g), GetRectCenterY(g), 270.0)
    because it won't leak and because it is faster rit ????
     
  13. b_a_d

    b_a_d

    Joined:
    Sep 4, 2007
    Messages:
    161
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    you can use locals in gui all u have to do is use custom script
     
  14. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    That is JASS. It is not GUI. People who don't know JASS will never use Custom script .... lol, as i said b4, we all learned JASS because GUi is too limited. You just prove my point. People use JASS in GUI because GUI sux (litterally, GUI is great, until 1 point).

    Also, b_a_d, paste some of your code, so we can see your progress.
    Also, remmeber to rep+ me and hyndi !! =P lool
     
  15. b_a_d

    b_a_d

    Joined:
    Sep 4, 2007
    Messages:
    161
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    also i found out its not that trigger that is making the game crash its the trigger that takes the lifes away thats making it crash. But i cant post that here yet its gui so im gonna make it in jass.
     
  16. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    I wonder how the JASS trigger you posted doen't make the game crsh ... Your trigger is such a mess ...
     
  17. HINDYhat

    HINDYhat

    Joined:
    Apr 22, 2007
    Messages:
    1,594
    Resources:
    3
    Maps:
    2
    Spells:
    1
    Resources:
    3
    Well technically that isn't GUI anymore...

    FP, ALL variables can be nulled. There is just no point in nulling strings. If you can null a variable, doesn't mean it removes the leak.
    Umm... you just ownt yourself? The rects you create with the world editor region editor are stored in globals. You can remove those globals, which is technically removing the rect.. so yes, rects can be removed and no, they are not permanent.

    Regions and rects are both handles, like locations. All handles leak (what don't you understand?!) if not destroyed and nulled.

    Globals are not evil... just look at vJass' structs. They are completely based on global arrays, and I haven't had those structs bug yet. They work perfectly fine, and do loads of stuff you couldn't accomplish with gamecache/locals (mostly because of efficiency/complicatedness...?).

    Ugh, you just don't understand the leaking. Only handles leak. It's not the function call that will make the rect leak, it's the rect that will leak if you don't remove and null it. Using the direct coordinates (when you can) will just make the script more efficient and faster. It's always better to avoid useless function calls.
     
  18. b_a_d

    b_a_d

    Joined:
    Sep 4, 2007
    Messages:
    161
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    ok i converted my gui trigger for when a unit reachs the end i havnt changed anything on it yet so its a big mess but i cant figure out how to fix it
    Code (vJASS):
    function Trig_Redend_Conditions takes nothing returns boolean
        if ( not ( GetUnitTypeId(GetEnteringUnit()) != 'u001' ) ) then
            return false
        endif
        return true
    endfunction

    function Trig_Redend_Func006001 takes nothing returns boolean
        return ( udg_Lives[1] >= 1 )
    endfunction

    function Trig_Redend_Func007001 takes nothing returns boolean
        return ( udg_Lives[1] == 0 )
    endfunction

    function Trig_Redend_Func008001 takes nothing returns boolean
        return ( udg_Lives[1] == 0 )
    endfunction

    function Trig_Redend_Func009Func009A takes nothing returns nothing
        call AddSpecialEffectLocBJ( GetUnitLoc(GetEnumUnit()), "Units\\Demon\\Infernal\\InfernalBirth.mdl" )
        call ExplodeUnitBJ( GetEnumUnit() )
    endfunction

    function Trig_Redend_Func009C takes nothing returns boolean
        if ( not ( udg_Lives[1] == 0 ) ) then
            return false
        endif
        return true
    endfunction

    function Trig_Redend_Actions takes nothing returns nothing
        call ExplodeUnitBJ( GetTriggerUnit() )
        call PlaySoundBJ( gg_snd_GoodJob )
        call DisplayTextToForce( GetForceOfPlayer(ConvertedPlayer(GetUnitUserData(GetEnteringUnit()))), ( "|cffffcc00 You have taken a life from |r" + GetPlayerName(ConvertedPlayer(1)) ) )
        set udg_Lives[1] = ( udg_Lives[1] - 1 )
        if ( Trig_Redend_Func006001() ) then
            call DisplayTextToForce( bj_FORCE_PLAYER[0], ( I2S(udg_Lives[1]) + " lives left!" ) )
        else
            call DoNothing(  )
        endif
        if ( Trig_Redend_Func007001() ) then
            call DisplayTextToForce( GetPlayersAll(), ( GetPlayerName(ConvertedPlayer(GetUnitUserData(GetEnteringUnit()))) + ( " has defeated " + GetPlayerName(ConvertedPlayer(1)) ) ) )
        else
            call DoNothing(  )
        endif
        if ( Trig_Redend_Func008001() ) then
            call TriggerExecute( gg_trg_Player_Defeated )
        else
            call DoNothing(  )
        endif
        if ( Trig_Redend_Func009C() ) then
            call ForceRemovePlayerSimple( Player(0), udg_Players )
            call CinematicModeBJ( true, bj_FORCE_PLAYER[0] )
            call PanCameraToTimedLocWithZForPlayer( Player(0), GetRectCenter(udg_PlayerLane[1]), 1000.00, 1.00 )
            call TriggerSleepAction( 1.00 )
            call SetCameraBoundsToRectForPlayerBJ( Player(0), udg_PlayerLane[1] )
            call CameraSetEQNoiseForPlayer( Player(0), 45.00 )
            call TriggerSleepAction( 2 )
            call ForGroupBJ( GetUnitsOfPlayerAll(Player(0)), function Trig_Redend_Func009Func009A )
            call TriggerSleepAction( 2 )
            call CameraClearNoiseForPlayer( Player(0) )
            call SetCameraBoundsToRectForPlayerBJ( Player(0), GetCameraBoundsMapRect() )
            call CinematicModeBJ( false, bj_FORCE_PLAYER[0] )
        else
            call DoNothing(  )
        endif
    endfunction

    //===========================================================================
    function InitTrig_Redend takes nothing returns nothing
        set gg_trg_Redend = CreateTrigger(  )
        call TriggerRegisterEnterRectSimple( gg_trg_Redend, gg_rct_Red_end )
        call TriggerAddCondition( gg_trg_Redend, Condition( function Trig_Redend_Conditions ) )
        call TriggerAddAction( gg_trg_Redend, function Trig_Redend_Actions )
    endfunction


    any help would be nice to help fix this big pile of junk
     
  19. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    Well, there is another away which is much simplier:
    1 - Create 1 integer global with 20 as value (20 lifes)
    2 -
    Events:A Unit Enters a region
    Conditions: Region is bla bla bla
    Actions: Set MyVar to MyVar -1
    //This is the GUI Trigger you will have to do in order to take 1 life

    Then you create another trigger that ends the game when My Var is equal to 0. Very easy to do. You don'ty need half of that stuuf you have in your script.

    Also Hyndi, you didn't explained us my question:
     
  20. HINDYhat

    HINDYhat

    Joined:
    Apr 22, 2007
    Messages:
    1,594
    Resources:
    3
    Maps:
    2
    Spells:
    1
    Resources:
    3
    It might leak, depending on if you remove the g region and created units.

    Yes I did answer.