X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Flib%2Frandom.qh;h=e3900697b7d1a54b29f30a75e592abe9fc426b01;hb=83e2013a3aa40f8e5cfeac82e83c9abdd7a038b8;hp=5b7fb0d3cce723e58d9b7ca4ecb27edde91d9542;hpb=317ec3eb27ada1c4668876e9499136125acb7984;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/random.qh b/qcsrc/lib/random.qh index 5b7fb0d3c..e3900697b 100644 --- a/qcsrc/lib/random.qh +++ b/qcsrc/lib/random.qh @@ -1,14 +1,20 @@ -#ifndef RANDOM_H -#define RANDOM_H +#pragma once float RandomSelection_totalweight; float RandomSelection_best_priority; entity RandomSelection_chosen_ent; float RandomSelection_chosen_float; string RandomSelection_chosen_string; +vector RandomSelection_chosen_vec; +ERASEABLE void RandomSelection_Init(); -void RandomSelection_Add(entity e, float f, string s, float weight, float priority); +ERASEABLE +void RandomSelection_Add(entity e, float f, string s, vector v, float weight, float priority); +#define RandomSelection_AddEnt(e, weight, priority) RandomSelection_Add(e, 0, string_null, '0 0 0', weight, priority) +#define RandomSelection_AddFloat(f, weight, priority) RandomSelection_Add(NULL, f, string_null, '0 0 0', weight, priority) +#define RandomSelection_AddString(s, weight, priority) RandomSelection_Add(NULL, 0, s, '0 0 0', weight, priority) +#define RandomSelection_AddVec(v, weight, priority) RandomSelection_Add(NULL, 0, string_null, v, weight, priority) // prandom - PREDICTABLE random number generator @@ -30,4 +36,3 @@ void RandomSelection_Add(entity e, float f, string s, float weight, float priori #define psrandom(x) #define prandom_debug() #endif -#endif