<commit_before>#include <stdlib.h>

#include "level.h"
#include "player.h"
#include "combat.h"

static void clear_level(level_t *);
static void set_tile_flags_by_type(tile_t *, tile_type_t);

int on_map(level_t * level, int y, int x)
{
    if (y >= 0 && x >= 0 && y < MAP_H && x < MAP_W)
        return 1;

    return 0;
}

level_t * create_new_level(level_t * old_level)
{
    level_t * new_level = malloc(sizeof(level_t));

    clear_level(new_level);

    new_level->mobs[0].type = mob_player;
    new_level->up_level = old_level;
    new_level->depth = old_level != NULL ? old_level->depth + 1 : 0;

    return new_level;
}

static void clear_level(level_t * level)
{
    int y;
    int x;
    int i;

    for (i = 1; i < MAX_MOBS_PER_LEVEL; i++)
        level->mobs[i].type = mob_none;

    for (y = 0; y < MAP_H; y++)
        for (x = 0; x < MAP_W; x++) {<commit_msg>start depth changed to 1<commit_after>#include <stdlib.h>

#include "level.h"
#include "player.h"
#include "combat.h"

static void clear_level(level_t *);
static void set_tile_flags_by_type(tile_t *, tile_type_t);

int on_map(level_t * level, int y, int x)
{
    if (y >= 0 && x >= 0 && y < MAP_H && x < MAP_W)
        return 1;

    return 0;
}

level_t * create_new_level(level_t * old_level)
{
    level_t * new_level = malloc(sizeof(level_t));

    clear_level(new_level);

    new_level->mobs[0].type = mob_player;
    new_level->up_level = old_level;
    new_level->depth = old_level != NULL ? old_level->depth + 1 : 1;
    
    return new_level;
}

static void clear_level(level_t * level)
{
    int y;
    int x;
    int i;

    for (i = 1; i < MAX_MOBS_PER_LEVEL; i++)
        level->mobs[i].type = mob_none;

    for (y = 0; y < MAP_H; y++)
        for (x = 0; x < MAP_W; x++) {
{'fraction_non_alphanumeric': 0.1465076660988075, 'fraction_numerical': 0.01192504258943782, 'mean_word_length': 2.99546485260771, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1602842', 'n_tokens_mistral': 745, 'n_tokens_neox': 700, 'n_words': 172}