• 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.

Loading handle from dead unit

Status
Not open for further replies.
Level 10
Joined
May 24, 2016
Messages
339
Code:
if d == MortarUnitQuest then
call echo("dead quest")
call GroupRemoveUnit(QuestGroup,d)
call GroupClear(CryptSpidersGroup)
call DestroyGroup(CryptSpidersGroup)
call QuestSetFailed( CryptSpiders, true )
//call KillUnit( gg_unit_e00P_0278 )
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(MortarUnitQuest),StringHash("QuestMark")))
 call TriggerRemoveAction(CryptSpidersTrigger,LoadTriggerActionHandle(Hash,GetHandleId(CryptSpidersTrigger),0))
 call DestroyTrigger(CryptSpidersTrigger)

// call QuestSetFailed( CryptSpiders, true )
 call TriggerRemoveAction(gg_trg_CryptSpidersQuest,LoadTriggerActionHandle(Hash,GetHandleId(gg_trg_CryptSpidersQuest),0))
 call DestroyTrigger(gg_trg_CryptSpidersQuest)
endif
Yeah as you can see, I doubt myself is it valid to do. I found something in my map, when Iam entering of unit range event (in this case it's variable MortarUnitQuest), and then kills this unit, the map is probably going crazy just like I posted before.
 
Level 10
Joined
May 24, 2016
Messages
339
My gosh, I tested more, and now I feel like the problem is in
Code:
call GroupRemoveUnit(QuestGroup,d)
call GroupClear(CryptSpidersGroup)
call DestroyGroup(CryptSpidersGroup)
When I destroy this global groups. Dont know why, I only check in the same dead even trigger for CountsUnitInGroupBJ, so I know the group is destroyed now.
 
Status
Not open for further replies.
Top