Issue with wc3 crashing

Homer

New Member
Reaction score
2
I have this code that I'm working on. And It seems that it keeps crashing when i try to remove the unit. jass below

This works when I comment in the remove unit function.
JASS:
set i = 0
    loop
    exitwhen i>0
    if (GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING) then
        if (GetPlayerController(Player(i)) == MAP_CONTROL_USER) then
            
                set point = Location(GetUnitX(udg_selection_hero[i+1]),GetUnitY(udg_selection_hero[i+1]))
                call special_effect(fx,point)
                call BJDebugMsg("LOOP RAN")
                //call RemoveUnit(udg_selection_hero[i+1])
                
        endif
    endif
    set i = i + 1
    endloop


However, when it removes the unit it crashes the game. Any help will be appreciated.
 

Azlier

Old World Ghost
Reaction score
461
...What unit?

JASS:
set point = Location(GetUnitX(udg_selection_hero[i+1]),GetUnitY(udg_selection_hero[i+1]))


Most uselessly complicated use of location ever!

JASS:
set point = GetUnitLoc(udg_selection_hero[i+1])
 

Homer

New Member
Reaction score
2
Alright I changed that in my actual code, yet I am unable to remove the unit... When I uncomment the call RemoveUnit it crashes the game. I can move the unit but not remove it?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> exitwhen i > 0

Doesn't look like something that runs very often.


Is there a unit in that array?
Any other triggers that might be using it?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top