Skip to content

Commit

Permalink
reconcile histfig pregnancy stats
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Nov 7, 2023
1 parent 0ab2806 commit 4587076
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions catsplosion.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local datetime = require('datetime')

local world = df.global.world

if not dfhack.isWorldLoaded() then
Expand Down Expand Up @@ -68,6 +70,19 @@ for id in pairs(creatures) do
female.pregnancy_caste = female.caste -- To handle female only species
total_created = total_created + 1
end
local hf = df.historical_figure.find(female.histfig_id)
if not hf then goto continue end
if not hf.info then
hf.info = df.historical_figure_info:new()
end
if not hf.info.wounds then
hf.info.wounds = df.historical_figure_info.T_wounds:new()
end
local dt = datetime.DateTime.now()
dt:addTicks(female.pregnancy_timer)
local wounds = hf.info.wounds
wounds.childbirth_year, wounds.childbirth_ticks = dt:getYears()
::continue::
end
end

Expand Down

0 comments on commit 4587076

Please sign in to comment.