diff --git a/src/client/GameSave.cpp b/src/client/GameSave.cpp index b85639a79e..10a1e61ead 100644 --- a/src/client/GameSave.cpp +++ b/src/client/GameSave.cpp @@ -1914,13 +1914,13 @@ char * GameSave::serialiseOPS(unsigned int & dataLength) //Store temperature as an offset of 21C(294.15K) or go into a 16byte int and store the whole thing if(fabs(particles[i].temp-294.15f)<127) { - tempTemp = (particles[i].temp-294.15f); + tempTemp = floor(particles[i].temp-294.15f+0.5f); partsData[partsDataLen++] = tempTemp; } else { fieldDesc |= 1; - tempTemp = particles[i].temp; + tempTemp = (int)(particles[i].temp+0.5f); partsData[partsDataLen++] = tempTemp; partsData[partsDataLen++] = tempTemp >> 8; } diff --git a/src/simulation/elements/DLAY.cpp b/src/simulation/elements/DLAY.cpp index 548ce6ceb3..89b75c632f 100644 --- a/src/simulation/elements/DLAY.cpp +++ b/src/simulation/elements/DLAY.cpp @@ -64,7 +64,7 @@ int Element_DLAY::update(UPDATE_FUNC_ARGS) continue; if ((r&0xFF)==PT_SPRK && parts[i].life==0 && parts[r>>8].life>0 && parts[r>>8].life<4 && parts[r>>8].ctype==PT_PSCN) { - parts[i].life = (int)(parts[i].temp-273.15); + parts[i].life = (int)(parts[i].temp-273.15f+0.5f); } else if ((r&0xFF)==PT_DLAY) {