@@ -77,41 +77,44 @@ public PictureBox DrawMonuments(string ServerName, string ServerPort, List<Model
77
77
78
78
HelperClass HelpMgr = new HelperClass ( ) ;
79
79
80
- OutPut . AppendText ( Environment . NewLine + "Total World Monumnets:" + Monumentlst . Count . ToString ( ) ) ;
80
+ if ( Monumentlst != null )
81
+ {
82
+ OutPut . AppendText ( Environment . NewLine + "Total World Monumnets:" + Monumentlst . Count . ToString ( ) ) ;
81
83
82
- foreach ( Models . world . Monument Monument in Monumentlst )
83
- {
84
+ foreach ( Models . world . Monument Monument in Monumentlst )
85
+ {
84
86
85
- // Output the load of image
86
- OutPut . AppendText ( Environment . NewLine + "Attempting to draw [" + Monument . name + "]: " + Monument . displayName ) ;
87
+ // Output the load of image
88
+ OutPut . AppendText ( Environment . NewLine + "Attempting to draw [" + Monument . name + "]: " + Monument . displayName ) ;
87
89
88
- string ImgPath = BuildMonumentsImagePath ( Monument ) ;
89
- Image ObjectImg = null ;
90
+ string ImgPath = BuildMonumentsImagePath ( Monument ) ;
91
+ Image ObjectImg = null ;
90
92
91
- // Check if image is cached
92
- if ( File . Exists ( "." + ImgPath ) )
93
- {
94
- // Load file from cache
95
- ObjectImg = Image . FromFile ( "." + ImgPath ) ;
96
- } else
97
- {
93
+ // Check if image is cached
94
+ if ( File . Exists ( "." + ImgPath ) )
95
+ {
96
+ // Load file from cache
97
+ ObjectImg = Image . FromFile ( "." + ImgPath ) ;
98
+ } else
99
+ {
98
100
99
- // Try to get image for object
100
- ObjectImg = GetImage ( RustIOServer , "80" , BuildMonumentsImagePath ( Monument ) ) ;
101
+ // Try to get image for object
102
+ ObjectImg = GetImage ( RustIOServer , "80" , BuildMonumentsImagePath ( Monument ) ) ;
101
103
102
- // Cache Image
103
- ObjectImg . Save ( "." + ImgPath ) ;
104
- }
104
+ // Cache Image
105
+ ObjectImg . Save ( "." + ImgPath ) ;
106
+ }
105
107
106
- // Make sure its not null
107
- if ( ObjectImg != null )
108
- {
108
+ // Make sure its not null
109
+ if ( ObjectImg != null )
110
+ {
109
111
110
- // Draw Monuments
111
- MapImg = DrawMonument ( Monument , ObjectImg , MapImg , ServerStatus ) ;
112
- }
112
+ // Draw Monuments
113
+ MapImg = DrawMonument ( Monument , ObjectImg , MapImg , ServerStatus ) ;
114
+ }
113
115
114
- }
116
+ }
117
+ }
115
118
116
119
return MapImg ;
117
120
}
0 commit comments