From 6a3494397d1d844f1b71669fbc8145e5c311e7a5 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Mon, 5 Dec 2011 15:22:20 +0000
Subject: [PATCH] fixes

Maybe finally fixed disappearing zones; please keep your eyes open


git-svn-id: http://svn.net-core.org/repos/t-engine4@4708 51575b47-30f0-44d4-a5cc-537603b46e54
---
 .../default/engine/dialogs/ShowAchievements.lua        |  2 +-
 game/modules/tome/class/Actor.lua                      |  2 ++
 game/modules/tome/class/NicerTiles.lua                 |  8 +++++++-
 game/modules/tome/data/chats/temporal-rift-end.lua     | 10 ++++++----
 game/modules/tome/data/talents/psionic/grip.lua        |  2 +-
 game/modules/tome/dialogs/ShowEquipment.lua            |  2 +-
 6 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/game/engines/default/engine/dialogs/ShowAchievements.lua b/game/engines/default/engine/dialogs/ShowAchievements.lua
index 573d8c2e64..413c30759c 100644
--- a/game/engines/default/engine/dialogs/ShowAchievements.lua
+++ b/game/engines/default/engine/dialogs/ShowAchievements.lua
@@ -159,7 +159,7 @@ function _M:generateList(kind)
 		end
 	end
 	if kind == "self" and self.player and self.player.achievements then
-		for id, data in pairs(self.player.achievements) do handle(id, world.achieved[id]) end
+		for id, data in pairs(self.player.achievements) do handle(id, world.achieved[id] or {notdone=true, when="--", who="--"}) end
 	elseif kind == "main" then
 		for id, data in pairs(world.achieved) do handle(id, data or {notdone=true, when="--", who="--"}) end
 	elseif kind == "all" then
diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua
index 394eb7c1f8..2c35bdac2e 100644
--- a/game/modules/tome/class/Actor.lua
+++ b/game/modules/tome/class/Actor.lua
@@ -2755,6 +2755,8 @@ end
 --- Return the full description of a talent
 -- You may overload it to add more data (like power usage, ...)
 function _M:getTalentFullDescription(t, addlevel, config)
+	if not t then return tstring{"no talent"} end
+
 	config = config or {}
 	local old = self.talents[t.id]
 	if config.force_level then
diff --git a/game/modules/tome/class/NicerTiles.lua b/game/modules/tome/class/NicerTiles.lua
index ec6dbb1dba..5d9c969597 100644
--- a/game/modules/tome/class/NicerTiles.lua
+++ b/game/modules/tome/class/NicerTiles.lua
@@ -75,7 +75,13 @@ end
 function _M:replaceAll(level)
 	for i = 1, #self.repl do
 		local r = self.repl[i]
-		level.map(r[1], r[2], Map.TERRAIN, r[3])
+		-- Safety check
+		local og = level.map(r[1], r[2], Map.TERRAIN)
+		if og and (og.change_zone or og.change_level) then
+			print("[NICE TILER] *warning* refusing to remove zone/level changer at ", r[1], r[2], og.change_zone, og.change_level)
+		else
+			level.map(r[1], r[2], Map.TERRAIN, r[3])
+		end
 	end
 	self.repl = {}
 
diff --git a/game/modules/tome/data/chats/temporal-rift-end.lua b/game/modules/tome/data/chats/temporal-rift-end.lua
index 758b83270b..330c407b68 100644
--- a/game/modules/tome/data/chats/temporal-rift-end.lua
+++ b/game/modules/tome/data/chats/temporal-rift-end.lua
@@ -25,10 +25,12 @@ I cannot stay. I still have much to do. But take this-- it should help you.
 	answers = {
 		{"Ok...", action = function(npc, player)
 			local o = game.zone:makeEntityByName(game.level, "object", "RUNE_RIFT")
-			o:identify(true)
-			game.zone:addEntity(game.level, o, "object")
-			player:addObject(player.INVEN_INVEN, o)
-			game.log("The temporal warden gives you: %s.", o:getName{do_color=true})
+			if o then
+				o:identify(true)
+				game.zone:addEntity(game.level, o, "object")
+				player:addObject(player.INVEN_INVEN, o)
+				game.log("The temporal warden gives you: %s.", o:getName{do_color=true})
+			end
 
 			game:setAllowedBuild("chronomancer")
 			game:setAllowedBuild("chronomancer_temporal_warden", true)
diff --git a/game/modules/tome/data/talents/psionic/grip.lua b/game/modules/tome/data/talents/psionic/grip.lua
index 4ff3113697..300444d355 100644
--- a/game/modules/tome/data/talents/psionic/grip.lua
+++ b/game/modules/tome/data/talents/psionic/grip.lua
@@ -135,7 +135,7 @@ newTalent{
 		local x, y = self:getTarget(tg)
 		if not x or not y then return nil end
 		self:project(tg, x, y, DamageType.IMPLOSION, {dur=dur, dam=dam})
-		target:crossTierEffect(target.EFF_OFFBALANCE, self:combatMindpower())
+--		target:crossTierEffect(target.EFF_OFFBALANCE, self:combatMindpower())
 
 		return true
 	end,
diff --git a/game/modules/tome/dialogs/ShowEquipment.lua b/game/modules/tome/dialogs/ShowEquipment.lua
index b04a37c4cf..238d1ebb96 100644
--- a/game/modules/tome/dialogs/ShowEquipment.lua
+++ b/game/modules/tome/dialogs/ShowEquipment.lua
@@ -56,7 +56,7 @@ function _M:init(title, actor, filter, action)
 	}
 	self.key:addBinds{
 		ACCEPT = function()
-			self:use(self.c_list.list[self.c_list.sel])
+--			self:use(self.c_list.list[self.c_list.sel])
 		end,
 		EXIT = function() game:unregisterDialog(self) end,
 	}
-- 
GitLab