Skip to content

Commit 9ff3df1

Browse files
committed
Explain program state change #508
1 parent d274ed0 commit 9ff3df1

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Source/Client/Factions/Page_ConfigureStartingPawns_Multifaction.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,8 @@ private void GenerateTemporaryFaction()
5454
private void GeneratePawnsForConfigurePage()
5555
{
5656
var prevProgramState = Current.programStateInt;
57+
SetEntryProgramStateForCorrectPawnCreation();
5758

58-
// Old Comment: Set ProgramState.Entry so that InInterface is false
59-
// TODO: Why is this necessary?
60-
// TODO: feel like there is a better way to do this
61-
Current.programStateInt = ProgramState.Entry;
6259
Current.Game.InitData.playerFaction = _temporaryFactionForPawnCreation;
6360

6461
try
@@ -71,6 +68,16 @@ private void GeneratePawnsForConfigurePage()
7168
}
7269
}
7370

71+
private static void SetEntryProgramStateForCorrectPawnCreation()
72+
{
73+
// Set ProgramState.Entry to ensure InInterface is false.
74+
// (#508 Tick-git) InInterface seems unrelated to PawnCreation to me,
75+
// but it's necessary because it makes Faction.OfPlayer return
76+
// the temporary generated faction — which is required for proper apparel generation.
77+
78+
Current.programStateInt = ProgramState.Entry;
79+
}
80+
7481
private void GeneratingPawns()
7582
{
7683
_scenario.PostIdeoChosen();

0 commit comments

Comments
 (0)