• 🏆 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!

Jass Checker correct?

Status
Not open for further replies.
Level 19
Joined
Jul 2, 2011
Messages
2,162
Hey just a simple question

Is the jass checker correct???

Because if it is my map apparently has over 6000 memory leaks.... which simply can't be correct could it? I've been leak checking that map for over 7 years now. If it still has problems then boy do I know nothing about warcraft
 

Deleted member 219079

D

Deleted member 219079

Can you post an example piece of code what you thought to be leak free?
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
Can you post an example piece of code what you thought to be leak free?
This tig alone according to the jass checker has over 49 leaks
  • Actions
    • If (wavenumber Equal to 5) then do (Trigger - Turn on GoldAndLumber <gen>) else do (Do nothing)
    • If (wavenumber Equal to 1) then do (Game - Display to (All players) the text: Drink plenty of bee...) else do (Do nothing)
    • If (blighter Equal to 8) then do (Game - Display to (All players) the text: Buy an item of spel...) else do (Do nothing)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • wavenumber Equal to 19
        • wavenumber Equal to 25
        • wavenumber Equal to 12
        • wavenumber Equal to 24
      • Then - Actions
        • Trigger - Run Warning <gen> (ignoring conditions)
      • Else - Actions
    • If (wavenumber Equal to 9) then do (Neutral Building - Disable Way Gate 0189 <gen>) else do (Do nothing)
    • If (wavenumber Equal to 12) then do (Neutral Building - Disable Way Gate 0189 <gen>) else do (Do nothing)
    • If (wavenumber Equal to 11) then do (Neutral Building - Disable Way Gate 0189 <gen>) else do (Do nothing)
    • If (wavenumber Equal to 12) then do (Game - Display to (All players) the text: |c000000ffGateWay D...) else do (Do nothing)
    • If (wavenumber Equal to 9) then do (Game - Display to (All players) the text: |c000000ffGateWay D...) else do (Do nothing)
    • If (wavenumber Equal to 12) then do (Trigger - Run hide blockad <gen> (ignoring conditions)) else do (Do nothing)
    • If (wavenumber Equal to 19) then do (Game - Display to (All players) the text: |c00ff0000Warning: ...) else do (Do nothing)
    • If (wavenumber Equal to 25) then do (Game - Display to (All players) the text: |c00ff0000Warning: ...) else do (Do nothing)
    • If (wavenumber Equal to 12) then do (Game - Display to (All players) the text: |c00ff0000Warning: ...) else do (Do nothing)
    • If (wavenumber Equal to 24) then do (Game - Display to (All players) the text: |c00ff0000Namore!!!...) else do (Do nothing)
    • Sound - Play Sound30[wavenumber]
    • Set TempPoint = (Center of Evil Spawn 3 <gen>)
    • If (wavenumber Equal to 1) then do (Unit - Create 30 Ghoul (01) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 5) then do (Unit - Create 30 Tauren (04) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 6) then do (Unit - Create 30 Tauren (204) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 7) then do (Unit - Create 30 Tauren (04) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 8) then do (Unit - Create 30 Tauren (04) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 9) then do (Unit - Create 30 Shaman (203) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 10) then do (Unit - Create 30 Tauren (04) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 11) then do (Unit - Create 30 Tauren (204) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 14) then do (Unit - Create 30 Siege Golem (208) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 15) then do (Unit - Create 30 Skeleton Archer (Dark) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 18) then do (Unit - Create 30 Death Revenant for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 19) then do (Unit - Create 30 Death Revenant for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 20) then do (Unit - Create 30 Frost Wyrm (205) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 24) then do (Unit - Create 1 Namore (Evil) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 12) then do (Unit - Create 30 Necromancer (203) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 13) then do (Unit - Create 30 Shadow Wolf (Level 4) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 16) then do (Unit - Create 30 Wraith for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 17) then do (Unit - Create 30 Death Revenant for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • Custom script: call RemoveLocation(udg_TempPoint)
    • Set TempPoint = (Center of Evil region3 <gen>)
    • If (wavenumber Equal to 2) then do (Unit - Create 30 Crypt Fiend (02) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 3) then do (Unit - Create 30 Crypt Fiend (202) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 3) then do (Unit - Create 10 Ghoul (201) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 4) then do (Unit - Create 30 Abomination (04) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 4) then do (Unit - Create 10 Crypt Fiend (02) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 5) then do (Unit - Create 30 Abomination (04) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 6) then do (Unit - Create 30 Crypt Fiend (02) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 7) then do (Unit - Create 30 Abomination (204) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 8) then do (Unit - Create 30 Crypt Fiend (202) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 9) then do (Unit - Create 30 Grunt (201) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 10) then do (Unit - Create 30 Grunt (01) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 10) then do (Unit - Create 1 Doom Guard for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 27) then do (Unit - Create 30 Death Revenant for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • Custom script: call RemoveLocation(udg_TempPoint)
    • Set TempPoint = (Center of Evil Spawn 2 <gen>)
    • If (wavenumber Equal to 11) then do (Unit - Create 30 Kodo Beast for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 12) then do (Unit - Create 30 Crypt Fiend (202) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 17) then do (Unit - Create 30 Berserk Wildkin (209) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 18) then do (Unit - Create 30 Troll Headhunter (202) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 20) then do (Unit - Create 30 Troll Headhunter (202) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 25) then do (Unit - Create 30 Death Revenant for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 26) then do (Unit - Create 30 Death Revenant for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 26) then do (Unit - Create 30 Troll Headhunter (202) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • Custom script: call RemoveLocation(udg_TempPoint)
    • Set TempPoint = (Center of Evil Region2 <gen>)
    • If (wavenumber Equal to 19) then do (Unit - Create 30 Frost Wyrm (05) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 22) then do (Unit - Create 40 Zombie for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • Custom script: call RemoveLocation(udg_TempPoint)
    • Set TempPoint = (Center of Evil Region5 <gen>)
    • If (wavenumber Equal to 21) then do (Unit - Create 20 Ice Troll Warlord (08) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 23) then do (Unit - Create 40 Nerubian Queen (207) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 28) then do (Unit - Create 30 Red Dragon (S5) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • Custom script: call RemoveLocation(udg_TempPoint)
    • Set TempPoint = (Center of Evil Region <gen>)
    • If (wavenumber Equal to 21) then do (Unit - Create 40 Zombie for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • Custom script: call RemoveLocation(udg_TempPoint)
    • Set TempPoint = (Center of Spawn Order <gen>)
    • If (wavenumber Equal to 22) then do (Unit - Create 20 Blue Dragon (09) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • Custom script: call RemoveLocation(udg_TempPoint)
    • Set TempPoint = (Center of Evil Region4 <gen>)
    • If (wavenumber Equal to 23) then do (Unit - Create 40 Frost Revenant (S6) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • If (wavenumber Equal to 29) then do (Unit - Create 30 Ogre Magi (S4) for Player 12 (Brown) at TempPoint facing (Player 1 (Red) start location)) else do (Do nothing)
    • Custom script: call RemoveLocation(udg_TempPoint)
    • If (wavenumber Equal to 29) then do (Trigger - Run instant rivive death <gen> (checking conditions)) else do (Do nothing)
    • Set TempGroup = (Units in q4 <gen>)
    • If ((Random unit from TempGroup) Equal to Chinz Supreme Being 0175 <gen>) then do (Trigger - Run repeat attack <gen> (checking conditions)) else do (Do nothing)
    • Custom script: call DestroyGroup(udg_TempGroup)
I'm just double checking to see if the optimised script also has the same number of leaks
 

Deleted member 219079

D

Deleted member 219079

  • Unit - Create 1 Footman for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees
-->
call CreateNUnitsAtLoc( 1, 'hfoo', Player(0), GetPlayerStartLocationLoc(Player(0)), bj_UNIT_FACING )
-->
JASS:
function GetPlayerStartLocationLoc takes player whichPlayer returns location
    return GetStartLocationLoc(GetPlayerStartLocation(whichPlayer))
endfunction
-->
location

Store the location into variable, then use RemoveLocation(udg_myLocation) after usage.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
  • Unit - Create 1 Footman for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees
-->
call CreateNUnitsAtLoc( 1, 'hfoo', Player(0), GetPlayerStartLocationLoc(Player(0)), bj_UNIT_FACING )
-->
JASS:
function GetPlayerStartLocationLoc takes player whichPlayer returns location
    return GetStartLocationLoc(GetPlayerStartLocation(whichPlayer))
endfunction
-->
location

Store the location into variable, then use RemoveLocation(udg_myLocation) after usage.
Yes the location is removed....
As you can see in the trig I posted, all the location points are destroyed

What else could be wrong?
 

Deleted member 219079

D

Deleted member 219079

Good rule of thumb for GUI: Whenever something is in (parenthesis), it will involve a function call. If uncertain of what it is, copy that GUI line into an empty trigger and go to Edit > Convert to Custom Text.

Have fun!
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
Yes the location is removed....

What else could be wrong?
Good rule of thumb for GUI: Whenever something is in (parenthesis), it will involve a function call. If uncertain of what it is, copy that GUI line into an empty trigger and go to Edit > Convert to Custom Text.

Have fun!
So basically you are saying you have no idea what the problem is ?

I see.... you are the time waster
 
Level 8
Joined
Jul 10, 2008
Messages
353
Even tho am not sure with gui,

You need to call this, after every location you create
join.gif
page.gif
Custom script: call RemoveLocation(udg_TempPoint)

Can you convert it into jass and repost? :p
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
Even tho am not sure with gui,

You need to call this, after every location you create
join.gif
page.gif
Custom script: call RemoveLocation(udg_TempPoint)

Can you convert it into jass and repost? :p
Since the locations are called from within an if statement, they are not all activated at once.

Meaning the fact that I have three destroy locations in the trig is actually unnecessary because in actual fact only one location is called at all times....

I'll convert now

Code:
function Trig_spawn_master_Func001001 takes nothing returns boolean
    return ( udg_wavenumber == 5 )
endfunction

function Trig_spawn_master_Func002001 takes nothing returns boolean
    return ( udg_wavenumber == 1 )
endfunction

function Trig_spawn_master_Func003001 takes nothing returns boolean
    return ( udg_blighter == 8 )
endfunction

function Trig_spawn_master_Func004C takes nothing returns boolean
    if ( not ( udg_wavenumber == 19 ) ) then
        return false
    endif
    if ( not ( udg_wavenumber == 25 ) ) then
        return false
    endif
    if ( not ( udg_wavenumber == 12 ) ) then
        return false
    endif
    if ( not ( udg_wavenumber == 24 ) ) then
        return false
    endif
    return true
endfunction

function Trig_spawn_master_Func005001 takes nothing returns boolean
    return ( udg_wavenumber == 9 )
endfunction

function Trig_spawn_master_Func006001 takes nothing returns boolean
    return ( udg_wavenumber == 12 )
endfunction

function Trig_spawn_master_Func007001 takes nothing returns boolean
    return ( udg_wavenumber == 11 )
endfunction

function Trig_spawn_master_Func008001 takes nothing returns boolean
    return ( udg_wavenumber == 12 )
endfunction

function Trig_spawn_master_Func009001 takes nothing returns boolean
    return ( udg_wavenumber == 9 )
endfunction

function Trig_spawn_master_Func010001 takes nothing returns boolean
    return ( udg_wavenumber == 12 )
endfunction

function Trig_spawn_master_Func011001 takes nothing returns boolean
    return ( udg_wavenumber == 19 )
endfunction

function Trig_spawn_master_Func012001 takes nothing returns boolean
    return ( udg_wavenumber == 25 )
endfunction

function Trig_spawn_master_Func013001 takes nothing returns boolean
    return ( udg_wavenumber == 12 )
endfunction

function Trig_spawn_master_Func014001 takes nothing returns boolean
    return ( udg_wavenumber == 24 )
endfunction

function Trig_spawn_master_Func017001 takes nothing returns boolean
    return ( udg_wavenumber == 1 )
endfunction

function Trig_spawn_master_Func018001 takes nothing returns boolean
    return ( udg_wavenumber == 5 )
endfunction

function Trig_spawn_master_Func019001 takes nothing returns boolean
    return ( udg_wavenumber == 6 )
endfunction

function Trig_spawn_master_Func020001 takes nothing returns boolean
    return ( udg_wavenumber == 7 )
endfunction

function Trig_spawn_master_Func021001 takes nothing returns boolean
    return ( udg_wavenumber == 8 )
endfunction

function Trig_spawn_master_Func022001 takes nothing returns boolean
    return ( udg_wavenumber == 9 )
endfunction

function Trig_spawn_master_Func023001 takes nothing returns boolean
    return ( udg_wavenumber == 10 )
endfunction

function Trig_spawn_master_Func024001 takes nothing returns boolean
    return ( udg_wavenumber == 11 )
endfunction

function Trig_spawn_master_Func025001 takes nothing returns boolean
    return ( udg_wavenumber == 14 )
endfunction

function Trig_spawn_master_Func026001 takes nothing returns boolean
    return ( udg_wavenumber == 15 )
endfunction

function Trig_spawn_master_Func027001 takes nothing returns boolean
    return ( udg_wavenumber == 18 )
endfunction

function Trig_spawn_master_Func028001 takes nothing returns boolean
    return ( udg_wavenumber == 19 )
endfunction

function Trig_spawn_master_Func029001 takes nothing returns boolean
    return ( udg_wavenumber == 20 )
endfunction

function Trig_spawn_master_Func030001 takes nothing returns boolean
    return ( udg_wavenumber == 24 )
endfunction

function Trig_spawn_master_Func031001 takes nothing returns boolean
    return ( udg_wavenumber == 12 )
endfunction

function Trig_spawn_master_Func032001 takes nothing returns boolean
    return ( udg_wavenumber == 13 )
endfunction

function Trig_spawn_master_Func033001 takes nothing returns boolean
    return ( udg_wavenumber == 16 )
endfunction

function Trig_spawn_master_Func034001 takes nothing returns boolean
    return ( udg_wavenumber == 17 )
endfunction

function Trig_spawn_master_Func037001 takes nothing returns boolean
    return ( udg_wavenumber == 2 )
endfunction

function Trig_spawn_master_Func038001 takes nothing returns boolean
    return ( udg_wavenumber == 3 )
endfunction

function Trig_spawn_master_Func039001 takes nothing returns boolean
    return ( udg_wavenumber == 3 )
endfunction

function Trig_spawn_master_Func040001 takes nothing returns boolean
    return ( udg_wavenumber == 4 )
endfunction

function Trig_spawn_master_Func041001 takes nothing returns boolean
    return ( udg_wavenumber == 4 )
endfunction

function Trig_spawn_master_Func042001 takes nothing returns boolean
    return ( udg_wavenumber == 5 )
endfunction

function Trig_spawn_master_Func043001 takes nothing returns boolean
    return ( udg_wavenumber == 6 )
endfunction

function Trig_spawn_master_Func044001 takes nothing returns boolean
    return ( udg_wavenumber == 7 )
endfunction

function Trig_spawn_master_Func045001 takes nothing returns boolean
    return ( udg_wavenumber == 8 )
endfunction

function Trig_spawn_master_Func046001 takes nothing returns boolean
    return ( udg_wavenumber == 9 )
endfunction

function Trig_spawn_master_Func047001 takes nothing returns boolean
    return ( udg_wavenumber == 10 )
endfunction

function Trig_spawn_master_Func048001 takes nothing returns boolean
    return ( udg_wavenumber == 10 )
endfunction

function Trig_spawn_master_Func049001 takes nothing returns boolean
    return ( udg_wavenumber == 27 )
endfunction

function Trig_spawn_master_Func052001 takes nothing returns boolean
    return ( udg_wavenumber == 11 )
endfunction

function Trig_spawn_master_Func053001 takes nothing returns boolean
    return ( udg_wavenumber == 12 )
endfunction

function Trig_spawn_master_Func054001 takes nothing returns boolean
    return ( udg_wavenumber == 17 )
endfunction

function Trig_spawn_master_Func055001 takes nothing returns boolean
    return ( udg_wavenumber == 18 )
endfunction

function Trig_spawn_master_Func056001 takes nothing returns boolean
    return ( udg_wavenumber == 20 )
endfunction

function Trig_spawn_master_Func057001 takes nothing returns boolean
    return ( udg_wavenumber == 25 )
endfunction

function Trig_spawn_master_Func058001 takes nothing returns boolean
    return ( udg_wavenumber == 26 )
endfunction

function Trig_spawn_master_Func059001 takes nothing returns boolean
    return ( udg_wavenumber == 26 )
endfunction

function Trig_spawn_master_Func062001 takes nothing returns boolean
    return ( udg_wavenumber == 19 )
endfunction

function Trig_spawn_master_Func063001 takes nothing returns boolean
    return ( udg_wavenumber == 22 )
endfunction

function Trig_spawn_master_Func066001 takes nothing returns boolean
    return ( udg_wavenumber == 21 )
endfunction

function Trig_spawn_master_Func067001 takes nothing returns boolean
    return ( udg_wavenumber == 23 )
endfunction

function Trig_spawn_master_Func068001 takes nothing returns boolean
    return ( udg_wavenumber == 28 )
endfunction

function Trig_spawn_master_Func071001 takes nothing returns boolean
    return ( udg_wavenumber == 21 )
endfunction

function Trig_spawn_master_Func074001 takes nothing returns boolean
    return ( udg_wavenumber == 22 )
endfunction

function Trig_spawn_master_Func077001 takes nothing returns boolean
    return ( udg_wavenumber == 23 )
endfunction

function Trig_spawn_master_Func078001 takes nothing returns boolean
    return ( udg_wavenumber == 29 )
endfunction

function Trig_spawn_master_Func080001 takes nothing returns boolean
    return ( udg_wavenumber == 29 )
endfunction

function Trig_spawn_master_Func082001 takes nothing returns boolean
    return ( GroupPickRandomUnit(udg_TempGroup) == gg_unit_Uwar_0175 )
endfunction

function Trig_spawn_master_Actions takes nothing returns nothing
    if ( Trig_spawn_master_Func001001() ) then
        call EnableTrigger( gg_trg_GoldAndLumber )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func002001() ) then
        call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_2481" )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func003001() ) then
        call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_2177" )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func004C() ) then
        call TriggerExecute( gg_trg_Warning )
    else
    endif
    if ( Trig_spawn_master_Func005001() ) then
        call WaygateActivateBJ( false, gg_unit_nwgt_0189 )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func006001() ) then
        call WaygateActivateBJ( false, gg_unit_nwgt_0189 )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func007001() ) then
        call WaygateActivateBJ( false, gg_unit_nwgt_0189 )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func008001() ) then
        call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_2710" )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func009001() ) then
        call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_2711" )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func010001() ) then
        call TriggerExecute( gg_trg_hide_blockad )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func011001() ) then
        call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_2178" )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func012001() ) then
        call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_2632" )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func013001() ) then
        call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_2631" )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func014001() ) then
        call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_2479" )
    else
        call DoNothing(  )
    endif
    call PlaySoundBJ( udg_Sound30[udg_wavenumber] )
    set udg_TempPoint = GetRectCenter(gg_rct_Evil_Spawn_3)
    if ( Trig_spawn_master_Func017001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'ugho', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func018001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'otau', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func019001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'oC29', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func020001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'otau', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func021001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'otau', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func022001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'oC28', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func023001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'otau', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func024001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'oC29', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func025001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'nC37', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func026001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'nC14', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func027001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'nrvd', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func028001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'nrvd', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func029001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'uC34', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func030001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 1, 'E001', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func031001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'uC32', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func032001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'o006', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func033001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'nC09', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func034001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'nrvd', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    call RemoveLocation(udg_TempPoint)
    set udg_TempPoint = GetRectCenter(gg_rct_Evil_region3)
    if ( Trig_spawn_master_Func037001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'ucry', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func038001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'uC31', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func039001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 10, 'uC26', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func040001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'uabo', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func041001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 10, 'ucry', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func042001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'uabo', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func043001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'ucry', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func044001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'uC33', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func045001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'uC31', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func046001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'oC18', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func047001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'ogru', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func048001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 1, 'nbal', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func049001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'nrvd', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    call RemoveLocation(udg_TempPoint)
    set udg_TempPoint = GetRectCenter(gg_rct_Evil_Spawn_2)
    if ( Trig_spawn_master_Func052001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'okod', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func053001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'uC31', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func054001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'nC38', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func055001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'oC27', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func056001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'oC27', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func057001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'nrvd', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func058001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'nrvd', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func059001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'oC27', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    call RemoveLocation(udg_TempPoint)
    set udg_TempPoint = GetRectCenter(gg_rct_Evil_Region2)
    if ( Trig_spawn_master_Func062001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'ufro', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func063001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 40, 'nzom', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    call RemoveLocation(udg_TempPoint)
    set udg_TempPoint = GetRectCenter(gg_rct_Evil_Region5)
    if ( Trig_spawn_master_Func066001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 20, 'nC07', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func067001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 40, 'nC36', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func068001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'nC24', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    call RemoveLocation(udg_TempPoint)
    set udg_TempPoint = GetRectCenter(gg_rct_Evil_Region)
    if ( Trig_spawn_master_Func071001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 40, 'nzom', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    call RemoveLocation(udg_TempPoint)
    set udg_TempPoint = GetRectCenter(gg_rct_Spawn_Order)
    if ( Trig_spawn_master_Func074001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 20, 'nC06', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    call RemoveLocation(udg_TempPoint)
    set udg_TempPoint = GetRectCenter(gg_rct_Evil_Region4)
    if ( Trig_spawn_master_Func077001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 40, 'nC25', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    if ( Trig_spawn_master_Func078001() ) then
        call CreateNUnitsAtLocFacingLocBJ( 30, 'nC23', Player(11), udg_TempPoint, GetPlayerStartLocationLoc(Player(0)) )
    else
        call DoNothing(  )
    endif
    call RemoveLocation(udg_TempPoint)
    if ( Trig_spawn_master_Func080001() ) then
        call ConditionalTriggerExecute( gg_trg_instant_rivive_death )
    else
        call DoNothing(  )
    endif
    set udg_TempGroup = GetUnitsInRectAll(gg_rct_q4)
    if ( Trig_spawn_master_Func082001() ) then
        call ConditionalTriggerExecute( gg_trg_repeat_attack )
    else
        call DoNothing(  )
    endif
    call DestroyGroup(udg_TempGroup)
endfunction

//===========================================================================
function InitTrig_spawn_master takes nothing returns nothing
    set gg_trg_spawn_master = CreateTrigger(  )
    call DisableTrigger( gg_trg_spawn_master )
    call TriggerAddAction( gg_trg_spawn_master, function Trig_spawn_master_Actions )
endfunction

[code\]
 

Deleted member 219079

D

Deleted member 219079

JASS:
function GetPlayerStartLocationLoc takes player whichPlayer returns location
    return GetStartLocationLoc(GetPlayerStartLocation(whichPlayer))
endfunction
-->
location

Store the location into variable, then use RemoveLocation(udg_myLocation) after usage.
 
Level 8
Joined
Jul 10, 2008
Messages
353
Johndrean is correct. He is just quoting wrong func

function CreateNUnitsAtLocFacingLocBJ takes integer count, integer unitId, player whichPlayer, location loc, location lookAt returns group
return CreateNUnitsAtLoc(count, unitId, whichPlayer, loc, AngleBetweenPoints(loc, lookAt))
endfunction

Check the bold. Thats actually 3 leaks (1 you remove).
 
Last edited:
Level 19
Joined
Jul 2, 2011
Messages
2,162
That way you don't leak is a false alarm cause checker assumes that more than one of this location can exist at the same time. (it has no way to know that those booleans can't cooexist.
In other words it need to be improved to look at the variables of if statements.

There surely is a way to check that all the if statement values are different.

This is a problem that needs fixing, because almost every map uses if statements of some kind
 
Level 8
Joined
Jul 10, 2008
Messages
353
I assumed checker couldn't check, I dont actually use it ever.

I edited my reply. But both might be the case, cause checker probly wouldn't tell the difference.

What you need to do is make a TempPoint2 and put the GetPlayerStartLocation in it then null it at the end.

If still pops errors (which it shouldn't) u need to call both removelocation after every if.
 
Last edited:
Level 19
Joined
Jul 2, 2011
Messages
2,162
I assumed checker couldn't check, I dont actually use it ever.

I edited my reply. But both might be the case, cause checker probly wouldn't tell the difference.

What you need to do is make a TempPoint2 and put the GetPlayerStartLocation in it then null it at the end.

If still pops errors (which it shouldn't) u need to call both removelocation after every if.
Nah it's cool

I'm satisfied that my map is leak free, it hasn't got any lag and it only shuts down when my dance trig is activated
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
Each of your "if" statements create new locations, and you do not clean them up.

Do as the other posters have said, instead of assuming they're wrong. Because they're not.
The if statement doesn't become active until that wave number

so...... your wrong

I only need one location to be destroyed every time that tigger runs
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
People are telling you is to do this:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Condition
    • Then - Actions
      • Set TempPoint = Center of Whatever
      • Set TempPoint2 = (Player 1 (Red) start location)
      • Unit - Create 1 Footman for Player 1 (Red) at TempPoint facing TempPoint2
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
    • Else - Actions
I suppose if you are reusing Start Locations:

You could save it and then just always have it.

  • //somewhere else
  • Set RedsStartingLoc = (Player 1 (Red) start location)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Condition
    • Then - Actions
      • Set TempPoint = Center of Whatever
      • Unit - Create 1 Footman for Player 1 (Red) at TempPoint facing RedsStartingLoc
      • Custom script: call RemoveLocation(udg_TempPoint)
    • Else - Actions
Remember that a "leak" only happens when you can no longer reference the object which allows you to manipulate it. This Location will be sitting in the memory but that's is fine if you're planning on reusing it.

Currently you are are effectively leaking a point each time a unit is created because the code says create a new location at Player Red Start Location, but its not saved so you cannot then destroy it. I think you're getting tripped up thinking that Start Locations are just globals the game is continuously referencing. That is not the case.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
The if statement doesn't become active until that wave number

so...... your wrong
People are telling you is to do this:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Condition
    • Then - Actions
      • Set TempPoint = Center of Whatever
      • Set TempPoint2 = (Player 1 (Red) start location)
      • Unit - Create 1 Footman for Player 1 (Red) at TempPoint facing TempPoint2
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
    • Else - Actions
I suppose if you are reusing Start Locations:

You could save it and then just always have it.

  • //somewhere else
  • Set RedsStartingLoc = (Player 1 (Red) start location)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Condition
    • Then - Actions
      • Set TempPoint = Center of Whatever
      • Unit - Create 1 Footman for Player 1 (Red) at TempPoint facing RedsStartingLoc
      • Custom script: call RemoveLocation(udg_TempPoint)
    • Else - Actions
Remember that a "leak" only happens when you can no longer reference the object which allows you to manipulate it. This Location will be sitting in the memory but that's is fine if you're planning on reusing it.

Currently you are are effectively leaking a point each time a unit is created because the code says create a new location at Player Red Start Location, but its not saved so you cannot then destroy it. I think you're getting tripped up thinking that Start Locations are just globals the game is continuously referencing. That is not the case.
Really?

Hmm.... I'm sure I read in a thread before that start locations do not leak. I'm just going to check it up for certain
 

Deleted member 219079

D

Deleted member 219079

You're right, native GetPlayerStartLocation takes player whichPlayer returns integer returns an integer. :)

But you're using this: constant native GetStartLocationLoc takes integer whichStartLocation returns location
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I would actually think that is not a leak, considering the signature is as follows (suggesting it returns a reference):
JASS:
constant native integer GetStartLocationLoc takes integer whichStartLocation returns location
However if experienced people say it is, then listen to them.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
You can check if it can leak simply by calling it twice for the same start location and testing if the two locations returned are equal. If they are then there cannot be a leaks it returns a constant location object. If they are not equal they are different handles and hence the native creates a new location each time which can leak unless removed.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
You can check if it can leak simply by calling it twice for the same start location and testing if the two locations returned are equal. If they are then there cannot be a leaks it returns a constant location object. If they are not equal they are different handles and hence the native creates a new location each time which can leak unless removed.

Testing it now.... will submit a test map when done
http://www.hiveworkshop.com/attachments/startloccheck-w3x.255298/
As you can see in this map, the start location does not change

Therefore my trigger does not leak
and furthermore this proves the Jass Checker doesn't work on if statemenets
 
Last edited:

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
539
JASS:
call BJDebugMsg(I2S(GetHandleId(GetStartLocationLoc(0))))
call BJDebugMsg(I2S(GetHandleId(GetStartLocationLoc(0))))

this prints two different integers, so each call to GetStartLocationLoc creates a new loaction and therefore needs to be cleaned up.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
Here's another way to test (as suggested by DSG):
JASS:
library Test

    private struct S
       
        private static method action takes nothing returns nothing
            local location l1 = GetStartLocationLoc(0)
            local location l2 = GetStartLocationLoc(0)
            if l1 != l2 then
                call BJDebugMsg("GetStartLocationLoc creates a new location and is NOT a pointer")
            endif
            call RemoveLocation(l1)
            call RemoveLocation(l2)
            set l1 = null
            set l2 = null
            call DestroyTimer(GetExpiredTimer())
        endmethod
       
        private static method onInit takes nothing returns nothing
            call TimerStart(CreateTimer(), 0.0, false, function thistype.action)
        endmethod
       
    endstruct
   
endlibrary

Result: It prints out the debug message.

Btw, this wouldn't have happened if you avoided locations in the first place and use reals (GetStartLocationX and GetStartLocationY) instead.

Why are you using GUI anyway?
I program for a living, such as yourself though partly... You and I both know the Jasschecker can be fixed
Someone who programs for a living can easily transition to JASS or vJASS so I suggest go do that.
 

Attachments

  • Test.w3m
    16.4 KB · Views: 81

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
Testing it now.... will submit a test map when done
http://www.hiveworkshop.com/attachments/startloccheck-w3x.255298/
As you can see in this map, the start location does not change
How does...
  • create wisp
    • Events
      • Time - Every 4.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 Wisp for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Test anything?!

Just because it works does not mean it returns the same location object. As both LeP and Flux have shown it most certainly does return a new location object every call. As such one has to remove this location object before losing all references to it or it will leak. Yes the location object returned references the same point of the map, but no it is not the same location object each call.
 
Status
Not open for further replies.
Top