diff --git a/src/client/GameSave.cpp b/src/client/GameSave.cpp index cace44ddc..5d57765f2 100644 --- a/src/client/GameSave.cpp +++ b/src/client/GameSave.cpp @@ -1169,6 +1169,19 @@ void GameSave::readOPS(char * data, int dataLength) pavg = partsData[i++]; pavg |= (((unsigned)partsData[i++]) << 8); particles[newIndex].pavg[1] = (float)pavg; + + switch (particles[newIndex].type) + { + // List of elements that save pavg with a multiplicative bias of 2**6 + // (or not at all if pressure is not saved). + // If you change this list, change it in Simulation::Load and GameSave::serialiseOPS too! + case PT_QRTZ: + case PT_GLAS: + case PT_TUNG: + particles[newIndex].pavg[0] /= 64; + particles[newIndex].pavg[1] /= 64; + break; + } } //Particle specific parsing: @@ -2311,7 +2324,7 @@ char * GameSave::serialiseOPS(unsigned int & dataLength) { // List of elements that save pavg with a multiplicative bias of 2**6 // (or not at all if pressure is not saved). - // If you change this list, change it in Simulation::Load too! + // If you change this list, change it in Simulation::Load and GameSave::readOPS too! case PT_QRTZ: case PT_GLAS: case PT_TUNG: diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index c81872890..ff995d967 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -243,7 +243,7 @@ int Simulation::Load(int fullX, int fullY, GameSave * save, bool includePressure // List of elements that load pavg with a multiplicative bias of 2**6 // (or not at all if pressure is not loaded). - // If you change this list, change it in GameSave::serialiseOPS too! + // If you change this list, change it in GameSave::serialiseOPS and GameSave::readOPS too! case PT_QRTZ: case PT_GLAS: case PT_TUNG: @@ -252,11 +252,6 @@ int Simulation::Load(int fullX, int fullY, GameSave * save, bool includePressure parts[i].pavg[0] = 0; parts[i].pavg[1] = 0; } - else - { - parts[i].pavg[0] /= 64; - parts[i].pavg[1] /= 64; - } break; } }