From e80dc7b114b37097c1e0f8d8f9af6b9e7f5a13d5 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Wed, 14 Jul 2021 00:26:21 -0400 Subject: [PATCH] Preserve GoL deco in older saves; deco on builtin GoL no longer renders when decorations are off --- src/client/GameSave.cpp | 6 ++++-- src/simulation/elements/LIFE.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/GameSave.cpp b/src/client/GameSave.cpp index b7c493e60..2fb2f880b 100644 --- a/src/client/GameSave.cpp +++ b/src/client/GameSave.cpp @@ -1335,7 +1335,8 @@ void GameSave::readOPS(char * data, int dataLength) if (particles[newIndex].ctype >= 0 && particles[newIndex].ctype < NGOL) { particles[newIndex].tmp2 = particles[newIndex].tmp; - particles[newIndex].dcolour = builtinGol[particles[newIndex].ctype].colour; + if (!particles[newIndex].dcolour) + particles[newIndex].dcolour = builtinGol[particles[newIndex].ctype].colour; particles[newIndex].tmp = builtinGol[particles[newIndex].ctype].colour2; } } @@ -1902,7 +1903,8 @@ void GameSave::readPSv(char * saveDataChar, int dataLength) particles[i-1].tmp = 0; if (particles[i-1].ctype >= 0 && particles[i-1].ctype < NGOL) { - particles[i-1].dcolour = builtinGol[particles[i-1].ctype].colour; + if (!particles[i-1].dcolour) + particles[i-1].dcolour = builtinGol[particles[i-1].ctype].colour; particles[i-1].tmp = builtinGol[particles[i-1].ctype].colour2; } } diff --git a/src/simulation/elements/LIFE.cpp b/src/simulation/elements/LIFE.cpp index 4ca096051..b64b101f1 100644 --- a/src/simulation/elements/LIFE.cpp +++ b/src/simulation/elements/LIFE.cpp @@ -60,7 +60,7 @@ static int graphics(GRAPHICS_FUNC_ARGS) bool renderDeco = !ren->blackDecorations; if (ruleset >= 0 && ruleset < NGOL) { - if (!renderDeco) + if (!renderDeco || !ren->decorations_enable) { colour1 = builtinGol[ruleset].colour; colour2 = builtinGol[ruleset].colour2;