28 lines
770 B
C#
28 lines
770 B
C#
using HarmonyLib;
|
|
using UnityEngine;
|
|
|
|
namespace IdleSpectator;
|
|
|
|
[HarmonyPatch(typeof(SubspeciesManager), nameof(SubspeciesManager.newSpecies))]
|
|
public static class SubspeciesNewSpeciesPatch
|
|
{
|
|
public static void Postfix(SubspeciesManager __instance, ActorAsset pAsset, WorldTile pTile, bool pMutation, Subspecies __result)
|
|
{
|
|
if (!SpectatorMode.Active)
|
|
{
|
|
return;
|
|
}
|
|
|
|
// Avoid flooding the queue during map generation / mass spawn.
|
|
if (SmoothLoader.isLoading())
|
|
{
|
|
return;
|
|
}
|
|
|
|
InterestEvent curiosity = WorldActivityScanner.FromNewSpecies(__result, pAsset, pTile);
|
|
if (curiosity != null)
|
|
{
|
|
InterestCollector.EnqueueDirect(curiosity);
|
|
}
|
|
}
|
|
}
|