mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Hardened Incubator Up-Ticking - seems smooth and robust now
This commit is contained in:
parent
b785ee518b
commit
5159535400
1 changed files with 4 additions and 1 deletions
|
@ -15,6 +15,8 @@ namespace RJW_Genes
|
||||||
/// 1. Is it fertilized ? => tick it down "extra".
|
/// 1. Is it fertilized ? => tick it down "extra".
|
||||||
/// 2. Is it not fertilized? => fertilize it with the Incubator as parent
|
/// 2. Is it not fertilized? => fertilize it with the Incubator as parent
|
||||||
///
|
///
|
||||||
|
/// To save performance, this gene fires (default) every 0.5h, which also means a slight delay until fertilization happens.
|
||||||
|
///
|
||||||
/// Important: The other half of the behavior for the gene (more egg-capacity) is in `Patch_InsectINcubator_PregnancyHelper`.
|
/// Important: The other half of the behavior for the gene (more egg-capacity) is in `Patch_InsectINcubator_PregnancyHelper`.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Gene_InsectIncubator : Gene
|
public class Gene_InsectIncubator : Gene
|
||||||
|
@ -42,7 +44,8 @@ namespace RJW_Genes
|
||||||
egg.Fertilize(pawn);
|
egg.Fertilize(pawn);
|
||||||
if (RJW_Genes_Settings.rjw_genes_detailed_debug) ModLog.Message($"Gene_InsectIncubator: fertilized egg {egg} in {pawn}");
|
if (RJW_Genes_Settings.rjw_genes_detailed_debug) ModLog.Message($"Gene_InsectIncubator: fertilized egg {egg} in {pawn}");
|
||||||
}
|
}
|
||||||
else if (egg.fertilized)
|
// DevNote: There is an issue with Eggs reaching too much gestation progress (>100%), which causes DownStream bugs. To avoid this, there are some extra checks in place.
|
||||||
|
else if (egg.fertilized && egg.GestationProgress <= .93)
|
||||||
{
|
{
|
||||||
egg.lastTick += TICK_INTERVAL;
|
egg.lastTick += TICK_INTERVAL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue