Exemplo n.º 1
0
void DynamicDataLoader::check_consistency() {
    item_controller->check_itype_definitions();
    item_controller->check_items_of_groups_exist();
    MonsterGenerator::generator().check_monster_definitions();
    MonsterGroupManager::check_group_definitions();
    check_recipe_definitions();
}
Exemplo n.º 2
0
void DynamicDataLoader::check_consistency() {
    item_controller->check_itype_definitions();
    item_controller->check_items_of_groups_exist();
    MonsterGenerator::generator().check_monster_definitions();
    MonsterGroupManager::check_group_definitions();
    check_recipe_definitions();
    check_furniture_and_terrain();
    check_constructions();
    profession::check_definitions();
    check_martialarts();
}
Exemplo n.º 3
0
void DynamicDataLoader::check_consistency()
{
    item_controller->check_definitions();
    g->check_vehicleparts();
    MonsterGenerator::generator().check_monster_definitions();
    MonsterGroupManager::check_group_definitions();
    check_recipe_definitions();
    check_furniture_and_terrain();
    check_constructions();
    profession::check_definitions();
    scenario::check_definitions();
    check_martialarts();
    ammunition_type::check_consistency();
}
Exemplo n.º 4
0
void DynamicDataLoader::check_consistency()
{
    vitamin::check_consistency();
    item_controller->check_definitions();
    fault::check_consistency();
    vpart_info::check();
    MonsterGenerator::generator().check_monster_definitions();
    MonsterGroupManager::check_group_definitions();
    check_recipe_definitions();
    check_furniture_and_terrain();
    check_constructions();
    profession::check_definitions();
    scenario::check_definitions();
    check_martialarts();
    mutation_branch::check_consistency();
    ammunition_type::check_consistency();
    trap::check_consistency();
    check_bionics();
}
Exemplo n.º 5
0
int APIENTRY WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
    int argc = __argc;
    char **argv = __argv;
#else
int main(int argc, char *argv[])
{
#endif
#ifdef ENABLE_LOGGING
    setupDebug();
#endif
    int seed = time(NULL);
    bool verifyexit = false;
    // set locale to system default
    setlocale(LC_ALL, "");
#ifdef LOCALIZE
    bindtextdomain("cataclysm-dda", "lang/mo");
    bind_textdomain_codeset("cataclysm-dda", "UTF-8");
    textdomain("cataclysm-dda");
#endif

    //args: world seeding only.
    argc--;
    argv++;
    while (argc) {
        if(std::string(argv[0]) == "--seed") {
            argc--;
            argv++;
            if(argc) {
                seed = djb2_hash((unsigned char *)argv[0]);
                argc--;
                argv++;
            }
        } else if(std::string(argv[0]) == "--jsonverify") {
            argc--;
            verifyexit = true;
        } else { // ignore unknown args.
            argc--;
        }
        argv++;
    }

    // ncurses stuff
    initOptions();
    load_options(); // For getting size options
    initscr(); // Initialize ncurses
    init_interface();
    noecho();  // Don't echo keypresses
    cbreak();  // C-style breaks (e.g. ^C to SIGINT)
    keypad(stdscr, true); // Numpad is numbers
    init_colors(); // See color.cpp
    // curs_set(0); // Invisible cursor
    set_escdelay(10); // Make escape actually responsive

    std::srand(seed);

    bool quit_game = false;
    g = new game;
    g->init_data();
    if(g->game_error()) {
        exit_handler(-999);
    }
    if ( verifyexit ) {
        item_controller->check_itype_definitions();
        item_controller->check_items_of_groups_exist();
        MonsterGenerator::generator().check_monster_definitions();
        MonsterGroupManager::check_group_definitions();
        check_recipe_definitions();
        exit_handler(0);
    }

    g->init_ui();
    if(g->game_error()) {
        exit_handler(-999);
    }

    curs_set(0); // Invisible cursor here, because MAPBUFFER.load() is crash-prone

#if (!(defined _WIN32 || defined WINDOWS))
    struct sigaction sigIntHandler;
    sigIntHandler.sa_handler = exit_handler;
    sigemptyset(&sigIntHandler.sa_mask);
    sigIntHandler.sa_flags = 0;
    sigaction(SIGINT, &sigIntHandler, NULL);
#endif

    do {
        if(!g->opening_screen()) {
            quit_game = true;
        }
        while (!quit_game && !g->do_turn()) ;
        if (g->game_quit() || g->game_error()) {
            quit_game = true;
        }
    } while (!quit_game);


    exit_handler(-999);

    return 0;
}