@@ -67,12 +67,17 @@ public static uint FindConstructionPlacement(uint constructionProto, uint positi
6767
6868 public static IReadOnlyList < OverviewFlags > OverviewFlags ( )
6969 {
70+ Interop . UwOverviewExtract ex = new Interop . UwOverviewExtract ( ) ;
71+ Interop . uwOverviewExtract ( ref ex ) ;
72+ OverviewFlags [ ] overview = new OverviewFlags [ ex . count ] ;
73+ if ( ex . count > 0 )
74+ Marshal . Copy ( ex . flags , ( int [ ] ) ( object ) overview , 0 , ( int ) ex . count ) ;
7075 return overview ;
7176 }
7277
7378 public static OverviewFlags OverviewFlags ( uint position )
7479 {
75- return overview [ ( int ) position ] ;
80+ return Interop . uwOverviewFlags ( position ) ;
7681 }
7782
7883 public static uint [ ] OverviewEntities ( uint position )
@@ -128,7 +133,6 @@ public static void OfferForeignPolicy(uint forceId, PolicyEnum policy)
128133 static MyForceStatistics myForceStatistics = new MyForceStatistics ( ) ;
129134 static readonly Dictionary < uint , Entity > entities = new Dictionary < uint , Entity > ( ) ;
130135 static readonly Dictionary < uint , PolicyEnum > policies = new Dictionary < uint , PolicyEnum > ( ) ;
131- static OverviewFlags [ ] overview = new OverviewFlags [ 0 ] ;
132136
133137 static uint [ ] AllIds ( )
134138 {
@@ -196,21 +200,6 @@ static void UpdatePolicies()
196200 }
197201 }
198202
199- static void UpdateOverview ( bool stepping )
200- {
201- if ( stepping )
202- {
203- Interop . UwOverviewExtract ex = new Interop . UwOverviewExtract ( ) ;
204- Interop . uwOverviewExtract ( ref ex ) ;
205- if ( overview . Length != ex . count )
206- overview = new OverviewFlags [ ex . count ] ;
207- if ( ex . count > 0 )
208- Marshal . Copy ( ex . flags , ( int [ ] ) ( object ) overview , 0 , ( int ) ex . count ) ;
209- }
210- else
211- overview = new OverviewFlags [ 0 ] ;
212- }
213-
214203 static void Updating ( object sender , bool stepping )
215204 {
216205 Interop . uwMyPlayer ( ref myPlayer ) ;
@@ -219,7 +208,6 @@ static void Updating(object sender, bool stepping)
219208 UpdateFresh ( ) ;
220209 UpdateModified ( ) ;
221210 UpdatePolicies ( ) ;
222- UpdateOverview ( stepping ) ;
223211 }
224212
225213 static World ( )
0 commit comments