debug - remembers now

This commit is contained in:
2026-05-18 21:25:16 -04:00
parent edfdcd0f82
commit fdf41b2567
8 changed files with 27 additions and 2 deletions
+25
View File
@@ -307,6 +307,31 @@ namespace AbsorbentSoil
}
}
[HarmonyPatch(typeof(Plant), nameof(Plant.AdditiveApplied))]
internal static class Plant_AdditiveApplied_Patch
{
public static void Postfix(Plant __instance, AdditiveDefinition additive, bool isInitialApplication)
{
try
{
MelonLogger.Msg($"Plant.AdditiveApplied fired. Plant={__instance?.name}, Pot={__instance?.Pot?.name}, Additive={additive?.ID}, Initial={isInitialApplication}");
if (__instance == null || __instance.Pot == null || additive == null)
return;
string additiveId = additive.ID;
if (string.IsNullOrWhiteSpace(additiveId))
return;
AdditiveMemory.Remember(__instance.Pot, additiveId);
}
catch (Exception ex)
{
MelonLogger.Warning($"Plant.AdditiveApplied postfix failed: {ex}");
}
}
}
[HarmonyPatch(typeof(Pot), "Destroy")]
internal static class Pot_Destroy_Patch
{