hedgewars/uRandom.pas
changeset 3282 9ca28cef559a
parent 3236 4ab3917d7d44
child 3284 7ffd0e20ad08
--- a/hedgewars/uRandom.pas	Sat Apr 03 06:52:26 2010 +0000
+++ b/hedgewars/uRandom.pas	Sat Apr 03 08:46:01 2010 +0000
@@ -36,7 +36,7 @@
 
 implementation
 {$IFDEF DEBUGFILE}
-uses uMisc;
+uses uMisc, uConsole;
 {$ENDIF}
 var cirbuf: array[0..63] of Longword;
     n: byte;
@@ -77,6 +77,12 @@
 
 function GetRandom(m: LongWord): LongWord;
 begin
+if m = 0 then
+    begin
+    WriteLnToConsole('Warning: GetRandom(0) not defined');
+    GetRandom:= 0;
+    exit
+    end;
 GetNext;
 GetRandom:= GetNext mod m
 end;