");
diff --git a/LegendsViewer/Controls/HTML/SitePrinter.cs b/LegendsViewer/Controls/HTML/SitePrinter.cs
index 660ba77..9768696 100644
--- a/LegendsViewer/Controls/HTML/SitePrinter.cs
+++ b/LegendsViewer/Controls/HTML/SitePrinter.cs
@@ -53,7 +53,7 @@ public override string Print()
warfareString = warfareString.Insert(warfareString.IndexOf(" as a result of"), "");
HTML.AppendLine("" + warfareString + " | ");
HTML.AppendLine("as part of | ");
- HTML.AppendLine("" + warfare.ParentCollection.ToLink() + " | ");
+ HTML.AppendLine("" + ((warfare.ParentCollection == null) ? "UNKNOWN" :warfare.ParentCollection.ToLink()) + " | ");
HTML.AppendLine("by ");
if (warfare.GetType() == typeof(Battle))
{
diff --git a/LegendsViewer/Legends/Events.cs b/LegendsViewer/Legends/Events.cs
index fe66dc9..49ade5f 100644
--- a/LegendsViewer/Legends/Events.cs
+++ b/LegendsViewer/Legends/Events.cs
@@ -59,7 +59,12 @@ public virtual string GetYearTime()
else if (season < 302400) yearTime += "autumn, ";
else if (season < 403200) yearTime += "winter, ";
- return yearTime;
+ int monthIndex = this.Seconds72 / (28 * 1200);
+ string[] monthNames = { "Granite", "Slate", "Felsite", "Hematite", "Malachite", "Galena", "Limestone", "Sandstone", "Timber", "Moonstone", "Opal", "Obsidian" };
+ string monthName = monthNames[monthIndex];
+ int dayIndex = 1 + (this.Seconds72 % (28 * 1200)) / 1200;
+
+ return yearTime + " (" + monthName + ", " + dayIndex.ToString() + ") ";
}
public string PrintParentCollection(bool link = true, DwarfObject pov = null)
{
@@ -2531,7 +2536,12 @@ public override string Print(bool link = true, DwarfObject pov = null)
{
string eventString = this.GetYearTime() + Attacker.ToLink(link, pov) + " defeated ";
if (SiteEntity != null && SiteEntity != Defender) eventString += SiteEntity.ToLink(link, pov) + " of ";
- eventString += Defender.ToLink(link, pov) + " and took over " + Site.ToLink(link, pov) +
+ if (Defender == null) {
+ eventString += "UNKNOWN";
+ } else {
+ eventString += Defender.ToLink(link, pov);
+ }
+ eventString += " and took over " + Site.ToLink(link, pov) +
". The new government was called " + NewSiteEntity.ToLink(link, pov) + ". ";
eventString += PrintParentCollection(link, pov);
return eventString;
|