脚本导致冻结问题

时间:2018-02-22 19:51:09

标签: function return

我已经重写了这个脚本我已经接手了一段时间,并花了这么多时间筛选清理它的所有线路。在脚本使用后,我仍然在赛后的比赛中冻结。我以为我修复了所有的语法和if语句,但显然它在使用后仍然有相同的冻结问题。这是脚本的一部分,我将其缩小到可以节省每个人的时间。

-- does include gold of recipes
function EconPanel.GetEcon(hero)
local totalEcon = 0
local slotNum = 9
for i = 0, slotNum-1 do
    myItem = NPC.GetItemByIndex(hero, i) -- index starts from 0
    if myItem then
        itemName = Ability.GetName(myItem)
        if EconPanel.item2price[itemName] then -- database includes all itemName, such as recipes.
            totalEcon = totalEcon + EconPanel.item2price[itemName]
        end
    end
end

return totalEcon
end

return EconPanel

0 个答案:

没有答案
相关问题