• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

TriggerRegisterEnterRegion Question

Status
Not open for further replies.
Level 19
Joined
Mar 18, 2012
Messages
1,716
That's a fact:
Events are never destroyed. When a unit event is registered to a trigger and that unit no longer exists, the event remains.

My Question is:

call TriggerRegisterEnterRegion(myTrigger, myRegion, null) call TriggerAddCondition(Condition(function thistype.myFunction))

in the function myFunction I remove and null myRegion and destroy myTrigger, is there an remaining Event or not?
 
Level 12
Joined
Oct 16, 2010
Messages
680
I don't really know about the hardcoded part of this but I don't think the trigger "contains" the event. IMO the event remains.based on my programming knowledge events shouldn't be removed anyways:/

For example: you have 2 triggers with the same event. Those events are actually the very same, so u have 1 event with 2 registered triggers. When an event occures it calls every trigger that is registered for it.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
It shouldn't remain, but you can test it just to be sure, create a thousand of that and monitor warcraft 3's memory in the task manager (if you're on windows). Then destroy it (via timers) and check the memory being used if it drops.
 
Status
Not open for further replies.
Top