Closed MatthewSH closed 4 years ago
I remember running into this issue. I can't remember if there were some occurrences where writing just the hero name was required (maybe Hero Of(...)), but I could alias each of the heroes into Hero(hero_name) as long as there are no conflicts. This will render the Hero() function obsolete.
Maybe if it's not preceded by another function that wouldn't require the Hero
call, then we can alias it? Or at least add a warning or error when trying to compile your code about it.
The implementation I went with is that Hero(...)
with a hero name is optional. The following produce the same result:
Set Hero(Everyone, Doomfist)
Set Hero(Everyone, Hero(Doomfist))
When tinkering with a new gamemode, I need to set a variable to a Hero. So by default you'd think it could be done like this:
gvar hero = Winston
...this compiles like:This is invalid. Every reference to a specific hero is wrapped in
Hero()
. To set the above, the following code is valid: