From c3a9551683e16c7506e1230d3ccb9d340b948977 Mon Sep 17 00:00:00 2001 From: MapleWheels Date: Thu, 9 Apr 2026 23:59:14 -0400 Subject: [PATCH] - Changed event aliases to be case insensitive. --- .../SharedSource/LuaCs/_Services/EventService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Services/EventService.cs b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Services/EventService.cs index 654fa0c0a..22eec4a69 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Services/EventService.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Services/EventService.cs @@ -24,14 +24,14 @@ public partial class EventService : IEventService public TypeStringKey(Type type) { Type = type ?? throw new ArgumentNullException(nameof(type)); - TypeName = type.Name; + TypeName = type.Name.ToLowerInvariant(); HashCode = TypeName.GetHashCode(); } public TypeStringKey(string typeName) { Type = null; - TypeName = typeName ?? throw new ArgumentNullException(nameof(typeName)); + TypeName = typeName?.ToLowerInvariant() ?? throw new ArgumentNullException(nameof(typeName)); HashCode = TypeName.GetHashCode(); } @@ -56,7 +56,7 @@ public partial class EventService : IEventService private readonly AsyncReaderWriterLock _operationsLock = new(); private readonly ConcurrentDictionary, IEvent>> _subscribers = new(); private readonly ConcurrentDictionary RunnerFactory)> _luaAliasEventFactory = new(); - private readonly ConcurrentDictionary> _luaLegacyEventsSubscribers = new(); + private readonly ConcurrentDictionary> _luaLegacyEventsSubscribers = new(); private readonly ConcurrentDictionary _subscribedEventDispatchers = new(); #region LifeCycle @@ -118,7 +118,7 @@ public partial class EventService : IEventService } else { - var eventSubs = _luaLegacyEventsSubscribers.GetOrAdd(eventName, key => new ConcurrentDictionary()); + var eventSubs = _luaLegacyEventsSubscribers.GetOrAdd(eventName, key => new ConcurrentDictionary()); eventSubs[identifier] = callback; } }