lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>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