taketo, takef
This commit is contained in:
parent
fb619ebfd2
commit
7c620c434c
|
@ -2065,16 +2065,24 @@ function remove(obj, from)
|
|||
return o
|
||||
end
|
||||
|
||||
function take(obj, wh)
|
||||
function taketo(obj, wh, pos)
|
||||
local o = remove(obj, wh);
|
||||
if not isObject(o) then
|
||||
error "Trying to take wrong object.";
|
||||
end
|
||||
inv():add(obj);
|
||||
inv():add(obj, pos);
|
||||
o._taken = true
|
||||
return o
|
||||
end
|
||||
|
||||
function take(obj, wh)
|
||||
return taketo(obj, wh);
|
||||
end
|
||||
|
||||
function takef(obj, wh)
|
||||
return taketo(obj, wh, 1);
|
||||
end
|
||||
|
||||
function putto(obj, w, pos)
|
||||
local wh
|
||||
local o = ref(obj);
|
||||
|
|
Loading…
Reference in a new issue