@@ -30,8 +30,8 @@ public static C7SaveFormat ImportSav(string savePath, string defaultBicPath)
30
30
31
31
ImportCiv3TerrainTypes ( theBiq , c7Save ) ;
32
32
Dictionary < int , Resource > resourcesByIndex = ImportCiv3Resources ( civ3Save . Bic , c7Save ) ;
33
- SetMapDimensions ( civ3Save , theBiq , c7Save ) ;
34
- SetWorldWrap ( theBiq , c7Save ) ;
33
+ SetMapDimensions ( civ3Save , c7Save ) ;
34
+ SetWorldWrap ( civ3Save , c7Save ) ;
35
35
36
36
// Import tiles. This is similar to, but different from the BIQ version as tile contents may have changed in-game.
37
37
int i = 0 ;
@@ -85,7 +85,7 @@ public static C7SaveFormat ImportBiq(string biqPath, string defaultBiqPath)
85
85
86
86
ImportCiv3TerrainTypes ( theBiq , c7Save ) ;
87
87
Dictionary < int , Resource > resourcesByIndex = ImportCiv3Resources ( theBiq , c7Save ) ;
88
- SetMapDimensions ( null , theBiq , c7Save ) ;
88
+ SetMapDimensions ( theBiq , c7Save ) ;
89
89
SetWorldWrap ( theBiq , c7Save ) ;
90
90
91
91
// Import tiles
@@ -187,22 +187,40 @@ private static void ImportCiv3TerrainTypes(BiqData theBiq, C7SaveFormat c7Save)
187
187
}
188
188
}
189
189
190
+ private static void SetWorldWrap ( SavData civ3Save , C7SaveFormat c7Save )
191
+ {
192
+ if ( civ3Save != null && civ3Save . Wrld . Height > 0 && civ3Save . Wrld . Width > 0 )
193
+ {
194
+ c7Save . GameData . map . wrapHorizontally = civ3Save . Wrld . XWrapping ;
195
+ c7Save . GameData . map . wrapVertically = civ3Save . Wrld . YWrapping ;
196
+ }
197
+ }
198
+
190
199
private static void SetWorldWrap ( BiqData biq , C7SaveFormat c7Save )
191
200
{
192
- c7Save . GameData . map . wrapHorizontally = biq . Wmap [ 0 ] . XWrapping ;
193
- c7Save . GameData . map . wrapVertically = biq . Wmap [ 0 ] . YWrapping ;
194
- }
195
201
196
- private static void SetMapDimensions ( SavData civ3Save , BiqData biq , C7SaveFormat c7Save )
197
- {
198
- if ( biq != null && biq . Wmap != null && biq . Wmap . Length > 0 ) {
199
- c7Save . GameData . map . numTilesTall = biq . Wmap [ 0 ] . Height ;
200
- c7Save . GameData . map . numTilesWide = biq . Wmap [ 0 ] . Width ;
202
+ if ( biq != null && biq . Wmap != null && biq . Wmap . Length > 0 )
203
+ {
204
+ c7Save . GameData . map . wrapHorizontally = biq . Wmap [ 0 ] . XWrapping ;
205
+ c7Save . GameData . map . wrapVertically = biq . Wmap [ 0 ] . YWrapping ;
201
206
}
207
+ }
208
+
209
+ private static void SetMapDimensions ( SavData civ3Save , C7SaveFormat c7Save )
210
+ {
202
211
if ( civ3Save != null && civ3Save . Wrld . Height > 0 && civ3Save . Wrld . Width > 0 ) {
203
212
c7Save . GameData . map . numTilesTall = civ3Save . Wrld . Height ;
204
213
c7Save . GameData . map . numTilesWide = civ3Save . Wrld . Width ;
205
214
}
206
215
}
207
- }
216
+
217
+ private static void SetMapDimensions ( BiqData biq , C7SaveFormat c7Save )
218
+ {
219
+ if ( biq != null && biq . Wmap != null && biq . Wmap . Length > 0 )
220
+ {
221
+ c7Save . GameData . map . numTilesTall = biq . Wmap [ 0 ] . Height ;
222
+ c7Save . GameData . map . numTilesWide = biq . Wmap [ 0 ] . Width ;
223
+ }
224
+ }
225
+ }
208
226
}
0 commit comments