home · contact · privacy
Server: Fix determinism bug in thingproliferation.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 5 Sep 2015 04:01:10 +0000 (06:01 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 5 Sep 2015 04:01:10 +0000 (06:01 +0200)
roguelike-server

index 536ab76ffbdea66d43f19110786c6ad1649ed4da..94f540b4bffa7e4a2c3bbf07b95024965a0b587c 100755 (executable)
@@ -734,7 +734,7 @@ def thingproliferation(t, prol_map):
     prolscore = world_db["ThingTypes"][t["T_TYPE"]]["TT_PROLIFERATE"]
     if prolscore and (1 == prolscore or 1 == (rand.next() % prolscore)):
         candidates = []
-        for dir in [directions_db[key] for key in directions_db]:
+        for dir in [directions_db[key] for key in sorted(directions_db.keys())]:
             mv_result = mv_yx_in_dir_legal(dir, t["T_POSY"], t["T_POSX"])
             if mv_result[0] and  ord('.') == prol_map[mv_result[1]
                                                       * world_db["MAP_LENGTH"]