From 766f3d9dcd0399209a269811387af8f3ad554e06 Mon Sep 17 00:00:00 2001 From: "p.kosyh" Date: Tue, 12 Apr 2011 13:11:58 +0000 Subject: [PATCH] click fix --- stead/click.lua | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/stead/click.lua b/stead/click.lua index 56d845a..b1e66c3 100644 --- a/stead/click.lua +++ b/stead/click.lua @@ -32,19 +32,30 @@ stead.module_init(function() end) game.action = stead.hook(game.action, -function(f, s, cmd, x, y, ...) +function(f, s, cmd, x, y, px, py, ...) if cmd == 'click' then local r,v + local x2 = px + local y2 = py + + if tonumber(px) then + x2 = tonumber(px) + end + + if tonumber(py) then + y2 = tonumber(py) + end + if here().click then - r,v = call(here(), 'click', x, y, ...); + r,v = call(here(), 'click', tonumber(x), tonumber(y), x2, y2, ...); elseif s.click then - r,v = call(s, 'click', x, y, ...); + r,v = call(s, 'click', tonumber(x), tonumber(y), x2, y2, ...); end if r == nil and v == nil then return nil, true end return r,v end - return f(s, cmd, x, y, ...) + return f(s, cmd, x, y, px, py, ...) end) -- vim:ts=4