home · contact · privacy
7DRL: Declare ':' map cells open / passable / proliferable.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 11 Mar 2015 14:47:06 +0000 (15:47 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 11 Mar 2015 14:47:06 +0000 (15:47 +0100)
roguelike-server
src/server/libplomrogue.c

index 57240058c511a41bac6ac84d2ae4d747ffcda71d..1edafc57f863e85e2d15c4d03f494ee3856edf7a 100755 (executable)
@@ -655,7 +655,8 @@ def actor_move(t):
                                      t["T_POSY"], t["T_POSX"])
     if 1 == move_result[0]:
         pos = (move_result[1] * world_db["MAP_LENGTH"]) + move_result[2]
-        passable = "." == chr(world_db["MAP"][pos])
+        passable = "." == chr(world_db["MAP"][pos]) or \
+                   ":" == chr(world_db["MAP"][pos])  # #
         hitted = [id for id in world_db["Things"]
                   if world_db["Things"][id] != t
                   if world_db["Things"][id]["T_LIFEPOINTS"]
@@ -768,7 +769,7 @@ def thingproliferation(t, prol_map):
     """To chance of 1/TT_PROLIFERATE,create  t offspring in open neighbor cell.
 
     Naturally only works with TT_PROLIFERATE > 0. The neighbor cell must be be
-    marked '.' in prol_map. If there are several map cell candidates, one is
+    marked "." in prol_map. If there are several map cell candidates, one is
     selected randomly.
     """
     # # 7DRL: success increments God's mood
@@ -777,7 +778,7 @@ def thingproliferation(t, prol_map):
         candidates = []
         for dir in [directions_db[key] for key in directions_db]:
             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]
+            if mv_result[0] and  ord(".") == prol_map[mv_result[1]
                                                       * world_db["MAP_LENGTH"]
                                                       + mv_result[2]]:
                 candidates.append((mv_result[1], mv_result[2]))
@@ -1275,7 +1276,9 @@ def command_makeworld(seed_string):
             while 1:
                 y = rand.next() % world_db["MAP_LENGTH"]
                 x = rand.next() % world_db["MAP_LENGTH"]
-                if "." == chr(world_db["MAP"][y * world_db["MAP_LENGTH"] + x]):
+                pos = y * world_db["MAP_LENGTH"] + x;
+                if "." == chr(world_db["MAP"][pos]) \
+                   or ":" == chr(world_db["MAP"][pos]):  # #
                     break
                 i += 1
                 if i == 65535:
index d0b15a10bc5d260f4fcf1fc75af6551863e01157..8e4ee9b9a4af7e3c8b70257f0b13919f120360ec 100644 (file)
@@ -610,7 +610,9 @@ extern uint8_t set_cells_passable_on_memmap_to_65534_on_scoremap(char * mem_map)
     uint16_t pos;
     for (pos = 0; pos < map_size; pos++)
     {
-        if ('.' == mem_map[pos])
+        char c = mem_map[pos]; //
+        if ('.' == c || ':' == c) //
+        //if ('.' == mem_map[pos])
         {
             score_map[pos] = 65534;
         }