File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Framework/Intersect.Framework.Core Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ namespace Intersect.Config;
88/// </summary>
99public partial class MapOptions
1010{
11+ public const int DefaultMapWidth = 32 ;
12+ public const int DefaultMapHeight = 26 ;
13+
1114 private bool _enableDiagonalMovement = true ;
1215
1316 /// <summary>
@@ -57,7 +60,7 @@ public bool EnableDiagonalMovement
5760 /// <summary>
5861 /// The height of the map in tiles.
5962 /// </summary>
60- public int MapHeight { get ; set ; } = 26 ;
63+ public int MapHeight { get ; set ; } = DefaultMapHeight ;
6164
6265 /// <summary>
6366 /// The width of map items.
@@ -72,7 +75,7 @@ public bool EnableDiagonalMovement
7275 /// <summary>
7376 /// The width of the map in tiles.
7477 /// </summary>
75- public int MapWidth { get ; set ; } = 32 ;
78+ public int MapWidth { get ; set ; } = DefaultMapWidth ;
7679
7780 /// <summary>
7881 /// The number of movement directions available in the game for entities within the map.
Original file line number Diff line number Diff line change 11using System . ComponentModel . DataAnnotations . Schema ;
22using Intersect . Collections ;
33using Intersect . Compression ;
4+ using Intersect . Config ;
45using Intersect . Enums ;
56using Intersect . Framework . Core . Serialization ;
67using Intersect . GameObjects . Events ;
@@ -39,7 +40,10 @@ public partial class MapBase : DatabaseObject<MapBase>
3940 public Dictionary < string , Tile [ , ] > Layers = new ( ) ;
4041
4142 //Map Attributes
42- private MapAttribute [ , ] mAttributes = new MapAttribute [ Options . Instance . Map . MapWidth , Options . Instance . Map . MapHeight ] ;
43+ private MapAttribute [ , ] mAttributes = new MapAttribute [
44+ Options . Instance ? . Map . MapWidth ?? MapOptions . DefaultMapWidth ,
45+ Options . Instance ? . Map . MapHeight ?? MapOptions . DefaultMapHeight
46+ ] ;
4347
4448 //Cached Att Data
4549 private byte [ ] mCachedAttributeData = null ;
You can’t perform that action at this time.
0 commit comments