Skip to content

Commit e4fac35

Browse files
author
tea
committed
small improvement to fast rerolling
1 parent e967b5e commit e4fac35

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

Source/RandomSettings.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,18 @@ public static bool Reroll(Pawn pawn)
104104

105105
for (int i = 0; i < 100; i++)
106106
{
107-
pawn.health = new Pawn_HealthTracker(pawn);
107+
pawn.health.Reset();
108108
try
109109
{
110110
// internally, this method only adds custom Scenario health (as of rimworld v1.3)
111111
Find.Scenario.Notify_NewPawnGenerating(pawn, request.Context);
112112

113113
randomHealthMethodInfo.Invoke(null, new object[] { pawn, request });
114114
if (!(pawn.Dead || pawn.Destroyed || pawn.Downed))
115-
break;
115+
{
116+
//pawn.health.Reset();
117+
continue;
118+
}
116119
}
117120
catch (Exception)
118121
{
@@ -130,11 +133,7 @@ public static bool Reroll(Pawn pawn)
130133
// Handle custom scenario
131134
Find.Scenario.Notify_PawnGenerated(pawn, request.Context, true);
132135
if (!CheckPawnIsSatisfied(pawn))
133-
{
134-
Log.Message("Test");
135136
continue;
136-
}
137-
138137

139138
// Generate Misc
140139
randomBodyTypeMethodInfo.Invoke(null, new object[] { pawn, request });

0 commit comments

Comments
 (0)