diff --git a/.idea/.idea.Bureaucracy/.idea/workspace.xml b/.idea/.idea.Bureaucracy/.idea/workspace.xml
index ff2ee98..4243b54 100644
--- a/.idea/.idea.Bureaucracy/.idea/workspace.xml
+++ b/.idea/.idea.Bureaucracy/.idea/workspace.xml
@@ -3,8 +3,6 @@
-
-
@@ -28,6 +26,7 @@
+
@@ -39,22 +38,20 @@
-
-
+
-
+
+
-
-
@@ -74,14 +71,18 @@
+
+
+
+
-
+
@@ -153,7 +154,7 @@
-
+
@@ -262,7 +263,8 @@
-
+
+
@@ -285,10 +287,10 @@
-
+
-
+
@@ -301,91 +303,91 @@
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
@@ -531,30 +533,43 @@
- file://$PROJECT_DIR$/Bureaucracy/Crew/CrewMember.cs
- 99
-
+ file://$PROJECT_DIR$/Bureaucracy/Crew/CrewManager.cs
+ 110
+
+
+
+
+
+
+
+
+
+
+
+ file://$PROJECT_DIR$/Bureaucracy/Budget/Costs.cs
+ 81
+
-
+
-
+
-
+
- file://$PROJECT_DIR$/Bureaucracy/Crew/CrewManager.cs
- 110
-
+ file://$PROJECT_DIR$/Bureaucracy/UI/UIController.cs
+ 153
+
-
+
-
+
-
+
@@ -1683,6 +1698,12 @@
+
+
+
+
+
+
diff --git a/Bureaucracy/Facilities/BureaucracyFacility.cs b/Bureaucracy/Facilities/BureaucracyFacility.cs
index bc38cfe..b0f099c 100644
--- a/Bureaucracy/Facilities/BureaucracyFacility.cs
+++ b/Bureaucracy/Facilities/BureaucracyFacility.cs
@@ -9,7 +9,6 @@ namespace Bureaucracy
{
public class BureaucracyFacility
{
- private int level;
private readonly int upkeepCost;
private bool recentlyUpgraded;
public FacilityUpgradeEvent Upgrade;
@@ -17,8 +16,6 @@ public class BureaucracyFacility
public bool IsPriority;
public int LaunchesThisMonth;
- [UsedImplicitly] public int Level => level;
-
public bool IsClosed => isClosed;
private bool CanBeClosed { get; set; }
@@ -40,7 +37,7 @@ public void CloseFacility()
public bool Upgrading { get; private set; }
- public int MaintenanceCost => upkeepCost * level;
+ public int MaintenanceCost => upkeepCost * GetFacilityLevel();
public string Name { get; }
@@ -48,7 +45,6 @@ public BureaucracyFacility(SpaceCenterFacility spf)
{
Name = SetName(spf);
upkeepCost = SetCosts();
- level = GetFacilityLevel();
Debug.Log("[Bureaucracy]: Setup Facility " + Name);
}
@@ -60,10 +56,10 @@ private int GetFacilityLevel()
List upgradeables = config.Value.facilityRefs;
foreach (UpgradeableFacility upgradeableBuilding in upgradeables)
{
- return upgradeableBuilding.FacilityLevel;
+ return upgradeableBuilding.FacilityLevel + 1;
}
}
- return level;
+ return 1;
}
private string SetName(SpaceCenterFacility spf)
@@ -156,7 +152,6 @@ public void OnLoad(ConfigNode[] facilityNodes)
{
ConfigNode cn = facilityNodes.ElementAt(i);
if (cn.GetValue("Name") != Name) continue;
- int.TryParse(cn.GetValue("Level"), out level);
bool.TryParse(cn.GetValue("RecentlyUpgraded"), out recentlyUpgraded);
bool.TryParse(cn.GetValue("Closed"), out isClosed);
bool.TryParse(cn.GetValue("isPriority"), out IsPriority);
@@ -175,7 +170,6 @@ public void OnSave(ConfigNode cn)
ConfigNode thisNode = new ConfigNode("FACILITY");
thisNode.SetValue("Name", Name, true);
thisNode.SetValue("isPriority", IsPriority, true);
- thisNode.SetValue("Level", level, true);
thisNode.SetValue("RecentlyUpgraded", recentlyUpgraded, true);
thisNode.SetValue("Closed", isClosed, true);
thisNode.SetValue("LaunchesThisMonth", LaunchesThisMonth, true);
@@ -189,7 +183,6 @@ public void OnUpgradeCompleted()
Upgrade = null;
recentlyUpgraded = true;
IsPriority = false;
- level++;
Debug.Log("[Bureaucracy]: Upgrade of " + Name + " completed");
}
@@ -220,7 +213,7 @@ public void DestroyBuilding()
public bool CanBeDestroyed()
{
- return level > 2;
+ return GetFacilityLevel() > 2;
}
private IEnumerable Destructibles()
diff --git a/GameData/Bureaucracy/Bureaucracy.version b/GameData/Bureaucracy/Bureaucracy.version
index 693d6d3..1207da7 100644
--- a/GameData/Bureaucracy/Bureaucracy.version
+++ b/GameData/Bureaucracy/Bureaucracy.version
@@ -11,7 +11,7 @@
{
"MAJOR" : 1,
"MINOR" : 1,
- "PATCH" : 4,
+ "PATCH" : 5,
"BUILD" : 0
},
"KSP_VERSION" :
diff --git a/GameData/Bureaucracy/Changelog.cfg b/GameData/Bureaucracy/Changelog.cfg
index deac72f..e5921f2 100644
--- a/GameData/Bureaucracy/Changelog.cfg
+++ b/GameData/Bureaucracy/Changelog.cfg
@@ -3,6 +3,12 @@ KERBALCHANGELOG
showChangelog = True
modName = Bureaucracy
+ VERSION
+ {
+ version = 1.1.5
+ change = Fix Facility Maintenance Costs being applied one level behind actual facility level.
+ }
+
VERSION
{
version = 1.1.4