mirror of
				https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
				synced 2024-08-15 00:43:45 +00:00 
			
		
		
		
	randomness reintroduced to anim selection
This commit is contained in:
		
							parent
							
								
									990d27d4b1
								
							
						
					
					
						commit
						e914cab80a
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -84,9 +84,10 @@ namespace Rimworld_Animations {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            int reorder2 = 0;
 | 
					            int reorder2 = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //find all, then find max priority context
 | 
					            //find all, reorder randomly, then find max priority context
 | 
				
			||||||
            GroupAnimationDef result = DefDatabase<GroupAnimationDef>.AllDefsListForReading
 | 
					            GroupAnimationDef result = DefDatabase<GroupAnimationDef>.AllDefsListForReading
 | 
				
			||||||
                .FindAll((GroupAnimationDef x) => x.canAnimationBeUsed(participants))
 | 
					                .FindAll((GroupAnimationDef x) => x.canAnimationBeUsed(participants))
 | 
				
			||||||
 | 
					                .OrderBy(_ => Rand.Int)
 | 
				
			||||||
                .MaxBy((GroupAnimationDef x) => x.Priority(participants, out reorder2));
 | 
					                .MaxBy((GroupAnimationDef x) => x.Priority(participants, out reorder2));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue