[DiscordArchive] I don't know a single thing about eluna but have you checked that hook is even called?
[DiscordArchive] I don't know a single thing about eluna but have you checked that hook is even called?
Archived author: Takenbacon • Posted: 2025-02-04T08:44:13.395000+00:00
Original source
I don't know a single thing about eluna but have you checked that hook is even called?
Archived author: Takenbacon • Posted: 2025-02-04T08:44:55.331000+00:00
Original source
I assume the "cleanup" functionality is in the deconstructor of elunaEvents. Because otherwise simply deleting that object isn't going to clean anything up
Archived author: iThorgrim • Posted: 2025-02-04T08:50:41.197000+00:00
Original source
Yes ^^
Archived author: iThorgrim • Posted: 2025-02-04T08:52:14.946000+00:00
Original source
Yes, I know, that's why I've added a few methods to clean things up, but it doesn't change anything, it looks like the “update” goes before the destruction of the WorldObject is taken into account and so we get the error :
```
#----------------------------------------------------------------------#
>> ASSERTION FAILED
# Location: AzerothCore\modules\mod-eluna\src\LuaEngine\hooks\HookHelpers.h:32
# Function: Eluna::SetupStack
# Condition: arguments_top >= number_of_arguments
#----------------------------------------------------------------------#
```
Archived author: iThorgrim • Posted: 2025-02-04T08:53:13.518000+00:00
Original source
This is what OnWorldObjectDestroy looks like on my version:
```cpp
void OnWorldObjectDestroy(WorldObject* object) override
{
if (object->elunaEvents)
{
object->elunaEvents->SetStates(LUAEVENT_STATE_ABORT);
object->elunaEvents->RemoveAllEvents();
delete object->elunaEvents;
object->elunaEvents = NULL;
}
}
```
Archived author: iThorgrim • Posted: 2025-02-04T08:55:12.436000+00:00
Original source
I've also added some "security guards", but the server still crashes with the same error:
```cpp
void Eluna::OnTimedEvent(int funcRef, uint32 delay, uint32 calls, WorldObject* obj)
{
if (!obj)
{
luaL_unref(L, LUA_REGISTRYINDEX, funcRef);
return;
}
ASSERT(!event_level);
// Get function
lua_rawgeti(L, LUA_REGISTRYINDEX, funcRef);
// HookPush parameters
HookPush(funcRef);
HookPush(delay);
HookPush(calls);
HookPush(obj);
// Call function
ExecuteCall(4, 0);
ASSERT(!event_level);
InvalidateObjects();
}
```
Archived author: metallinos • Posted: 2025-02-04T09:19:46.937000+00:00
Original source
Pretty sure I reproduced it last night both while staying connected and while disconnecting during a running event
Archived author: iThorgrim • Posted: 2025-02-04T09:20:35.276000+00:00
Original source
Ah yes it's possible, at least I know we have a way to track the error if we disconnect