fix: Fixes multiple factions bugs with sigil generation, lighting, and theft (#2375)
This commit is contained in:
parent
b0189ccf4a
commit
e1ae970636
4 changed files with 30 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -13,6 +13,7 @@ public class StrongholdRegion : BaseRegion
|
|||
)
|
||||
{
|
||||
Faction = faction;
|
||||
GoLocation = faction.Definition.Stronghold.FactionStone;
|
||||
|
||||
Register();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue