Skip to content

Commit

Permalink
move getCurrentSite from dfhack to world
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Jan 14, 2024
1 parent 5db9c95 commit ce88873
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion internal/caravan/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ end

local function get_mandate_noble_roles()
local roles = {}
for _, link in ipairs(dfhack.getCurrentSite().entity_links) do
for _, link in ipairs(dfhack.world.getCurrentSite().entity_links) do
local he = df.historical_entity.find(link.entity_id);
if not he or
(he.type ~= df.historical_entity_type.SiteGovernment and
Expand Down
2 changes: 1 addition & 1 deletion internal/caravan/pedestal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ local function get_containing_temple_or_guildhall(display_bld)
end
end
if not loc_id then return end
local site = dfhack.getCurrentSite()
local site = dfhack.world.getCurrentSite()
local location = utils.binsearch(site.buildings, loc_id, 'id')
if not location then return end
local loc_type = location:getType()
Expand Down
2 changes: 1 addition & 1 deletion internal/confirm/specs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ local function has_caravans()
end

local function get_num_uniforms()
local site = dfhack.getCurrentSite() or {}
local site = dfhack.world.getCurrentSite() or {}
for _, entity_site_link in ipairs(site.entity_links or {}) do
local he = df.historical_entity.find(entity_site_link.entity_id)
if he and he.type == df.historical_entity_type.SiteGovernment then
Expand Down
2 changes: 1 addition & 1 deletion internal/quickfort/zone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ local function set_location(zone, location, ctx)
dfhack.printerr('cannot create a guildhall without a specified profession')
return
end
local site = dfhack.getCurrentSite()
local site = dfhack.world.getCurrentSite()
local loc_id = nil
if location.label and safe_index(ctx, 'zone', 'locations', location.label) then
local cached_loc = ctx.zone.locations[location.label]
Expand Down
6 changes: 3 additions & 3 deletions modtools/create-unit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -915,12 +915,12 @@ end

function wildUnit(unit)
local casteFlags = unit.enemy.caste_flags
-- x = dfhack.getCurrentSite().pos.x
-- y = dfhack.getCurrentSite().pos.y
-- x = dfhack.world.getCurrentSite().pos.x
-- y = dfhack.world.getCurrentSite().pos.y
-- region = df.global.map.map_blocks[df.global.map.x_count_block*x+y]
if not(casteFlags.CAN_SPEAK or casteFlags.CAN_LEARN) then
if dfhack.isSiteLoaded() then
local site = dfhack.getCurrentSite()
local site = dfhack.world.getCurrentSite()
unit.animal.population.region_x = site.pos.x
unit.animal.population.region_y = site.pos.y
end
Expand Down

0 comments on commit ce88873

Please sign in to comment.