diff --git a/source/src/editing.cpp b/source/src/editing.cpp index 4146b235..1d67b2dc 100644 --- a/source/src/editing.cpp +++ b/source/src/editing.cpp @@ -303,7 +303,7 @@ void paste() sel.y = sely + dy; if(!correctsel(sel) || sel.xs!=copyblock->xs || sel.ys!=copyblock->ys) { conoutf("incorrect selection"); return; } makeundo(sel); - blockpaste(*copyblock, sel.x, sel.y); + blockpaste(*copyblock, sel.x, sel.y, true); } remipmore(sel); } diff --git a/source/src/protos.h b/source/src/protos.h index 588880ff..2717bc7b 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -474,7 +474,7 @@ extern void undodynlights(); extern void cleardynlights(); extern void removedynlights(physent *owner); extern block *blockcopy(const block &b); -extern void blockpaste(const block &b, int bx, int by); +extern void blockpaste(const block &b, int bx, int by, bool light); extern void blockpaste(const block &b); extern void freeblock(block *&b); diff --git a/source/src/worldlight.cpp b/source/src/worldlight.cpp index a2818982..03b50743 100644 --- a/source/src/worldlight.cpp +++ b/source/src/worldlight.cpp @@ -337,16 +337,37 @@ block *blockcopy(const block &s) return b; } -void blockpaste(const block &b, int bx, int by) +void blockpaste(const block &b, int bx, int by, bool light) { const sqr *q = (const sqr *)((&b)+1); - for(int y = by; yr; + tg = dest->g; + tb = dest->b; + + *dest = *q++; + + if (light) //edit mode paste + { + dest->r = tr; + dest->g = tg; + dest->b = tb; + } + } remipmore(b); } void blockpaste(const block &b) { - blockpaste(b, b.x, b.y); + blockpaste(b, b.x, b.y, false); } void freeblock(block *&b)