From 5b53f07905b0b3caea076feeb66e2b7ecbae287b Mon Sep 17 00:00:00 2001 From: Warmist Date: Thu, 29 Nov 2012 17:24:45 +0200 Subject: [PATCH] Real construction removal added. --- scripts/gui/advfort.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/gui/advfort.lua b/scripts/gui/advfort.lua index 5fbce9395..608ddfd3b 100644 --- a/scripts/gui/advfort.lua +++ b/scripts/gui/advfort.lua @@ -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}},