File tree Expand file tree Collapse file tree
source/ContractConfigurator/ScenarioModules Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public class ContractPreLoader : ScenarioModule
2929 private static System . Random rand = new System . Random ( ) ;
3030 private static int nextContractGroup = rand . Next ( ) ;
3131
32- private List < ConfiguredContract > contracts = new List < ConfiguredContract > ( ) ;
32+ private readonly List < ConfiguredContract > contracts = new List < ConfiguredContract > ( ) ;
3333
3434 private string lastKey = null ;
3535 private double lastGenerationFailure ;
@@ -376,7 +376,7 @@ public override void OnSave(ConfigNode node)
376376 {
377377 try
378378 {
379- foreach ( ConfiguredContract contract in contracts . Where ( c => c . ContractState == Contract . State . Offered ) )
379+ foreach ( ConfiguredContract contract in contracts )
380380 {
381381 ConfigNode child = new ConfigNode ( "CONTRACT" ) ;
382382 node . AddNode ( child ) ;
@@ -436,9 +436,15 @@ public override void OnLoad(ConfigNode node)
436436 }
437437 }
438438
439- public IEnumerable < ConfiguredContract > PendingContracts ( )
439+ /// <summary>
440+ /// Contracts that have been generated but not yet accepted. Not all of may be presented to the player.
441+ /// Do not edit the returned collection directly.
442+ /// </summary>
443+ /// <returns></returns>
444+ public List < ConfiguredContract > PendingContracts ( )
440445 {
441- return contracts . Where ( c => c . ContractState == Contract . State . Offered ) ;
446+ // contracts only ever holds State.Offered contracts
447+ return contracts ;
442448 }
443449 }
444450}
You can’t perform that action at this time.
0 commit comments