Skip to content

Instantly share code, notes, and snippets.

@warmist
Created April 9, 2012 18:09
Show Gist options
  • Save warmist/2345104 to your computer and use it in GitHub Desktop.
Save warmist/2345104 to your computer and use it in GitHub Desktop.
Foot finding...
vec=df.global.world.items.other.ANY_CORPSE
pos=df.global.cursor
unit_id=-1
for k,v in pairs(vec) do
if v.pos.x==pos.x and v.pos.y==pos.y and v.pos.z==pos.z then
print("corpse pieces with unit_Id:"..v.unit_id)
unit_id=v.unit_id
end
end
if unit_id~=-1 then
for k,v in pairs(vec) do
if v.unit_id==unit_id then
v.pos.x=pos.x
v.pos.y=pos.y
v.pos.z=pos.z
end
end
else
error("corpse or its piece not found")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment