ModDota / BugTracker

Listing bugs for Dota 2 Custom Games
9 stars 1 forks source link

Trying to execute an ability from code with custom cast error will result in a weird bug #144

Closed XavierCHN closed 6 years ago

XavierCHN commented 6 years ago

ExecuteOrderFromTable

ExecuteOrderFromTable({
    OrderType = DOTA_UNIT_ORDER_CAST_POSITION,
    UnitIndex = hero:entindex(),
    Position = Vector(x, y, z),
    AbilityIndex = ability:entindex()
})

Lua ability code:

function myAbility:CastFilterResultLocation(vLocation)
    if self:GetCaster():GetTeamNumber() == DOTA_TEAM_GOODGUYS and vLocation.y > 0 then
        return UF_FAIL_CUSTOM
    end
    return UF_SUCCESS
end

function myAbility:GetCustomCastErrorLocation(vLocation)
    if self:GetCaster():GetTeamNumber() == DOTA_TEAM_GOODGUYS and vLocation.y > 0 then
        return '#hud_error_cast_on_our_side_only'
    end
    return UF_SUCCESS
end

Error Message:

[   Developer              ]: Game code tried to execute a custom invalid order: #hud_error_cast_on_our_side_only