Skip to content
Snippets Groups Projects
Commit 056e4443 authored by dg's avatar dg
Browse files

fixes numbering in pickupfloor and chat

git-svn-id: http://svn.net-core.org/repos/t-engine4@685 51575b47-30f0-44d4-a5cc-537603b46e54
parent 0f37f423
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment