From 30942137c753cd23707ba94769025c26ac06fdf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Tue, 7 Jan 2025 16:29:58 +0100 Subject: [PATCH] Fix SPRK sometimes being impossible to paste Broken since 462460b6b3f0, where Load started using create_part with p == -3, running all sorts of checks against SPRK and sometimes failing. --- src/simulation/Simulation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 3db57dc78..e4355c2aa 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -1812,7 +1812,7 @@ int Simulation::create_part(int p, int x, int y, int t, int v) if (x<0 || y<0 || x>=XRES || y>=YRES || t<=0 || t>=PT_NUM || !elements[t].Enabled) return -1; - if (t == PT_SPRK && !(p == -2 && elements[TYP(pmap[y][x])].CtypeDraw)) + if (t == PT_SPRK && p != -3 && !(p == -2 && elements[TYP(pmap[y][x])].CtypeDraw)) { int type = TYP(pmap[y][x]); int index = ID(pmap[y][x]);