-- - ^ Select sprite from spritesheet with optional animation and DM-style
-- - texture selection based on yaw relative to camera
-- - get_entity_name()
+-- - get_luaentity()
-- Player-only: (no-op for other objects)
-- - get_player_name(): will return nil if is not a player
-- - get_inventory() -> InvRef
return 1;
}
+ // get_luaentity(self)
+ static int l_get_luaentity(lua_State *L)
+ {
+ ObjectRef *ref = checkobject(L, 1);
+ LuaEntitySAO *co = getluaobject(ref);
+ if(co == NULL) return 0;
+ // Do it
+ luaentity_get(L, co->getId());
+ return 1;
+ }
+
/* Player-only */
// get_player_name(self)
method(ObjectRef, settexturemod),
method(ObjectRef, setsprite),
method(ObjectRef, get_entity_name),
+ method(ObjectRef, get_luaentity),
// Player-only
method(ObjectRef, get_player_name),
method(ObjectRef, get_inventory),