Separate synced pixels from land digests - this is mostly to allow the official racer digests to remain unchanged.
authornemo
Tue, 18 Sep 2018 19:21:36 -0400
changeset 13822 381e37c6d5d9
parent 13821 3f30980bf5b2
child 13823 a623657da787
Separate synced pixels from land digests - this is mostly to allow the official racer digests to remain unchanged.
hedgewars/uLand.pas
--- a/hedgewars/uLand.pas	Tue Sep 18 00:07:36 2018 +0200
+++ b/hedgewars/uLand.pas	Tue Sep 18 19:21:36 2018 -0400
@@ -984,12 +984,14 @@
 
 procedure chSendLandDigest(var s: shortstring);
 var i: LongInt;
+	landPixelDigest  : LongInt;	
 begin
+	landPixelDigest:= 1;
     for i:= 0 to LAND_HEIGHT-1 do
-        syncedPixelDigest:= Adler32Update(syncedPixelDigest, @Land[i,0], LAND_WIDTH*2);
-    s:= 'M' + IntToStr(syncedPixelDigest); // + cScriptName; script name is no longer needed. scripts are hashed
+        landPixelDigest:= Adler32Update(landPixelDigest, @Land[i,0], LAND_WIDTH*2);
+    s:= 'M' + IntToStr(syncedPixelDigest)+'|'+IntToStr(landPixelDigest);
 
-    ScriptSetString('LandDigest', s);
+    ScriptSetString('LandDigest',IntToStr(landPixelDigest));
 
     chLandCheck(s);
     if allOK then SendIPCRaw(@s[0], Length(s) + 1)