mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Throw lua error instead of assert
This commit is contained in:
@@ -1075,7 +1075,12 @@ int Eluna::Register(lua_State* L, uint8 regtype, uint32 entry, uint64 guid, uint
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSERT(guid != 0);
|
||||
if (guid == 0)
|
||||
{
|
||||
luaL_unref(L, LUA_REGISTRYINDEX, functionRef);
|
||||
luaL_error(L, "guid was 0!");
|
||||
return 0; // Stack: (empty)
|
||||
}
|
||||
|
||||
auto key = UniqueObjectKey<Hooks::CreatureEvents>((Hooks::CreatureEvents)event_id, guid, instanceId);
|
||||
bindingID = CreatureUniqueBindings->Insert(key, functionRef, shots);
|
||||
|
||||
Reference in New Issue
Block a user