Fix saving modified Palette Level's palette

This commit is contained in:
manongjohn 2022-01-28 18:12:57 -05:00
parent 0f36cd1b8f
commit 9a59ad9f58

View file

@ -100,7 +100,8 @@ void TXshPaletteLevel::load() {
void TXshPaletteLevel::save() {
TFilePath path = getScene()->decodeFilePath(m_path);
if (TSystem::doesExistFileOrLevel(path) && m_palette) {
if (TSystem::doesExistFileOrLevel(path) && m_palette &&
m_palette->getDirtyFlag()) {
TFileStatus fs(path);
if (!fs.isWritable()) {
throw TSystemException(
@ -108,6 +109,7 @@ void TXshPaletteLevel::save() {
}
TOStream os(path);
os << m_palette;
m_palette->setDirtyFlag(false);
}
}