]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Clarify behaviour of random() builtin
authorbones_was_here <bones_was_here@xonotic.au>
Sun, 21 May 2023 01:29:48 +0000 (11:29 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Sun, 21 May 2023 01:29:48 +0000 (11:29 +1000)
dpdefs/csprogsdefs.qc
dpdefs/menudefs.qc
dpdefs/progsdefs.qc
prvm_cmds.c

index 95f9beac5ff515c5c21f0123c461dbabbf3ed603..9b00de12adc9314559ae93c99e9f6152e140f0b2 100644 (file)
@@ -336,7 +336,7 @@ void(entity e, string m) setmodel = #3;
 void(entity e, vector min, vector max) setsize = #4;
 
 void() break_to_debugger = #6;
-float() random = #7;
+float() random = #7; // Returns a random number > 0 and < 1
 void(entity e, float chan, string samp, float volume, float atten, ...) sound = #8;
 vector(vector v) normalize = #9;
 void(string e) error = #10;
index 7282f4cdbbe4e59a609a4ecfe7fc42a37af330e4..1278dd710a8052bd77db771c258db428be8c0904 100644 (file)
@@ -179,7 +179,7 @@ float       vlen(vector v)                  = #9;
 float          vectoyaw(vector v)              = #10;
 vector         vectoangles(vector v)           = #11;
 
-float  random(void)  = #12;
+float  random(void)  = #12; // Returns a random number > 0 and < 1
 
 void   cmd(string command, ...) = #13;
 
index e0a9acd160868b6df356f9309872e3930a77c0d9..937f0a72c14523c875735cafc6d1aab259458493 100644 (file)
@@ -403,7 +403,7 @@ void(entity e, string m) setmodel   = #3;           // set movetype and solid first
 void(entity e, vector min, vector max) setsize = #4;
 // #5 was removed
 void() break_to_debugger                                               = #6;
-float() random                                         = #7;           // returns 0 - 1
+float() random                                         = #7;   // Returns a random number > 0 and < 1
 void(entity e, float chan, string samp, float volume, ...) sound = #8;
 vector(vector v) normalize                     = #9;
 void(string e, ...) error                              = #10;
index 8bcfebd98b048b8321a7cc1c55a17757f2339663..d362aa72aa7bb19aaa209de70e7eca25af4c3331 100644 (file)
@@ -570,7 +570,7 @@ void VM_vectoangles(prvm_prog_t *prog)
 =================
 VM_random
 
-Returns a number from 0<= num < 1
+Returns a random number > 0 and < 1
 
 float random()
 =================