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

boolean for dying unit is being built?

Status
Not open for further replies.

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
When you respond to death event, given unit has already lost it's progresses and it's status thus this method will not work.

You need to capture all buldings that are being built via _CONSTRUCT_START and remove them from group/clear the flag when _CONSTRUCT_FINISH/_CANCEL fires. Now when you are done with that, just check if unit is in group/flag and respond accordingly to _DEATH event.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
When you respond to death event, given unit has already lost it's progresses and it's status thus this method will not work.

You need to capture all buldings that are being built via _CONSTRUCT_START and remove them from group/clear the flag when _CONSTRUCT_FINISH/_CANCEL fires. Now when you are done with that, just check if unit is in group/flag and respond accordingly to _DEATH event.

Okey, thats how I'm doing it then. Do I really need to remove them on cancel though? If I don't it leaks I suppose.
 
Status
Not open for further replies.
Top