File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66using System . Threading . Tasks ;
77using NLog ;
88using Sandbox . Engine . Multiplayer ;
9+ using Sandbox . Game ;
910using Sandbox . Game . Entities ;
1011using Sandbox . Game . Entities . Character ;
1112using Sandbox . Game . Gui ;
2728using VRage . Game ;
2829using VRage . Game . ModAPI ;
2930using VRage . Network ;
30- using Sandbox . Game ;
3131
3232namespace Essentials . Commands
3333{
@@ -213,7 +213,7 @@ private static bool RemoveFromFaction_Internal(MyIdentity identity)
213213 var fac = MySession . Static . Factions . GetPlayerFaction ( identity . IdentityId ) ;
214214 if ( fac == null )
215215 return false ;
216-
216+
217217 /*
218218 * VisualScriptLogicProvider takes care of removal of faction if last
219219 * identity is kicked, and promotes the next player in line to Founder
@@ -446,6 +446,12 @@ private static int CleanupReputations()
446446 }
447447 }
448448
449+ //Add Factions with at least one member to valid identities
450+ foreach ( var faction in MySession . Static . Factions . Factions . Where ( x=> x . Value . Members . Count > 0 ) )
451+ {
452+ validIdentities . Add ( faction . Key ) ;
453+ }
454+
449455
450456 //might not be necessary, but just in case
451457 validIdentities . Remove ( 0 ) ;
@@ -459,13 +465,15 @@ private static int CleanupReputations()
459465 if ( validIdentities . Contains ( pair . RelateeId1 ) && validIdentities . Contains ( pair . RelateeId2 ) )
460466 continue ;
461467 collection . Remove ( pair ) ;
468+ result ++ ;
462469 }
463470
464471 foreach ( var pair in collection1List )
465472 {
466473 if ( validIdentities . Contains ( pair . RelateeId1 ) && validIdentities . Contains ( pair . RelateeId2 ) )
467474 continue ;
468475 collection2 . Remove ( pair ) ;
476+ result ++ ;
469477 }
470478
471479
You can’t perform that action at this time.
0 commit comments