diff --git a/src/main.cpp b/src/main.cpp index 3e85364..e65f9e9 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,23 +4,21 @@ #include #include -int main(int argc, char* argv[]) -{ - std::vector args{argv + 1, argv + argc}; - for (auto it = args.begin(); it != args.end(); it++) { - if (it->compare("--no-gui") == 0) { +int main(int argc, char* argv[]) { + std::vector args(argv, argv + argc); + g_pEngine = std::make_unique(); + for (int i = 1; i < args.size(); ++i) { + if (args[i].compare("--no-gui") == 0) { g_pEngine->state.m_bNoDisplay = true; std::cout << "[LOG - Main] Disabling display" << std::endl; - } else if (it->compare("--bot") == 0) { + } else if (args[i].compare("--bot") == 0) { g_pEngine->state.m_bIsBotControlled = true; std::cout << "[LOG - Main] Bot control enabled" << std::endl; - } else { - std::cerr << "[ERROR] Argument option not found, exiting..." << std::endl; + std::cerr << "[ERROR] Argument " << args[i].c_str() << "not found, exiting..." << std::endl; return 1; } } - g_pEngine = std::make_unique(); g_pEngine->Start(); return 0; }