@@ -162,8 +162,8 @@ void ExportBackground(UndertaleBackground background)
162
162
new XComment ( gmxDeclaration ) ,
163
163
new XElement ( "background" ,
164
164
new XElement ( "istileset" , "-1" ) ,
165
- new XElement ( "tilewidth" , background . Texture . BoundingWidth . ToString ( ) ) ,
166
- new XElement ( "tileheight" , background . Texture . BoundingHeight . ToString ( ) ) ,
165
+ new XElement ( "tilewidth" , background . Texture == null ? "0" : background . Texture . BoundingWidth . ToString ( ) ) ,
166
+ new XElement ( "tileheight" , background . Texture == null ? "0" : background . Texture . BoundingHeight . ToString ( ) ) ,
167
167
new XElement ( "tilexoff" , "0" ) ,
168
168
new XElement ( "tileyoff" , "0" ) ,
169
169
new XElement ( "tilehsep" , "0" ) ,
@@ -174,16 +174,17 @@ void ExportBackground(UndertaleBackground background)
174
174
new XElement ( "TextureGroup0" , "0" )
175
175
) ,
176
176
new XElement ( "For3D" , "0" ) ,
177
- new XElement ( "width" , background . Texture . BoundingWidth . ToString ( ) ) ,
178
- new XElement ( "height" , background . Texture . BoundingHeight . ToString ( ) ) ,
177
+ new XElement ( "width" , background . Texture == null ? "0" : background . Texture . BoundingWidth . ToString ( ) ) ,
178
+ new XElement ( "height" , background . Texture == null ? "0" : background . Texture . BoundingHeight . ToString ( ) ) ,
179
179
new XElement ( "data" , "images\\ " + background . Name . Content + ".png" )
180
180
)
181
181
) ;
182
182
183
183
File . WriteAllText ( projFolder + "/background/" + background . Name . Content + ".background.gmx" , gmx . ToString ( ) ) ;
184
184
185
185
// Save background images
186
- worker . ExportAsPNG ( background . Texture , projFolder + "/background/images/" + background . Name . Content + ".png" ) ;
186
+ if ( background . Texture != null )
187
+ worker . ExportAsPNG ( background . Texture , projFolder + "/background/images/" + background . Name . Content + ".png" ) ;
187
188
}
188
189
// --------------- Export Object ---------------
189
190
async Task ExportGameObjects ( )
@@ -688,4 +689,4 @@ void WriteIndexes<T>(XElement rootNode, string elementName, string attributeName
688
689
resourcesNode . Add ( resourceNode ) ;
689
690
}
690
691
rootNode . Add ( resourcesNode ) ;
691
- }
692
+ }
0 commit comments