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

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