RegionAddRect crashes map?

Zwiebelchen

You can change this now in User CP.
Reaction score
60
Errr ... I'm confused. For some odd reason, RegionAddRect() crashes my map after loading.

This is what I tried at first:

JASS:

library Init initializer bla

globals
  region Dungeons = CreateRegion()
  region City = CreateRegion()
endglobals

function bla takes nothing returns nothing
  call RegionAddRect(Dungeons, gg_rct_A)
  call RegionAddRect(Dungeons, gg_rct_B)
  call RegionAddRect(City, gg_rct_C)
  call RegionAddRect(City, gg_rct_D)
endfunction

endlibrary


It crashed my map, so I tried doing this:
JASS:

library Init initializer bla

globals
  region Dungeons = CreateRegion()
  region City = CreateRegion()
endglobals

function blacallback takes nothing returns nothing
  call RegionAddRect(Dungeons, gg_rct_A)
  call RegionAddRect(Dungeons, gg_rct_B)
  call RegionAddRect(City, gg_rct_C)
  call RegionAddRect(City, gg_rct_D)
  call DestroyTimer(GetExpiredTimer())
endfunction

function bla takes nothing returns nothing
  call TimerStart(CreateTimer(), 1, false, function blacallback)
endfunction

endlibrary

But this also crashes. If I comment out the RegionAddRect(...), then it works fine.
All rects I refer to exist and have the names A,B,C and D.
Any ideas what could be the problem?

Also, for some reason, this works:
[ljass]call RegionAddRect(Dungeons, null)[/ljass]
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Thanks. It works now.

Fucking bugs all the time. Couldn't blizzard think of this?! :nuts:

In a more general way i don't use native functions (and ofc not custom ones neither ...) for a global variable initialization, it's not the only one who doesn't work properly. (can't remember which ones though)
 
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