Skip to content

Commit

Permalink
Updated dark wizard tower init to work.
Browse files Browse the repository at this point in the history
  • Loading branch information
Putnam3145 committed Jun 20, 2014
1 parent 70aaf64 commit d95ba78
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hack/mods/dark wizard tower/darkWizardTower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -105,4 +110,4 @@ local checkAnyway=function()
end
end

dfhack.timeout(30,'ticks',checkAnyway)
dfhack.timeout(100,'ticks',checkAnyway)

0 comments on commit d95ba78

Please sign in to comment.