X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Flib%2Frandom.qc;h=a5ff69356a21f516ba290bac01761eac2a7cce88;hb=f7673c11a5261668cc3e3896391fafd546168994;hp=627fec11a92e1293bec76db098230b0a5fafc7f0;hpb=d492869ab1f18e05121529b7bcffcb637d13994c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/random.qc b/qcsrc/lib/random.qc index 627fec11a..a5ff69356 100644 --- a/qcsrc/lib/random.qc +++ b/qcsrc/lib/random.qc @@ -1,5 +1,6 @@ #include "random.qh" +ERASEABLE void RandomSelection_Init() { RandomSelection_totalweight = 0; @@ -9,6 +10,7 @@ void RandomSelection_Init() RandomSelection_best_priority = -1; } +ERASEABLE void RandomSelection_Add(entity e, float f, string s, vector v, float weight, float priority) { if (priority > RandomSelection_best_priority) @@ -36,6 +38,7 @@ void RandomSelection_Add(entity e, float f, string s, vector v, float weight, fl float DistributeEvenly_amount; float DistributeEvenly_totalweight; +ERASEABLE void DistributeEvenly_Init(float amount, float totalweight) { if (DistributeEvenly_amount) @@ -47,6 +50,7 @@ void DistributeEvenly_Init(float amount, float totalweight) DistributeEvenly_totalweight = totalweight; } +ERASEABLE float DistributeEvenly_Get(float weight) { float f; @@ -57,6 +61,7 @@ float DistributeEvenly_Get(float weight) return f; } +ERASEABLE float DistributeEvenly_GetRandomized(float weight) { float f; @@ -70,6 +75,7 @@ float DistributeEvenly_GetRandomized(float weight) // from the GNU Scientific Library float gsl_ran_gaussian_lastvalue; float gsl_ran_gaussian_lastvalue_set; +ERASEABLE float gsl_ran_gaussian(float sigma) { if (gsl_ran_gaussian_lastvalue_set)