[1.0 SVN] Unable to unlearn all allowed talents

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

[1.0 SVN] Unable to unlearn all allowed talents

#1 Post 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
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

aardvark
Wyrmic
Posts: 200
Joined: Wed Aug 22, 2012 12:16 am

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

#2 Post by aardvark »

You're several svn revisions behind. darkgod fixed this in r6407.

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

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

#3 Post by Hachem_Muche »

Wow. you're right. For some reason, SVN stopped updating only this file. Sorry for the bug spam. :?
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

Post Reply