-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Zeus ultimate #105
Fix Zeus ultimate #105
Conversation
Fixes various programming errors, especially: - Avoiding the misbehaving Linq "Remove()" function - Handling bots becoming "null" when we lose vision Reorganized to track targets across interruptions (silence, stun, etc) Lots of explanatory variables and comments added Mostly follows original intended behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really need to remove the misbehaving Linq "Remove()" function, I have seen many similar errors in the console before.
ability_item_usage_zuus.lua
Outdated
@@ -19,9 +19,13 @@ end | |||
local Talents = {} | |||
local Abilities = {} | |||
local AbilitiesReal = {} | |||
npcBot.ult = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some comments to that variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
then | ||
return BOT_ACTION_DESIRE_NONE | ||
end | ||
if enemyBot:IsNull() then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a function IsNull() in Lua language? The general usage seems to be enemyBot == nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think IsNull() comes from the C interface. Wherever it's from, it detects when a bot object exists but is no longer valid. From what I can see, when a bot goes out of vision, its object loses all of its API functions, but is not nil. E.g. calling enemyBot:GetUnitName will return an error. This is only really an issue when keeping track of bots across frames.
I assume the reason it works this way is to prevent you from keeping track of the real hero by just tracking the object id. Interestingly, it seems dying does not cause the object to be cleared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get it, this is really interesting.
I'll submit a fix for it. It probably won't fix much, because anything using it wasn't properly tested, but it will be one less bug. |
Fixes #103