mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
(Re-)work around a bug in RJW (and potentially any number of other mods) that causes CompPostPostRemoved to be called on the wrong pawn.
This commit is contained in:
parent
1125930869
commit
54e41b7aa4
3 changed files with 10 additions and 0 deletions
Binary file not shown.
|
@ -184,6 +184,11 @@ namespace RJW_Menstruation
|
|||
|
||||
public override void CompPostPostRemoved()
|
||||
{
|
||||
if (parent.pawn.GetBreastComp() == this)
|
||||
{
|
||||
Log.Warning($"Attempted to remove breast comp from wrong pawn ({parent.pawn}).");
|
||||
return;
|
||||
}
|
||||
HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(action);
|
||||
Log.Message(parent.pawn.Label + " breast tick scheduler removed");
|
||||
base.CompPostPostRemoved();
|
||||
|
|
|
@ -527,6 +527,11 @@ namespace RJW_Menstruation
|
|||
|
||||
public override void CompPostPostRemoved()
|
||||
{
|
||||
if (parent.pawn.GetMenstruationComps().Contains(this))
|
||||
{
|
||||
Log.Warning($"Attempted to remove menstruation comp from wrong pawn ({parent.pawn}).");
|
||||
return;
|
||||
}
|
||||
HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(actionref);
|
||||
Log.Message(parent.pawn.Label + " tick scheduler removed");
|
||||
pregnancy?.Miscarry();
|
||||
|
|
Loading…
Reference in a new issue