Skip to content
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

Merged
merged 2 commits into from
Jul 16, 2023
Merged

Conversation

JoshdanG
Copy link
Collaborator

@JoshdanG JoshdanG commented Jun 23, 2023

  1. Fixes various programming errors, especially:
  • Avoiding the misbehaving Linq "Remove()" function
  • Handling bots becoming "null" when we lose vision
  1. Reorganized to track targets across interruptions (silence, stun, etc)
  2. Lots of explanatory variables and comments added
  3. Mostly follows original intended behavior

Fixes #103

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
@JoshdanG JoshdanG changed the title Fix Zeus ultimate #103 Fix Zeus ultimate Jun 23, 2023
Copy link
Owner

@adamqqqplay adamqqqplay left a 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.

@@ -19,9 +19,13 @@ end
local Talents = {}
local Abilities = {}
local AbilitiesReal = {}
npcBot.ult = {}
Copy link
Owner

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?

Copy link
Collaborator Author

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
Copy link
Owner

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

Copy link
Collaborator Author

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.

Copy link
Owner

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.

@JoshdanG
Copy link
Collaborator Author

We really need to remove the misbehaving Linq "Remove()" function, I have seen many similar errors in the console before.

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.

@adamqqqplay adamqqqplay merged commit 0d18a98 into adamqqqplay:master Jul 16, 2023
@JoshdanG JoshdanG deleted the fix_zeus_ultimate branch July 23, 2023 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zeus not using ultimate
3 participants