Skip to content

Commit c6f34f9

Browse files
authored
fix: Use internal seed for RANDOM on GC3.2 (#406)
The seed needs to be a numeric value, not a substring containing numeric data ... and let GC3.2 do its magic of self-seeding
1 parent 5b6f684 commit c6f34f9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/world/world.cob

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,10 @@ LINKAGE SECTION.
184184

185185
PROCEDURE DIVISION USING LK-POSITION.
186186
IF INIT-DONE = 0
187-
MOVE FUNCTION RANDOM(FUNCTION CURRENT-DATE(1:16)) TO RANDOM-VALUE
187+
*> GnuCOBOL 3.2 has a better internal seed, so we let it use that instead
188+
>>IF GCVERSION < 32
189+
MOVE FUNCTION RANDOM(FUNCTION NUMVAL(FUNCTION CURRENT-DATE(1:16))) TO RANDOM-VALUE
190+
>>END-IF
188191

189192
CALL "Registries-Lookup" USING "minecraft:block" "minecraft:air" BLOCK-ID-AIR
190193
CALL "Registries-Lookup" USING "minecraft:block" "minecraft:cave_air" BLOCK-ID-CAVE-AIR

0 commit comments

Comments
 (0)