From 5a5eace691676bf886e58042e88a2ce13a5ab764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Mon, 12 Oct 2020 17:36:24 +0200 Subject: [PATCH] Fix built-in GOL types --- src/simulation/elements/LIFE.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/simulation/elements/LIFE.cpp b/src/simulation/elements/LIFE.cpp index c8404e2dc..77491fba3 100644 --- a/src/simulation/elements/LIFE.cpp +++ b/src/simulation/elements/LIFE.cpp @@ -84,16 +84,19 @@ static int graphics(GRAPHICS_FUNC_ARGS) static void create(ELEMENT_CREATE_FUNC_ARGS) { - sim->parts[i].ctype = v & 0x1FFFFF; + // * 0x200000: No need to look for colours, they'll be set later anyway. + bool skipLookup = v & 0x200000; + v &= 0x1FFFFF; + sim->parts[i].ctype = v; if (v < NGOL) { sim->parts[i].dcolour = builtinGol[v].colour; sim->parts[i].tmp = builtinGol[v].colour2; v = builtinGol[v].ruleset; } - else if (!(v & 0x200000)) // * 0x200000: No need to look for colours, they'll be set later anyway. + else if (!skipLookup) { - auto *cgol = sim->GetCustomGOLByRule(v & 0x1FFFFF); + auto *cgol = sim->GetCustomGOLByRule(v); if (cgol) { sim->parts[i].dcolour = cgol->colour1;