From 7c620c434c54e3befdc237134a66eb2190b96b4e Mon Sep 17 00:00:00 2001 From: "p.kosyh" Date: Sat, 12 Jun 2010 09:30:24 +0000 Subject: [PATCH] taketo, takef --- stead/stead.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/stead/stead.lua b/stead/stead.lua index c61dceb..c8f0cff 100644 --- a/stead/stead.lua +++ b/stead/stead.lua @@ -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);