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

Power tread switching (7.33) #82

Open
Stuball3D opened this issue Apr 22, 2023 · 1 comment
Open

Power tread switching (7.33) #82

Stuball3D opened this issue Apr 22, 2023 · 1 comment

Comments

@Stuball3D
Copy link

Stuball3D commented Apr 22, 2023

While playing a couple games, the Vengeful Spirit bot would continuously cycle through power treads.

I suspect (guess?) the cause is the new Universal attribute type. Within the "ItemUsuage-New.lua" (lines 277-313) behavior for tread switching and switching desire is defined. If treads are not on the primary attribute, a switch is initiated. Since these heroes apparently have no primary attribute, or returns an unrecognized attribute, an infinite loop is initiated.

I don't know too much about how all of this is coded - so I can't suggest a fix at the moment. (Default to strength maybe?) But I imagine 7.33 is going to break a lot of interactions.

local function GetWantedPowerTreadsAttribute()
        if mode == BOT_MODE_RETREAT and npcBot:WasRecentlyDamagedByAnyHero(3) then
            return ATTRIBUTE_STRENGTH
        elseif fun1:IsAttackingEnemies(npcBot) then
            local name = npcBot:GetUnitName()
            name = fun1:GetHeroShortName(name)
            if fun1:Contains({
                "obsidian_destroyer",
                "silencer",
                "huskar",
                "drow_ranger",
            }, name) then
                return npcBot:GetPrimaryAttribute()
            else
                return ATTRIBUTE_AGILITY
            end
        elseif mode == BOT_MODE_LANING then
            return npcBot:GetPrimaryAttribute()
        else
            return npcBot:GetPrimaryAttribute()
        end
    end

    local function UsePowerTreads(treads)
        if math.floor(DotaTime()) / 4 ~= 0 then
            return
        end
        if npcBot:IsInvisible() and npcBot:UsingItemBreaksInvisibility() then
            if npcBot:HasModifier("modifier_item_dustofappearance") then
                M.UseItemNoTarget(npcBot, treads)
                return true
            end
            return
        end
        if GetWantedPowerTreadsAttribute() ~= treads:GetPowerTreadsStat() then
            M.UseItemNoTarget(npcBot, treads)
            return true
        end
@Stuball3D Stuball3D changed the title Power tread switching Power tread switching (7.33) Apr 22, 2023
@adamqqqplay
Copy link
Owner

@Stuball3D Thanks for the feedback! I've seen this wrong behavior before, but didn't find the cause. We will fix it in the next version.

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

No branches or pull requests

2 participants