• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

boolean for dying unit is being built?

Status
Not open for further replies.
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