Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion source/GameInterface/Services/MapEvents/MapEventRegistry.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
using GameInterface.Registry;
using System.Diagnostics.Metrics;
using System.Threading;
using TaleWorlds.CampaignSystem;
using TaleWorlds.CampaignSystem.MapEvents;
using TaleWorlds.CampaignSystem.Settlements.Buildings;
using TaleWorlds.CampaignSystem.Settlements;

namespace GameInterface.Services.MapEvents;

Expand All @@ -17,9 +20,12 @@ public MapEventRegistry(IRegistryCollection collection) : base(collection) { }

public override void RegisterAll()
{
int counter = 0;

foreach (var mapEvent in Campaign.Current.MapEventManager.MapEvents)
{
if (RegisterExistingObject(mapEvent.StringId, mapEvent) == false)
var networkId = nameof(Building) + "_" + "Coop" + counter++;
if (RegisterExistingObject(networkId, mapEvent) == false)
{
Logger.Error($"Unable to register {mapEvent}");
}
Expand Down