From 7d1aee893911919a79d7aeef80822b36bfaa090c Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Sun, 27 Nov 2011 23:35:39 +0000
Subject: [PATCH] Correctly compute encumbrance

git-svn-id: http://svn.net-core.org/repos/t-engine4@4682 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/class/Actor.lua                | 13 ++++++-------
 game/modules/tome/class/Player.lua               |  2 ++
 game/modules/tome/class/interface/PlayerLore.lua |  1 -
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua
index 5df3d19a1e..d1b5ced6e5 100644
--- a/game/modules/tome/class/Actor.lua
+++ b/game/modules/tome/class/Actor.lua
@@ -1935,7 +1935,7 @@ function _M:getEncumbrance()
 	-- Compute encumbrance
 	for inven_id, inven in pairs(self.inven) do
 		for item, o in ipairs(inven) do
-			if not o.__transmo then
+			if not o.__transmo and not o.__transmo_pre then
 				o:forAllStack(fct)
 			end
 		end
@@ -3098,14 +3098,13 @@ function _M:on_set_temporary_effect(eff_id, e, p)
 		p.dur = util.bound(duration, p.minimum or 0, p.maximum)
 		p.amount_decreased = p.maximum - p.dur
 		local save_type = nil
+
 		if p.apply_save then save_type = p.apply_save else save_type = save_for_effects[e.type] end
-		if save_type == "combatPhysicalResist"
-			then p.save_string = "Physical save"
-		elseif save_type == "combatMentalResist"
-			then p.save_string = "Mental save"
-		elseif save_type == "combatSpellResist"
-			then p.save_string = "Spell save"
+		if save_type == "combatPhysicalResist" then p.save_string = "Physical save"
+		elseif save_type == "combatMentalResist" then p.save_string = "Mental save"
+		elseif save_type == "combatSpellResist" then p.save_string = "Spell save"
 		end
+
 		if not p.no_ct_effect and not e.no_ct_effect and e.status == "detrimental" then self:crossTierEffect(eff_id, p.apply_power, p.apply_save or save_for_effects[e.type]) end
 		p.total_dur = p.dur
 		p.apply_power = nil
diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua
index 5774885ca7..5e7f87ae4e 100644
--- a/game/modules/tome/class/Player.lua
+++ b/game/modules/tome/class/Player.lua
@@ -169,10 +169,12 @@ function _M:describeFloor(x, y)
 			local desc = true
 			if obj.auto_pickup and self:pickupFloor(i, true) then desc = false end
 			if desc and self:attr("has_transmo") and obj.__transmo == nil and (not obj.quest and not obj.plot) then
+				obj.__transmo_pre = true
 				if self:pickupFloor(i, true) then
 					desc = false
 					obj.__transmo = true
 				end
+				obj.__transmo_pre = nil
 			end
 			if desc then
 				if self:attr("auto_id") and obj:getPowerRank() <= self.auto_id then obj:identify(true) end
diff --git a/game/modules/tome/class/interface/PlayerLore.lua b/game/modules/tome/class/interface/PlayerLore.lua
index 9acbcc28df..6ce1101a11 100644
--- a/game/modules/tome/class/interface/PlayerLore.lua
+++ b/game/modules/tome/class/interface/PlayerLore.lua
@@ -81,7 +81,6 @@ function _M:learnLore(lore, nopopup, silent)
 		game.logPlayer(self, "Lore found: #0080FF#%s", l.name)
 		if not nopopup then
 			LorePopup.new(l, game.w * 0.6, 0.8)
---			game.logPlayer(self, "#ANTIQUE_WHITE#%s", util.getval(l.lore))
 			game.logPlayer(self, "You can read all your collected lore in the game menu, by pressing Escape.")
 		end
 		learnt = true
-- 
GitLab