[Defconapi] Lua API GetDistance() Not Working?
Peter Cawley
defcon-ai at corsix.org
Tue Feb 16 10:09:46 CST 2010
On Tue, Feb 16, 2010 at 3:29 PM, Geoff Cox
<Geoff.Cox at ihealthtechnologies.com> wrote:
> GetDistance() produces some strange results:
Indeed, it looks like the source code for the binding of GetDistance
and GetSailDistance is incorrect. It uses the value given as x2 in
place of y2 - the thunk_GetMapDistance function is using arguments 1,
2, 3, 3, whereas it should be using 1, 2, 3, 4:
static int thunk_GetMapDistance(lua_State *L)
{
lbot_pushnumber(L,
(g_pDefconInterface->*F)(static_cast<float>(luaL_checknumber(L, 1)),
static_cast<float>(luaL_checknumber(L, 2)),
static_cast<float>(luaL_checknumber(L, 3)),
static_cast<float>(luaL_checknumber(L, 3))));
return 1;
}
I'll try to fix this and put out a new version soon (though this may
not be until the weekend).
Regards,
Peter
More information about the Defconapi
mailing list