use locale rules for the challenge hashes
authornemo
Tue, 18 Sep 2018 19:38:58 -0400
changeset 13824 552f0d5ab3e7
parent 13823 a623657da787
child 13825 096cc009e0b8
use locale rules for the challenge hashes
hedgewars/uScript.pas
share/hedgewars/Data/Scripts/OfficialChallengeHashes.lua
share/hedgewars/Data/Scripts/OfficialChallenges.lua
--- a/hedgewars/uScript.pas	Tue Sep 18 19:30:55 2018 -0400
+++ b/hedgewars/uScript.pas	Tue Sep 18 19:38:58 2018 -0400
@@ -3654,7 +3654,7 @@
 hedgewarsMountPackage(Str2PChar(copy(s, 3, length(s)-6)+'.hwp'));
 
 physfsReaderSetBuffer(@buf);
-if Pos('Locale/',s) <> 0 then
+if (Pos('Locale/',s) <> 0) or (s = 'Scripts/OfficialChallengeHashes.lua') then
      ret:= lua_load(luaState, @ScriptLocaleReader, f, Str2PChar(s))
 else
 	begin
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Scripts/OfficialChallengeHashes.lua	Tue Sep 18 19:38:58 2018 -0400
@@ -0,0 +1,31 @@
+local maps = {
+    ["Border,60526986531,838018718"] = "Racer Challenge #1"
+    , ["Border,71022545335,-490229244"] = "Racer Challenge #2"
+    , ["Border,40469748943,806689586"] = "Racer Challenge #3"
+    , ["85940488650,-134869715"] = "Racer Challenge #4"
+    , ["62080348735,-661895109"] = "Racer Challenge #5"
+    , ["56818170733,479034891"] = "Racer Challenge #6"
+    , ["Border,25372705797,1770509913"] = "Racer Challenge #7"
+    , ["Border,10917540013,1902370941"] = "Racer Challenge #8"
+    , ["Border,43890274319,185940363"] = "Racer Challenge #9"
+    , ["Border,27870148394,751885839"] = "Racer Challenge #10"
+    , ["Border,22647869226,178845011"] = "Racer Challenge #11"
+    , ["Border,46954401793,706743197"] = "Racer Challenge #12"
+    , ["Border,60760377667,157242054"] = "Racer Challenge #13"
+    , ["Border,51825989393,-1585582638"] = "Racer Challenge #14"
+    , ["81841189250,256715557"] = "Racer Challenge #15"
+    , ["Border,44246064625,-528106034"] = "Racer Challenge #16"
+    , ["60906776802,-1389184823"] = "Racer Challenge #17"
+    , ["Border,70774747774,-534640804"] = "Racer Challenge #18"
+    , ["Border,50512019610,-1839546856"] = "Racer Challenge #19"
+    , ["60715683005,-281312897"] = "Racer Challenge #20"
+-- tech racer
+    , ["Border,19661006772,-975391975"] = "Tech Racer #1"
+    , ["Border,19661306766,-975391975"] = "Tech Racer #2"
+    , ["Border,19661606760,-975391975"] = "Tech Racer #3"
+    , ["Border,19661906754,-975391975"] = "Tech Racer #4"
+    , ["Border,19662206748,-975391975"] = "Tech Racer #5"
+    , ["Border,19662506742,-975391975"] = "Tech Racer #6"
+    , ["Border,19662806736,-975391975"] = "Tech Racer #7"
+    , ["Border,19663106730,-975391975"] = "Tech Racer #8"
+    }
--- a/share/hedgewars/Data/Scripts/OfficialChallenges.lua	Tue Sep 18 19:30:55 2018 -0400
+++ b/share/hedgewars/Data/Scripts/OfficialChallenges.lua	Tue Sep 18 19:38:58 2018 -0400
@@ -1,34 +1,4 @@
-local maps = {
-    ["Border,60526986531,838018718"] = "Racer Challenge #1"
-    , ["Border,71022545335,-490229244"] = "Racer Challenge #2"
-    , ["Border,40469748943,806689586"] = "Racer Challenge #3"
-    , ["85940488650,-134869715"] = "Racer Challenge #4"
-    , ["62080348735,-661895109"] = "Racer Challenge #5"
-    , ["56818170733,479034891"] = "Racer Challenge #6"
-    , ["Border,25372705797,1770509913"] = "Racer Challenge #7"
-    , ["Border,10917540013,1902370941"] = "Racer Challenge #8"
-    , ["Border,43890274319,185940363"] = "Racer Challenge #9"
-    , ["Border,27870148394,751885839"] = "Racer Challenge #10"
-    , ["Border,22647869226,178845011"] = "Racer Challenge #11"
-    , ["Border,46954401793,706743197"] = "Racer Challenge #12"
-    , ["Border,60760377667,157242054"] = "Racer Challenge #13"
-    , ["Border,51825989393,-1585582638"] = "Racer Challenge #14"
-    , ["81841189250,256715557"] = "Racer Challenge #15"
-    , ["Border,44246064625,-528106034"] = "Racer Challenge #16"
-    , ["60906776802,-1389184823"] = "Racer Challenge #17"
-    , ["Border,70774747774,-534640804"] = "Racer Challenge #18"
-    , ["Border,50512019610,-1839546856"] = "Racer Challenge #19"
-    , ["60715683005,-281312897"] = "Racer Challenge #20"
--- tech racer
-    , ["Border,19661006772,-975391975"] = "Tech Racer #1"
-    , ["Border,19661306766,-975391975"] = "Tech Racer #2"
-    , ["Border,19661606760,-975391975"] = "Tech Racer #3"
-    , ["Border,19661906754,-975391975"] = "Tech Racer #4"
-    , ["Border,19662206748,-975391975"] = "Tech Racer #5"
-    , ["Border,19662506742,-975391975"] = "Tech Racer #6"
-    , ["Border,19662806736,-975391975"] = "Tech Racer #7"
-    , ["Border,19663106730,-975391975"] = "Tech Racer #8"
-    }
+HedgewarsScriptLoad("/Scripts/OfficialChallengeHashes.lua")
 
 -- modified Adler hash
 local hashA = 0