Real construction removal added.

develop
Warmist 2012-11-29 17:24:45 +02:00
parent 2d4fc739ed
commit 5b53f07905
1 changed files with 10 additions and 1 deletions

@ -273,6 +273,15 @@ function BuildingChosen(st_pos,pos,index)
end
--[[ end of buildings ]]--
function RemoveConstruction(args)
local bld=dfhack.buildings.findAtTile(args.pos)
if bld==nil then
MakeJob(args.unit,args.pos,df.job_type.RemoveConstruction,args.old_pos)
else
bld:queueDestroy()
AssignUnitToJob(bld.jobs[0],args.unit,args.old_pos)
end
end
function AssignJobToBuild(args)
local bld=dfhack.buildings.findAtTile(args.pos)
if bld~=nil then
@ -320,7 +329,7 @@ dig_modes={
--{"Surgery" ,df.job_type.Surgery,{IsUnit},{SetPatientRef}},
--{"TameAnimal" ,df.job_type.TameAnimal,{IsUnit},{SetCreatureRef}},
{"GatherPlants" ,df.job_type.GatherPlants,{IsPlant}},
{"RemoveConstruction" ,df.job_type.RemoveConstruction,{IsConstruct}},
{"RemoveConstruction" ,RemoveConstruction,{IsConstruct}},
--{"HandleLargeCreature" ,df.job_type.HandleLargeCreature,{isUnit},{SetCreatureRef}},
{"Build" ,AssignJobToBuild},
{"RemoveStairs" ,df.job_type.RemoveStairs,{IsStairs,NotConstruct}},