Page 1 of 1

[1.0 SVN] Unable to unlearn all allowed talents

Posted: Sat Feb 16, 2013 8:51 pm
by Hachem_Muche
The game loses track of which talents you can properly unlearn. This is caused by a bug in the talent unlearn code that incorrectly depopulates the last_learnt_talents lists because the extra.no_unlearn parameter is not recognized.

Fix:

Code: Select all

Index: game/modules/tome/class/Actor.lua
===================================================================
--- game/modules/tome/class/Actor.lua	(revision 6354)
+++ game/modules/tome/class/Actor.lua	(working copy)
@@ -3180,12 +3186,13 @@
 --- Actor forgets a talent
 -- @param t_id the id of the talent to learn
 -- @return true if the talent was unlearnt, nil and an error message otherwise
-function _M:unlearnTalent(t_id, nb, no_unsustain)
+function _M:unlearnTalent(t_id, nb, no_unsustain, extra)
 	if not engine.interface.ActorTalents.unlearnTalent(self, t_id, nb) then return false end
 
+	extra = extra or {}
 	local t = _M.talents_def[t_id]
 
-	if not t.no_unlearn_last and self.last_learnt_talents then
+	if not t.no_unlearn_last and self.last_learnt_talents and not extra.no_unlearn then
 		local list = t.generic and self.last_learnt_talents.generic or self.last_learnt_talents.class
 		for i = #list, 1, -1 do
 			if list[i] == t_id then table.remove(list, i) break end

Re: [1.0 SVN] Unable to unlearn all allowed talents

Posted: Sat Feb 16, 2013 9:17 pm
by aardvark
You're several svn revisions behind. darkgod fixed this in r6407.

Re: [1.0 SVN] Unable to unlearn all allowed talents

Posted: Sat Feb 16, 2013 9:59 pm
by Hachem_Muche
Wow. you're right. For some reason, SVN stopped updating only this file. Sorry for the bug spam. :?