summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-11-26 08:59:37 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-11-26 09:02:03 +1000
commit4e9088e3e1e500b31d321c696c67ade46df08b8c (patch)
treeecb63c90f61f36323087864d98948e429d95786f /crawl-ref/source
parentd14f7a3f2ff330c484789d1cd9a1082176b46e3b (diff)
downloadcrawl-ref-4e9088e3e1e500b31d321c696c67ade46df08b8c.tar.gz
crawl-ref-4e9088e3e1e500b31d321c696c67ade46df08b8c.zip
Fix wiz-mode Ziggurats not being properly initialised [BR2903984]
The code references the "portal" object (created in ziggurat_portal, which is also passed to the onclimb initialiser) which is not actually used for Wizard Mode portals. Fixed this by a) checking whether or not there was a portal included in the zig() "check to see if we're using &P", and also adding a parameter to to ziggurat_portal which just returns the actual portal.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/dat/clua/ziggurat.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/crawl-ref/source/dat/clua/ziggurat.lua b/crawl-ref/source/dat/clua/ziggurat.lua
index 52fa64b775..49ea42dd15 100644
--- a/crawl-ref/source/dat/clua/ziggurat.lua
+++ b/crawl-ref/source/dat/clua/ziggurat.lua
@@ -18,10 +18,11 @@ require("clua/lm_toll.lua")
ZIGGURAT_MAX = 27
function zig()
- if not dgn.persist.ziggurat or not dgn.persist.ziggurat.depth then
+ if not dgn.persist.ziggurat or not dgn.persist.ziggurat.depth or
+ not dgn.persist.ziggurat.portal then
dgn.persist.ziggurat = { }
-- Initialise here to handle ziggurats accessed directly by &P.
- initialise_ziggurat(dgn.persist.ziggurat)
+ initialise_ziggurat(dgn.persist.ziggurat, ziggurat_portal(nil, true))
end
return dgn.persist.ziggurat
end
@@ -90,7 +91,7 @@ local function zig_depth()
end
-- Common setup for ziggurat entry vaults.
-function ziggurat_portal(e)
+function ziggurat_portal(e, portal_only)
local d = crawl.roll_dice
local entry_fee =
10 * math.floor(200 + d(3,200) / 3 + d(10) * d(10) * d(10))
@@ -111,6 +112,10 @@ function ziggurat_portal(e)
}
end
+ if portal_only ~= nil then
+ return stair()
+ end
+
e.lua_marker("O", stair)
e.kfeat("O = enter_portal_vault")
end