[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: SetTagMethod
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 10 Oct 2001 09:18:36 -0300
>for some reason Old_GetTag and Old_SetTag are nil
settagmethod returns the old tag methods. For a newly created tag, they are nil.
>im getanim im trying to return receiver.name if the
>parameter=="name", but this ends up calling getanim again and I guess it
>ends up in a recursive loop and the stack overflows.
The "gettable" tag methd is called for *every* table access, including the ones
inside the tag method. Use rawget or set the "index" tag method instead.
Load_Animation would be better written as:
function Load_Animation(fname)
local index, name=Lua_Load_Animation(fname)
return settag({index=index, name=name},dis)
end
--lhf