Page 1 of 1

[svn2427] ActorTalents:unlearnTalent edge-case

Posted: Wed Jan 19, 2011 6:59 am
by yufra
In the event that unlearnTalent is called on an unkown talent this will bomb (particularly line 273). The documentation indicates the functions should check for errors, but doesn't appear to right now. How about adding this near the top of the function?

Code: Select all

if not self:knowTalent(t_id) then
    local msg = ([[[TALENT] cannot unlearn %s (%s, %d)]]):format(t.name, t.short_name, t_id)
    print(msg)
    return false, msg
end

Re: [svn2427] ActorTalents:unlearnTalent edge-case

Posted: Wed Jan 19, 2011 8:25 pm
by darkgod
done