Fixed exception logging and entity id of messages

This commit is contained in:
Simon Lübeß
2026-09-03 22:35:14 +02:00
parent abf7a01917
commit 1435dac4d6
10 changed files with 331 additions and 72 deletions
+4 -6
View File
@@ -492,19 +492,17 @@ static class ScriptEngine
return scriptClass;
}
internal static void LogScriptException(ScriptException exception, UUID entityId)
internal static void LogScriptException(ScriptException exception)
{
String entityInfo = scope .();
if (entityId != .Zero && Context != null)
if (exception.EntityId != .Zero && Context != null)
{
exception.EntityId = entityId;
Result<Entity> sourceEntity = Context.GetEntityByID(entityId);
Result<Entity> sourceEntity = Context.GetEntityByID(exception.EntityId);
if (sourceEntity case .Ok(let e))
{
entityInfo.AppendF($" ({e.Name} | {entityId})");
entityInfo.AppendF($" ({e.Name} | {exception.EntityId})");
}
}