patches not firing
This commit is contained in:
@@ -250,21 +250,18 @@ namespace AbsorbentSoil
|
||||
{
|
||||
try
|
||||
{
|
||||
MelonLogger.Msg($"Plant.Initialize fired. Plant={__instance?.name}, Pot={__instance?.Pot?.name}");
|
||||
|
||||
if (__instance == null || __instance.Pot == null)
|
||||
return;
|
||||
|
||||
Pot pot = __instance.Pot;
|
||||
if (!SoilHelper.CanReapplyRetainedAdditives(pot))
|
||||
return;
|
||||
Pot actualPot = __instance.Pot;
|
||||
var additiveIds = AdditiveMemory.Get(actualPot);
|
||||
|
||||
IReadOnlyList<string> additiveIds = AdditiveMemory.Get(pot);
|
||||
if (additiveIds.Count == 0)
|
||||
return;
|
||||
MelonLogger.Msg($"Plant.Initialize pot key={PotKeyHelper.GetPotKey(actualPot)}, remembered additives={additiveIds.Count}");
|
||||
|
||||
foreach (string additiveId in additiveIds)
|
||||
Pot_ApplyAdditive_Patch.ReapplyWithoutRecapture(pot, additiveId);
|
||||
|
||||
MelonLogger.Msg($"Reapplied {additiveIds.Count} retained additive(s) to new plant in pot '{PotKeyHelper.GetPotKey(pot)}'.");
|
||||
Pot_ApplyAdditive_Patch.ReapplyWithoutRecapture(actualPot, additiveId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user