Heyho
wie könnte ich es anstellen das diese 2 funktionen kombinieren
C
- #ifdef NEW_PET_SYSTEM
- std::string temp_exp_line;
- std::ifstream exppet_table_open("/usr/home/game/share/exp_pet_table.txt");
- /*if (!exp_table_open.is_open())
- return 0;*/
- int exppet_table_counter = 0;
- int tmppet_exp = 0;
- while (!exppet_table_open.eof())
- {
- exppet_table_open >> temp_exp_line;
- str_to_number(exppet_table_common[exppet_table_counter], temp_exp_line.c_str());
- if (exppet_table_common[exppet_table_counter] < 2147483647) {
- sys_log(0, "Livelli Pet caricati da exp_pet_table.txt: %d !", exppet_table_common[exppet_table_counter]);
- exppet_table_counter++;
- }
- else {
- fprintf(stderr, "[main] Impossibile caricare la tabella exp valore non valido\n");
- break;
- }
- }
- #endif
da ja bei dem premium die files die exp aus der exp.txt geladen wird hat die main.cpp ja diese funktion drin
C
- // START_OF_Player_EXP_TABLE_LOADING
- string temp_exp_line;
- char szExpTable[256];
- snprintf(szExpTable, sizeof(szExpTable), "%s/exp.txt", LocaleService_GetBasePath().c_str());
- ifstream exp_table_open(szExpTable);
- if (!exp_table_open.is_open()) {
- fprintf(stderr, "Failed to Load ExpTable from %s/exp.txt\n", LocaleService_GetBasePath().c_str());
- sys_err("Failed to Load ExpTable from %s/exp.txt", LocaleService_GetBasePath().c_str());
- return 0;
- }
- int exp_table_counter = 0;
- while (!exp_table_open.eof())
- {
- exp_table_open >> temp_exp_line;
- str_to_number(exp_table_common[exp_table_counter], temp_exp_line.c_str());
- exp_table_counter++;
- }
- fprintf(stderr, "EXP erfolgreich geladen von: %s\n", LocaleService_GetBasePath().c_str());
- //sys_log(0, "EXP Table Loaded succsefully from %s", LocaleService_GetBasePath().c_str());
- // END_OF_Player_EXP_TABLE_LOADING
aber wen ich das so einfüge bekomm ich errors beim compile
ich habs zu zeit so drinn
C
- #ifdef NEW_PET_SYSTEM
- // std::string temp_exp_line;
- std::ifstream exppet_table_open("/usr/home/game/share/exp_pet_table.txt");
- /*if (!exp_table_open.is_open())
- return 0;*/
- int exppet_table_counter = 0;
- int tmppet_exp = 0;
- while (!exppet_table_open.eof())
- {
- // exppet_table_open >> temp_exp_line;
- // str_to_number(exppet_table_common[exppet_table_counter], temp_exp_line.c_str());
- if (exppet_table_common[exppet_table_counter] < 2147483647) {
- sys_log(0, "Livelli Pet caricati da exp_pet_table.txt: %d !", exppet_table_common[exppet_table_counter]);
- exppet_table_counter++;
- }
- else {
- fprintf(stderr, "[main] Impossibile caricare la tabella exp valore non valido\n");
- break;
- }
- }
- #endif
Dann geht auch alles aber er läd die exp dan i-wie falsch,
hau ich dann 1 wildhund dann bekommt mein Pet 1 bis 2 levelup
vllt weiss einer ja wie das anstellen könnte