Embark anywhere ported

develop
Warmist 2012-09-01 10:54:45 +03:00
parent 7cabf1b843
commit 532839a4d5
2 changed files with 14 additions and 1 deletions

@ -225,6 +225,19 @@ function get_code_segment()
return MemoryArea.new(s, e)
end
end
function get_code_segments()
local ret={}
for i,mem in ipairs(dfhack.internal.getMemRanges()) do
if mem.read and not mem.write
and (string.match(mem.name,'/dwarfort%.exe$')
or string.match(mem.name,'/Dwarf_Fortress$')
or string.match(mem.name,'Dwarf Fortress%.exe'))
then
table.insert(ret,MemoryArea.new(mem.start_addr,mem.end_addr))
end
end
return ret
end
-- Static data segment search
local function find_data_segment()

@ -12,7 +12,7 @@ function simple_embark(num)
end
end
if not(FILE) then
print("Type in new ammount (more than 6, less than 15000):")
print("Type in new amount (more than 6, less than 15000):")
repeat
ans=tonumber(io.read())
if ans==nil or not(ans<=15000 and ans>0) then