debug - remembers now
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user