# HG changeset patch # User nemo # Date 1506120351 14400 # Node ID 1b483882b60f4d445b037797d822127beb37f1d6 # Parent f3d6f1b0b59d461541a1809ca97ccbd3558b57a3 mix it up some more. also had screwed up -- inside quotes diff -r f3d6f1b0b59d -r 1b483882b60f hedgewars/uScript.pas --- a/hedgewars/uScript.pas Fri Sep 22 18:07:11 2017 -0400 +++ b/hedgewars/uScript.pas Fri Sep 22 18:45:51 2017 -0400 @@ -3015,7 +3015,10 @@ inComment := true // gonna add any non-magic whitespace and skip - just to make comment avoidance easier else if not inComment and (byte(mybuf[i]) > $20) and (byte(mybuf[i]) < $7F) and (mybuf[i]<>'-') then - AddRandomness(byte(mybuf[i])); + begin + AddRandomness(byte(mybuf[i])); // wish I had the seed... + CheckSum := CheckSum xor GetRandom($FFFFFFFF); + end; lastChar := mybuf[i]; if (byte(mybuf[i]) = $0D) or (byte(mybuf[i]) = $0A) then inComment := false @@ -3034,7 +3037,7 @@ begin if not inComment and (mybuf[i] = '"') and (lastChar <> '\') then inQuote := not inQuote; - if (lastChar = '-') and (mybuf[i] = '-') then + if not inQuote and (lastChar = '-') and (mybuf[i] = '-') then inComment := true; if not inComment and not inQuote then locSum := locSum xor (byte(mybuf[i]) shl (i mod 4)); @@ -3092,7 +3095,6 @@ ret:= lua_load(luaState, @ScriptLocaleReader, f, Str2PChar(s)) else ret:= lua_load(luaState, @ScriptReader, f, Str2PChar(s)); pfsClose(f); -CheckSum := CheckSum xor GetRandom($FFFFFFFF); if ret <> 0 then begin