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