From 11ab8323a79abb6a44147ca63a9b33f93b830309 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Mon, 4 Jun 2012 20:48:17 +0000
Subject: [PATCH] Eternal Bone Giants will not ressurect 5 times

git-svn-id: http://svn.net-core.org/repos/t-engine4@5180 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/engines/default/engine/Map.lua                    | 2 +-
 game/engines/default/engine/interface/ActorTalents.lua | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/game/engines/default/engine/Map.lua b/game/engines/default/engine/Map.lua
index 1a02358731..74f64bcc3d 100644
--- a/game/engines/default/engine/Map.lua
+++ b/game/engines/default/engine/Map.lua
@@ -946,7 +946,7 @@ function _M:processEffects()
 			for ly, _ in pairs(ys) do
 				local act = game.level.map(lx, ly, engine.Map.ACTOR)
 				if act and act == e.src and not ((type(e.selffire) == "number" and rng.percent(e.selffire)) or (type(e.selffire) ~= "number" and e.selffire)) then
-				elseif act and e.src and e.src.reactionToward and (e.src:reactionToward(act) >= 0) and not ((type(e.friendlyfire) == "number" and rng.percent(typ.friendlyfire)) or (type(e.friendlyfire) ~= "number" and e.friendlyfire)) then
+				elseif act and e.src and e.src.reactionToward and (e.src:reactionToward(act) >= 0) and not ((type(e.friendlyfire) == "number" and rng.percent(e.friendlyfire)) or (type(e.friendlyfire) ~= "number" and e.friendlyfire)) then
 				-- Otherwise hit
 				else
 					DamageType:get(e.damtype).projector(e.src, lx, ly, e.damtype, e.dam)
diff --git a/game/engines/default/engine/interface/ActorTalents.lua b/game/engines/default/engine/interface/ActorTalents.lua
index 8068c4ba5b..8c8dbc6313 100644
--- a/game/engines/default/engine/interface/ActorTalents.lua
+++ b/game/engines/default/engine/interface/ActorTalents.lua
@@ -291,9 +291,10 @@ function _M:learnTalent(t_id, force, nb)
 		end
 	end
 
-	self.talents[t_id] = (self.talents[t_id] or 0) + (nb or 1)
-
-	if t.on_learn then for i = 1, (nb or 1) do t.on_learn(self, t) end end
+	for i = 1, (nb or 1) do 
+		self.talents[t_id] = (self.talents[t_id] or 0) + 1
+		if t.on_learn then t.on_learn(self, t) end
+	end
 
 	self.changed = true
 	return true
-- 
GitLab