[DiscordArchive] Hello, I'd like to ask a question that I'm sure is very silly.
[DiscordArchive] Hello, I'd like to ask a question that I'm sure is very silly.
Archived author: iThorgrim • Posted: 2024-02-02T08:56:01.192000+00:00
Original source
Hello, I'd like to ask a question that I'm sure is very silly.
I've just implemented this [Rochet2 feature](https://github.com/ElunaLuaEngine/Eluna/...d1f66d7ffd) in the Eluna version of AzerothCore, except that this modification requires the addition of a field in Object.h.
If I make a PR for Eluna and AzerothCore, will it be accepted, whereas the modification to Object.h is only useful for developers using Eluna?
[Embed: Add C storage for lua data · ElunaLuaEngine/Eluna@d5cdd0d]
https://github.com/ElunaLuaEngine/Eluna/...78c2ec254e
Archived author: iThorgrim • Posted: 2024-02-02T09:05:16.266000+00:00
Original source
Little preview ^^
2024-02-02_10-04-29.mp4
Archived author: Honey • Posted: 2024-02-02T09:11:59.501000+00:00
Original source
Without checking this proposal in detail, Eluna master has a system to store data in the player object. That would be the way to go.
Archived author: iThorgrim • Posted: 2024-02-02T09:14:30.214000+00:00
Original source
Are you talking about player:GetData and player:SetData? (If yes : These methods, added in Lua, only store data in arrays, which are emptied each time the Eluna engine is reloaded.)
Archived author: Honey • Posted: 2024-02-02T09:22:58.903000+00:00
Original source
https://discord.com/channels/81707719581...4769059850
Archived author: Honey • Posted: 2024-02-02T09:23:13.913000+00:00
Original source
See 5)
Archived author: iThorgrim • Posted: 2024-02-02T09:38:50.784000+00:00
Original source
Yes is [lua_data](https://github.com/search?q=repo%3AEluna...&type=code) in Object.h and Map.h
Archived author: Honey • Posted: 2024-02-02T09:53:51.431000+00:00
Original source
If it is a 1:1 port from Eluna master, it is very likely to be merged.
ushLuaVal(L, obj->lua_data);
ushLuaVal(L, *(obj->lua_data));Archived author: iThorgrim • Posted: 2024-02-02T09:58:59.519000+00:00
Original source
Not 1:1 because Eluna master include LuaVal so i've pre-declared LuaVal and used a raw pointer ^^
And in mod-eluna i have change this :
```cpp
int Data(lua_State* L, WorldObject* obj)
{
return LuaVal:
ushLuaVal(L, obj->lua_data);
}
```
To This :
```cpp
int Data(lua_State* L, WorldObject* obj)
{
if (obj->lua_data == nullptr) {
obj->lua_data = new LuaVal({});
}
return LuaVal:
ushLuaVal(L, *(obj->lua_data));
}
```