fix: Fixes multiple factions bugs with sigil generation, lighting, and theft (#2375)

This commit is contained in:
Joe 2026-03-15 14:02:56 -04:00 committed by GitHub
parent b0189ccf4a
commit e1ae970636
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 30 additions and 2 deletions

View file

@ -46,7 +46,11 @@ public static class Generator
{
var mono = new TownMonolith(town);
mono.MoveToWorld(def.Monolith, facet);
mono.Sigil = new Sigil(town);
if (!SigilExistsForTown(town))
{
mono.Sigil = new Sigil(town);
}
}
if (!CheckExistence(def.TownStone, facet, typeof(TownStone)))
@ -96,4 +100,19 @@ public static class Generator
return false;
}
private static bool SigilExistsForTown(Town town)
{
var sigils = Sigil.Sigils;
for (var i = 0; i < sigils.Count; i++)
{
if (!sigils[i].Deleted && sigils[i].Town == town)
{
return true;
}
}
return false;
}
}

View file

@ -13,6 +13,7 @@ public class StrongholdRegion : BaseRegion
)
{
Faction = faction;
GoLocation = faction.Definition.Stronghold.FactionStone;
Register();
}

View file

@ -32,8 +32,14 @@ public abstract class BaseMonolith : BaseSystemController
return;
}
var oldSigil = m_Sigil;
m_Sigil = value;
if (oldSigil != null)
{
oldSigil.Light = LightType.Empty;
}
if (m_Sigil?.LastMonolith != null && m_Sigil.LastMonolith != this && m_Sigil.LastMonolith.Sigil == m_Sigil)
{
m_Sigil.LastMonolith.Sigil = null;
@ -91,6 +97,7 @@ public abstract class BaseMonolith : BaseSystemController
return;
}
m_Sigil.Light = LightType.Circle225;
m_Sigil.MoveToWorld(new Point3D(X, Y, Z + 18), Map);
}

View file

@ -204,9 +204,10 @@ public static class Stealing
if (sig.LastMonolith?.Sigil != null)
{
sig.LastMonolith.Sigil = null;
sig.LastStolen = Core.Now;
}
sig.LastStolen = Core.Now;
return sig;
}
}