Commit a29ddd4 1 parent e2dd56b commit a29ddd4 Copy full SHA for a29ddd4
File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -192,8 +192,14 @@ class _GodotSharpDirs {
192
192
}
193
193
}
194
194
if (!has_data) {
195
- // 3. Extract the data to a temporary location to load from there.
196
- Ref<DirAccess> da = DirAccess::create_for_path (packed_path);
195
+ // 3. Extract the data to a temporary location to load from there, delete old data if it exists but is not up-to-date.
196
+ Ref<DirAccess> da;
197
+ if (DirAccess::exists (data_dir_root)) {
198
+ da = DirAccess::open (data_dir_root);
199
+ ERR_FAIL_COND (da.is_null ());
200
+ ERR_FAIL_COND (da->erase_contents_recursive () != OK);
201
+ }
202
+ da = DirAccess::create_for_path (packed_path);
197
203
ERR_FAIL_COND (da.is_null ());
198
204
ERR_FAIL_COND (da->copy_dir (packed_path, data_dir_root) != OK);
199
205
}
You can’t perform that action at this time.
0 commit comments