diff --git a/game/engine/Zone.lua b/game/engine/Zone.lua index 779433551295036dc8874f138653b8ac5ee78dbd..e01268106c2dcd2120b04359834b8c692b553140 100644 --- a/game/engine/Zone.lua +++ b/game/engine/Zone.lua @@ -485,8 +485,8 @@ function _M:newLevel(level_data, lev, old_lev, game) -- Check for connectivity from entrance to exit local a = Astar.new(map, game:getPlayer()) - if ux and uy and dx and dy and not a:calc(ux, uy, dx, dy) then - print("Level unconnected, no way from entrance to exit") + if ux and uy and dx and dy and (ux ~= dx or uy ~= dy) 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) end @@ -499,7 +499,7 @@ function _M:newLevel(level_data, lev, old_lev, game) else cx, cy = spot.check_connectivity.x, spot.check_connectivity.y end - if not a:calc(spot.x, spot.y, cx, cy) then + if spot.x and spot.y and cx and cy and (spot.x ~= cx or spot.y ~= cy) and not a:calc(spot.x, spot.y, cx, cy) then print("Level unconnected, no way from", spot.x, spot.y, "to", cx, cy) level:removed() return self:newLevel(level_data, lev, old_lev, game) diff --git a/game/modules/tome/data/zones/test/zone.lua b/game/modules/tome/data/zones/test/zone.lua index 4d8f0862585fe274e6d89daa8a5103f24c071913..4039e72833051798d0e0fc8958e7169c6d9927a8 100644 --- a/game/modules/tome/data/zones/test/zone.lua +++ b/game/modules/tome/data/zones/test/zone.lua @@ -18,19 +18,19 @@ -- darkgod@te4.org return { - name = "Mines of Moria", - level_range = {20, 30}, + name = "TestZone!", + level_range = {1, 1}, level_scheme = "player", max_level = 4, decay = {300, 800}, actor_adjust_level = function(zone, level, e) return zone.base_level + e:getRankLevelAdjust() + level.level-1 + rng.range(-1,2) end, width = 50, height = 50, --- all_remembered = true, + all_remembered = true, all_lited = true, -- persistant = "zone", generator = { map = { - class = "engine.generator.map.Forest", + class = "engine.generator.map.GOL", edge_entrances = {4,6}, floor = "GRASS", wall = "TREE", diff --git a/game/modules/tome/data/zones/trollshaws/zone.lua b/game/modules/tome/data/zones/trollshaws/zone.lua index 93d440940984a80d38e6413d3db64258f4c4c8a0..004cfd090da92f7948ffc0b6f99a8cc0903d30b7 100644 --- a/game/modules/tome/data/zones/trollshaws/zone.lua +++ b/game/modules/tome/data/zones/trollshaws/zone.lua @@ -35,7 +35,7 @@ return { edge_entrances = {4,6}, zoom = 5, noise = "fbm_perlin", - floor = function() if rng.chance(20) then return "FLOWER" else return "GRASS" end end,, + floor = function() if rng.chance(20) then return "FLOWER" else return "GRASS" end end, wall = "TREE", up = "UP", down = "DOWN",