File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ class HealthIcon extends FlxSprite
4646 if (! Paths .fileExists (' images/' + name + ' .png' , IMAGE )) name = ' icons/icon-face' ; // Prevents crash from missing icon
4747 var file : Dynamic = Paths .image (name );
4848
49- var jsonPath : String = name ;
49+ var jsonPath : String = haxe.io. Path . directory ( Paths . file ( ' images/icons/icons/ ' )) ;
5050 var jsonData : Dynamic = null ;
5151
5252 // Try to load JSON file
@@ -83,8 +83,10 @@ class HealthIcon extends FlxSprite
8383 case WINNING : ' WINNING' ;
8484 }};
8585 if (! sys. FileSystem .exists (jsonPath )) {
86- var file = sys.io. File .write (jsonPath , true ); // ???
87- file .close ();
86+ try {
87+ var file = sys.io. File .write (jsonPath , true ); // ???
88+ file .close ();
89+ } catch (e ) {trace (" Failed to write JSON for " + char );}
8890 }
8991 sys.io. File .saveContent (jsonPath , haxe. Json .stringify (jsonData , null , ' \t ' ));
9092 trace (' Remembering this type for future use: ' + jsonPath );
You can’t perform that action at this time.
0 commit comments