Jump to content

Kori

Inactive Member
  • Posts

    284
  • Joined

  • Last visited

  • Feedback

    0%

Community Answers

  1. Kori's post in Compiling warnings was marked as the answer   
    mob_manager.cpp: In member function 'bool CMobManager::Initialize(TMobTable*, int)': mob_manager.cpp:75:21: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare] for (int j = 0; j < MOB_SKILL_MAX_NUM; ++j)  
    You can set the int to size_t
  2. Kori's post in I want an opinion about this design for autopatcher was marked as the answer   
    A button for version number? 
  3. Kori's post in General c++ question was marked as the answer   
    #fixxed by myself 
    I have removed this line :
    system("./start")  
    I have closed my panel via ctrl+c and then go the server down too ( why ever lel) 
     
    Thanks 
  4. Kori's post in My System Error was marked as the answer   
    sorry i dont understand you now :/
     
     
    edit:
     
    My new main.cpp function:
     
    LoadNewMounts();  
    char_mounts.h:
     
    struct AddNewMountsStruct{ int dwVnum; }; void LoadNewMounts(); bool AddNewMounts(int dwVnum); char_mount.cpp:
     
    #include "stdafx.h" #include "locale_service.h" #include "char_mount.h" #include "char.h" #include "log.h" #include <fstream> #include <sstream> using namespace std; std::vector <AddNewMountsStruct> MountObjectList; void LoadNewMounts() { char szFileName[256]; snprintf(szFileName, sizeof(szFileName), "%s/Mounts.txt", LocaleService_GetBasePath().c_str()); string strdwVnum; ifstream File(szFileName); if (!File.is_open()) { fprintf(stderr, "Failed to Load %s/Mounts.txt\n", LocaleService_GetBasePath().c_str()); sys_err("Failed to %s/Mounts.txt", LocaleService_GetBasePath().c_str()); return; } MountObjectList.clear(); AddNewMountsStruct preload; while (!File.eof()) { File >> strdwVnum; preload.dwVnum = atoi(strdwVnum.c_str()); MountObjectList.push_back(preload); } sys_log(1, "Datei geladen"); } bool AddNewMounts(int dwVnum) { for (unsigned int i = 0; i < MountObjectList.size(); i++){ if (MountObjectList[i].dwVnum == dwVnum){ return true; } } return false; }  
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.