]> git.localhorst.tv Git - blobs.git/blobdiff - src/creature/goal.cpp
color mutation
[blobs.git] / src / creature / goal.cpp
index 5f9f1e839d9ed24bdff82c62caaf7ea50bd2b42d..a4f33304f3f75af56b86c376b0c653879405006e 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "Creature.hpp"
 #include "../app/Assets.hpp"
-#include "../ui/String.hpp"
+#include "../ui/string.hpp"
 #include "../world/Planet.hpp"
 #include "../world/Resource.hpp"
 #include "../world/Simulation.hpp"
@@ -111,7 +111,7 @@ void BlobBackgroundTask::CheckMutate() {
        // check for random property mutation
        if (GetCreature().MutateChance() > Assets().random.UNorm()) {
                double amount = 1.0 + (Assets().random.SNorm() * 0.05);
-               math::Distribution &d = GetCreature().GetGenome().properties.props[(int(Assets().random.UNorm() * 8.0) % 8)];
+               math::Distribution &d = GetCreature().GetGenome().properties.props[Assets().random.UInt(9)];
                if (Assets().random.UNorm() < 0.5) {
                        d.Mean(d.Mean() * amount);
                } else {