- Joined
- Mar 9, 2023
- Messages
- 75
Hi! I have a situation where a trigger which when a button is clicked, gives the player one hero, will sometimes spawn an additional hero. I cannot replicate it, as "double clicking" it is seemingly impossible. I have tried writing a conditional check in the jass script to no avail, and tried a few GUI solutions like hooking up the function to a removal trigger, but have not made it work just yet. I have received the recommendation for a condition checking if the player has more than 1 unit/hero during the "hero pick", but since I'm bad I have not yet made sense of it. Does anyone have a solution off the bat or do I just bruteforce awful workarounds?
Edit: "Probably" solved with the helpful comments! Added a check between the code, and a true boolean in the middle. Hope it will work!
Edit: "Probably" solved with the helpful comments! Added a check between the code, and a true boolean in the middle. Hope it will work!
JASS:
if udg_Hero[GetPlayerId(GetTriggerPlayer())] == null then
endif
Last edited: