From 056e4443dac891e02d6e83fcc32868200928676f Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Tue, 25 May 2010 09:13:35 +0000 Subject: [PATCH] fixes numbering in pickupfloor and chat git-svn-id: http://svn.net-core.org/repos/t-engine4@685 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/engine/Zone.lua | 2 +- game/engine/dialogs/Chat.lua | 4 +++- game/engine/dialogs/ShowPickupFloor.lua | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/game/engine/Zone.lua b/game/engine/Zone.lua index 17eb274a66..33b5464ad0 100644 --- a/game/engine/Zone.lua +++ b/game/engine/Zone.lua @@ -488,7 +488,7 @@ function _M:newLevel(level_data, lev, old_lev, game) -- Check for connectivity from entrance to exit local a = Astar.new(map, game:getPlayer()) print("[LEVEL GENERATION] checking entrance to exit A*", ux, uy, "to", dx, dy) - if ux and uy and dx and dy and (ux ~= dx or uy ~= dy) and not spot.no_level_connectivity and not a:calc(ux, uy, dx, dy) then + if ux and uy and dx and dy and (ux ~= dx or uy ~= dy) and not spots.no_level_connectivity and not a:calc(ux, uy, dx, dy) then print("Level unconnected, no way from entrance to exit", ux, uy, "to", dx, dy) level:removed() return self:newLevel(level_data, lev, old_lev, game) diff --git a/game/engine/dialogs/Chat.lua b/game/engine/dialogs/Chat.lua index 24961363bf..24cc9096a9 100644 --- a/game/engine/dialogs/Chat.lua +++ b/game/engine/dialogs/Chat.lua @@ -104,9 +104,11 @@ function _M:generateList() -- Makes up the list local list = {} + local nb = 1 for i, a in ipairs(self.chat:get(self.cur_id).answers) do if not a.cond or a.cond(self.npc, self.player) then - list[#list+1] = { name=string.char(string.byte('a')+i-1)..") "..a[1], answer=i, color=a.color} + list[#list+1] = { name=string.char(string.byte('a')+nb-1)..") "..a[1], answer=i, color=a.color} + nb = nb + 1 end end self.list = list diff --git a/game/engine/dialogs/ShowPickupFloor.lua b/game/engine/dialogs/ShowPickupFloor.lua index 4ba6a246d8..d4b4f1daa0 100644 --- a/game/engine/dialogs/ShowPickupFloor.lua +++ b/game/engine/dialogs/ShowPickupFloor.lua @@ -79,7 +79,7 @@ function _M:generateList() local o = game.level.map:getObject(self.x, self.y, idx) if not o then break end if not self.filter or self.filter(o) then - list[#list+1] = { name=string.char(string.byte('a') + i)..") "..o:getName(), color=o:getDisplayColor(), object=o, item=idx } + list[#list+1] = { name=string.char(string.byte('a') + i - 1)..") "..o:getName(), color=o:getDisplayColor(), object=o, item=idx } i = i + 1 end idx = idx + 1 -- GitLab