From 033627a31c97f95d76d559cb0522e9abc8977222 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Tue, 6 Dec 2011 10:51:56 +0000
Subject: [PATCH] Unlearning Vile Poisons will unsustain lost poisons

git-svn-id: http://svn.net-core.org/repos/t-engine4@4718 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/class/Actor.lua                  | 4 ++++
 game/modules/tome/data/talents/cunning/poisons.lua | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua
index 708d54a711..ef45620107 100644
--- a/game/modules/tome/class/Actor.lua
+++ b/game/modules/tome/class/Actor.lua
@@ -2255,6 +2255,10 @@ function _M:unlearnTalent(t_id)
 			self:unlearnTalent(key)
 		end
 	end
+
+	-- Unsustain ?
+	if not self:knowTalent(t_id) and t.mode == "sustained" then self:forceUseTalent(t_id, {ignore_energy=true}) end
+
 	return true
 end
 
diff --git a/game/modules/tome/data/talents/cunning/poisons.lua b/game/modules/tome/data/talents/cunning/poisons.lua
index 9c019bbb60..4d42c076b6 100644
--- a/game/modules/tome/data/talents/cunning/poisons.lua
+++ b/game/modules/tome/data/talents/cunning/poisons.lua
@@ -47,8 +47,8 @@ newTalent{
 	on_unlearn = function(self, t)
 		local lev = self:getTalentLevelRaw(t)
 		if lev == 0 then
-			self.vile_poisons = nil
 			self:unlearnTalent(self.T_DEADLY_POISON)
+			self.vile_poisons = nil
 		elseif lev == 1 then
 			self:unlearnTalent(self.T_NUMBING_POISON)
 		elseif lev == 2 then
@@ -90,7 +90,7 @@ newTalent{
 			local e = target.tempeffect_def[eff_id]
 			if e.subtype.poison then nb = nb + 1 end
 		end
-		return { NATURE = nb}		
+		return { NATURE = nb}
 	end },
 	action = function(self, t)
 		local tg = {type="hit", range=self:getTalentRange(t)}
-- 
GitLab