From 34b99ca7139d19cd62ad6016c0b17c2281dfe94f Mon Sep 17 00:00:00 2001 From: ac-stef Date: Sun, 23 Feb 2014 14:40:16 +0100 Subject: [PATCH] engine tweak: static seed for random light calculation repeated recalcs now produce the same lighting - also, every player gets to see the same map --- source/src/worldlight.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/src/worldlight.cpp b/source/src/worldlight.cpp index ac26be82..54e0e023 100644 --- a/source/src/worldlight.cpp +++ b/source/src/worldlight.cpp @@ -177,14 +177,19 @@ void calclight() s->b = acol.z; } + uint keep = randomMT(); + seedMT(ents.length() + hdr.maprevision); + loopv(ents) { entity &e = ents[i]; if(e.type==LIGHT) calclightsource(e); } - block b = { 1, 1, ssize-2, ssize-2 }; - postlightarea(b); + seedMT(keep); + + block bb = { 1, 1, ssize-2, ssize-2 }; + postlightarea(bb); setvar("fullbright", 0); lastcalclight = totalmillis; }