]> git.lizzy.rs Git - dungeon_game.git/blobdiff - plugins/game/game.c
Separate air_function chances for rooms and corridors
[dungeon_game.git] / plugins / game / game.c
index adcb59abf5e56746983fa0d3fcc42a3ddd95af01..cc6d21dffff5a163fba85636a2286f68db771152 100644 (file)
@@ -334,7 +334,7 @@ static void mapgen_set_air(int x, int y, enum mg_context ctx)
        for (struct list *ptr = air_functions; ptr != NULL; ptr = ptr->next) {
                struct generator_function *func = ptr->element;
 
-               if (rand() % func->chance == 0)
+               if (rand() % (ctx == MG_CTX_CORRIDOR ? func->corridor_chance : func->room_chance) == 0)
                        func->callback(x, y, ctx);
        }
 }