diff --git a/Distribution/Restock/GameData/ReStock/Plugins/Restock.dll b/Distribution/Restock/GameData/ReStock/Plugins/Restock.dll index f571f526..9cdd9129 100644 Binary files a/Distribution/Restock/GameData/ReStock/Plugins/Restock.dll and b/Distribution/Restock/GameData/ReStock/Plugins/Restock.dll differ diff --git a/Source/Restock/ModuleRestockDepthMask.cs b/Source/Restock/ModuleRestockDepthMask.cs index ba656bf4..e30a850d 100644 --- a/Source/Restock/ModuleRestockDepthMask.cs +++ b/Source/Restock/ModuleRestockDepthMask.cs @@ -44,12 +44,14 @@ namespace Restock // the part variant system is implemented extremely stupidly // so we have to make this whole module more complicated as a result GameEvents.onVariantApplied.Add(OnVariantApplied); + GameEvents.onPartRepaired.Add(OnPartRepaired); } private void OnDestroy() { GameEvents.onVariantApplied.Remove(OnVariantApplied); + GameEvents.onPartRepaired.Remove(OnPartRepaired); } @@ -95,6 +97,12 @@ namespace Restock if (appliedPart == this.part) UpdateAllMaterials(); } + public void OnPartRepaired(Part repairedPart) + { + // Part repair resets part of the mesh from the prefab, so it needs to be reapplied + if (repairedPart == this.part) UpdateAllMaterials(); + } + private void UpdateAllMaterials() {