File tree 3 files changed +11
-8
lines changed
src/net/highwayfrogs/editor/file/mof
3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public final void load(DataReader reader) {
38
38
}
39
39
40
40
@ Override
41
- public final void save (DataWriter writer ) {
41
+ public void save (DataWriter writer ) {
42
42
writer .writeBytes (getSignature ());
43
43
writer .writeNullPointer (); // File size. Maybe in the future we'll set the value to be proper.
44
44
writer .writeInt (this .flags );
Original file line number Diff line number Diff line change @@ -68,6 +68,16 @@ public void onLoad(DataReader reader) {
68
68
this .unknownValue = reader .readInt ();
69
69
}
70
70
71
+ @ Override
72
+ public void save (DataWriter writer ) {
73
+ if (getHolder ().isIncomplete () && getBytes () != null ) { // If the MOF is incomplete, save the incomplete mof.
74
+ writer .writeBytes (this .bytes );
75
+ return ;
76
+ }
77
+
78
+ super .save (writer );
79
+ }
80
+
71
81
@ Override
72
82
public void onSave (DataWriter writer ) {
73
83
writer .writeInt (getParts ().size ());
Original file line number Diff line number Diff line change @@ -82,13 +82,6 @@ public void save(DataWriter writer) {
82
82
return ;
83
83
}
84
84
85
- // Save incomplete mofs.
86
- byte [] copyBytes = asStaticFile ().getBytes ();
87
- if (copyBytes != null && isIncomplete ()) {
88
- writer .writeBytes (copyBytes );
89
- return ;
90
- }
91
-
92
85
// Save normal mofs.
93
86
if (isAnimatedMOF ()) { // If this is an animation, save the animation.
94
87
getAnimatedFile ().save (writer );
You can’t perform that action at this time.
0 commit comments