samples; coursework: Fixed random seeding with time not working
[sdk] / installer / coursework / Chapter 6 - Classes, Methods and Instances / Lab6 / lab6.ec
index 268655a..9002aa6 100644 (file)
@@ -576,7 +576,7 @@ class RPGApp : Application
 
    void Main()
    {
-      RandomSeed((uint)(GetTime()*1000));
+      RandomSeed((uint)(((uint64)(GetTime() * 1000)) & MAXDWORD));
       PrintLn("Welcome to this great minimalist RPG!");
       PrintLn("You will need to save the princess from an Evil Sorcerer.");
       PrintLn("But first you should wander the realm to fight the sorcerer's minions, ");