From: bones_was_here Date: Sun, 21 May 2023 01:29:48 +0000 (+1000) Subject: Clarify behaviour of random() builtin X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9b501a50da3a1c4dc70b19dd32496176019654b1;p=xonotic%2Fdarkplaces.git Clarify behaviour of random() builtin --- diff --git a/dpdefs/csprogsdefs.qc b/dpdefs/csprogsdefs.qc index 95f9beac..9b00de12 100644 --- a/dpdefs/csprogsdefs.qc +++ b/dpdefs/csprogsdefs.qc @@ -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; diff --git a/dpdefs/menudefs.qc b/dpdefs/menudefs.qc index 7282f4cd..1278dd71 100644 --- a/dpdefs/menudefs.qc +++ b/dpdefs/menudefs.qc @@ -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; diff --git a/dpdefs/progsdefs.qc b/dpdefs/progsdefs.qc index e0a9acd1..937f0a72 100644 --- a/dpdefs/progsdefs.qc +++ b/dpdefs/progsdefs.qc @@ -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; diff --git a/prvm_cmds.c b/prvm_cmds.c index 8bcfebd9..d362aa72 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -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() =================