feat: Entity.OnEvent now support resubscribing
This commit is contained in:
@@ -179,8 +179,10 @@ namespace Ragon.Client
|
||||
|
||||
if (_events.ContainsKey(eventCode))
|
||||
{
|
||||
RagonLog.Warn($"Event already {eventCode} subscribed");
|
||||
return;
|
||||
_events.Remove(eventCode);
|
||||
_localEvents.Remove(eventCode);
|
||||
|
||||
RagonLog.Warn($"Event already {eventCode} subscribed, removed old one!");
|
||||
}
|
||||
|
||||
_localEvents.Add(eventCode, (player, eventData) => { callback.Invoke(player, (TEvent) eventData); });
|
||||
|
||||
Reference in New Issue
Block a user