|
|
@ -289,29 +289,19 @@ function tools.empregnate(unit)
|
|
|
|
if unit.curse then
|
|
|
|
if unit.curse then
|
|
|
|
unit.curse.add_tags2.STERILE=false
|
|
|
|
unit.curse.add_tags2.STERILE=false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
local arr1=unit.appearance.unk_51c
|
|
|
|
local genes = unit.appearance.genes
|
|
|
|
local arr2=unit.appearance.unk_524
|
|
|
|
|
|
|
|
if unit.relations.pregnancy_ptr == nil then
|
|
|
|
if unit.relations.pregnancy_ptr == nil then
|
|
|
|
print("creating preg ptr.")
|
|
|
|
print("creating preg ptr.")
|
|
|
|
if false then
|
|
|
|
if false then
|
|
|
|
print(string.format("%x %x",df.sizeof(unit.relations:_field("pregnancy_ptr"))))
|
|
|
|
print(string.format("%x %x",df.sizeof(unit.relations:_field("pregnancy_ptr"))))
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
unit.relations.pregnancy_ptr={ new = true, anon_1 = { assign = arr1 }, anon_2 = { assign = arr2 } }
|
|
|
|
unit.relations.pregnancy_ptr = { new = true, assign = genes }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
local tarr1=unit.relations.pregnancy_ptr.anon_1
|
|
|
|
local ngenes = unit.relations.pregnancy_ptr
|
|
|
|
local tarr2=unit.relations.pregnancy_ptr.anon_2
|
|
|
|
if #ngenes.appearance ~= #genes.appearance or #ngenes.colors ~= #genes.colors then
|
|
|
|
if #tarr1~= #arr1 then
|
|
|
|
print("Array sizes incorrect, fixing.")
|
|
|
|
print("First array incorrect, fixing.")
|
|
|
|
ngenes:assign(genes);
|
|
|
|
print(string.format("Before: %d vs %d",#tarr1,#arr1))
|
|
|
|
|
|
|
|
tarr1:assign(arr1)
|
|
|
|
|
|
|
|
print(string.format("after: %d vs %d",#tarr1,#arr1))
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
if created or #tarr2~= #arr2 then
|
|
|
|
|
|
|
|
print("Second array incorrect, fixing.")
|
|
|
|
|
|
|
|
print(string.format("Before: %d vs %d",#tarr2,#arr2))
|
|
|
|
|
|
|
|
tarr2:assign(arr2)
|
|
|
|
|
|
|
|
print(string.format("after: %d vs %d",#tarr2,#arr2))
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
print("Setting preg timer.")
|
|
|
|
print("Setting preg timer.")
|
|
|
|
unit.relations.pregnancy_timer=10
|
|
|
|
unit.relations.pregnancy_timer=10
|
|
|
|