From d95ba786947f7cf57adf53355989ce0d52bd7053 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Fri, 20 Jun 2014 12:48:57 -0700 Subject: [PATCH] Updated dark wizard tower init to work. --- hack/mods/dark wizard tower/darkWizardTower.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hack/mods/dark wizard tower/darkWizardTower.lua b/hack/mods/dark wizard tower/darkWizardTower.lua index 3a6008b..d060567 100644 --- a/hack/mods/dark wizard tower/darkWizardTower.lua +++ b/hack/mods/dark wizard tower/darkWizardTower.lua @@ -3,7 +3,12 @@ local fantasticEvents=require('fantastic.events') fantasticEvents.enableEvent("UNIT_SPAWNED",50) local function getMarkedUnit() - return df.unit.find(dfhack.persistent.get('CHOSEN_ONE_FOR_SITE_'..df.global.ui.site_id).ints[1]) + local markPersistent='CHOSEN_ONE_FOR_SITE_'..df.global.ui.site_id + if dfhack.persistent.get(markPersistent) then + return df.unit.find(dfhack.persistent.get('CHOSEN_ONE_FOR_SITE_'..df.global.ui.site_id).ints[1]) + else + return nil + end end local function insertSkill(unit,skill) @@ -105,4 +110,4 @@ local checkAnyway=function() end end -dfhack.timeout(30,'ticks',checkAnyway) \ No newline at end of file +dfhack.timeout(100,'ticks',checkAnyway) \ No newline at end of file