]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/random.qc
Merge branch 'master' into Mario/overkill
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / random.qc
index aff961c55da56b9dcde016c90335dbee7026d5e9..627fec11a92e1293bec76db098230b0a5fafc7f0 100644 (file)
@@ -9,7 +9,7 @@ void RandomSelection_Init()
        RandomSelection_best_priority = -1;
 }
 
-void RandomSelection_Add(entity e, float f, string s, float weight, float priority)
+void RandomSelection_Add(entity e, float f, string s, vector v, float weight, float priority)
 {
        if (priority > RandomSelection_best_priority)
        {
@@ -17,6 +17,7 @@ void RandomSelection_Add(entity e, float f, string s, float weight, float priori
                RandomSelection_chosen_ent = e;
                RandomSelection_chosen_float = f;
                RandomSelection_chosen_string = s;
+               RandomSelection_chosen_vec = v;
                RandomSelection_totalweight = weight;
        }
        else if (priority == RandomSelection_best_priority)
@@ -27,6 +28,7 @@ void RandomSelection_Add(entity e, float f, string s, float weight, float priori
                        RandomSelection_chosen_ent = e;
                        RandomSelection_chosen_float = f;
                        RandomSelection_chosen_string = s;
+                       RandomSelection_chosen_vec = v;
                }
        }
 }
@@ -38,8 +40,7 @@ void DistributeEvenly_Init(float amount, float totalweight)
 {
        if (DistributeEvenly_amount)
        {
-               LOG_TRACE("DistributeEvenly_Init: UNFINISHED DISTRIBUTION (", ftos(DistributeEvenly_amount), " for ");
-               LOG_TRACE(ftos(DistributeEvenly_totalweight), " left!)\n");
+               LOG_TRACE("DistributeEvenly_Init: UNFINISHED DISTRIBUTION (", ftos(DistributeEvenly_amount), " for ", ftos(DistributeEvenly_totalweight), " left!)");
        }
        if (totalweight == 0) DistributeEvenly_amount = 0;
        else DistributeEvenly_amount = amount;
@@ -97,7 +98,7 @@ float gsl_ran_gaussian(float sigma)
                prandom_seed = c;
 
        #ifdef USE_PRANDOM_DEBUG
-                       LOG_TRACE("RANDOM -> ", ftos(c), "\n");
+                       LOG_TRACE("RANDOM -> ", ftos(c));
        #endif
 
                return c / 65536;  // in [0..1[
@@ -122,14 +123,14 @@ float gsl_ran_gaussian(float sigma)
        {
                prandom_seed = seed;
        #ifdef USE_PRANDOM_DEBUG
-                       LOG_TRACE("SRANDOM ", ftos(seed), "\n");
+                       LOG_TRACE("SRANDOM ", ftos(seed));
        #endif
        }
 
        #ifdef USE_PRANDOM_DEBUG
                void prandom_debug()
                {
-                       LOG_TRACE("Current random seed = ", ftos(prandom_seed), "\n");
+                       LOG_TRACE("Current random seed = ", ftos(prandom_seed));
                }
        #endif
 #endif