Compare commits
No commits in common. "0826d4aedeadd2dfb5c9307de5a2b6599cb6bb15" and "f500e982e6930afec7011b68683286d54d0114b1" have entirely different histories.
0826d4aede
...
f500e982e6
3 changed files with 3 additions and 33 deletions
|
@ -121,15 +121,8 @@ auto MapPropertySerialiser::serialiseProperty(UnrealPropertyBase::ptr& prop, Uns
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto& value : pair.values) {
|
for(auto& value : pair.values) {
|
||||||
if(map_prop->valueType == "StructProperty") {
|
if(!serialiser.write(value, dummy_bytes_written, writer)) {
|
||||||
if(!serialiser.write(value, dummy_bytes_written, writer)) {
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if(!serialiser.writeItem(value, map_prop->valueType, dummy_bytes_written, writer)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,10 +39,6 @@ auto UESaveFile::lastError() const -> const std::string& {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto UESaveFile::reloadData() -> bool {
|
auto UESaveFile::reloadData() -> bool {
|
||||||
if(_noReloadAfterSave) {
|
|
||||||
return valid();
|
|
||||||
}
|
|
||||||
|
|
||||||
loadData();
|
loadData();
|
||||||
return valid();
|
return valid();
|
||||||
}
|
}
|
||||||
|
@ -52,7 +48,7 @@ auto UESaveFile::props() -> Containers::ArrayView<UnrealPropertyBase::ptr> {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto UESaveFile::saveToFile() -> bool {
|
auto UESaveFile::saveToFile() -> bool {
|
||||||
BinaryWriter writer{_filepath + ".tmp"};
|
BinaryWriter writer{_filepath + ".other"};
|
||||||
|
|
||||||
if(!writer.open()) {
|
if(!writer.open()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -101,23 +97,6 @@ auto UESaveFile::saveToFile() -> bool {
|
||||||
|
|
||||||
writer.writeUnsignedInt(0);
|
writer.writeUnsignedInt(0);
|
||||||
|
|
||||||
writer.closeFile();
|
|
||||||
|
|
||||||
if(!Utility::Directory::copy(_filepath, _filepath + ".bak")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!Utility::Directory::rm(_filepath)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!Utility::Directory::move(_filepath + ".tmp", _filepath)) {
|
|
||||||
Utility::Directory::move(_filepath + ".bak", _filepath);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
_noReloadAfterSave = true;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,8 +63,6 @@ class UESaveFile {
|
||||||
|
|
||||||
std::string _filepath;
|
std::string _filepath;
|
||||||
|
|
||||||
bool _noReloadAfterSave = false;
|
|
||||||
|
|
||||||
Containers::StaticArray<4, char> _magicBytes{'G', 'V', 'A', 'S'};
|
Containers::StaticArray<4, char> _magicBytes{'G', 'V', 'A', 'S'};
|
||||||
|
|
||||||
UnsignedInt _saveVersion = 0;
|
UnsignedInt _saveVersion = 0;
|
||||||
|
|
Loading…
Reference in a new issue