diff --git a/.gitignore b/.gitignore index 8108f3c..fb89a80 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,11 @@ *.dll *.so *.user +*.json vc/release vc/debug vc/.vs vc/enc_temp_folder -build/ \ No newline at end of file +build/ diff --git a/ext/crlib/cr-override.h b/ext/crlib/cr-override.h index ace571d..e30f5b5 100644 --- a/ext/crlib/cr-override.h +++ b/ext/crlib/cr-override.h @@ -10,11 +10,11 @@ #include #include -void *operator new (size_t size) noexcept { +void *operator new (size_t size) { return cr::Memory::get (size); } -void *operator new [] (size_t size) noexcept { +void *operator new [] (size_t size) { return cr::Memory::get (size); } @@ -36,4 +36,4 @@ void operator delete [] (void *ptr, size_t) noexcept { CR_LINKAGE_C void __cxa_pure_virtual () { cr::plat.abort ("pure virtual function call"); -} \ No newline at end of file +} diff --git a/ext/crlib/cr-platform.h b/ext/crlib/cr-platform.h index fde5311..51d2857 100644 --- a/ext/crlib/cr-platform.h +++ b/ext/crlib/cr-platform.h @@ -142,8 +142,8 @@ CR_NAMESPACE_BEGIN // helper struct for platform detection struct Platform : public Singleton { - bool win32 = false; - bool linux = false; + bool win = false; + bool nix = false; bool osx = false; bool android = false; bool hfp = false; @@ -154,7 +154,7 @@ struct Platform : public Singleton { Platform () { #if defined(CR_WINDOWS) - win32 = true; + win = true; #endif #if defined(CR_ANDROID) @@ -166,7 +166,7 @@ struct Platform : public Singleton { #endif #if defined(CR_LINUX) - linux = true; + nix = true; #endif #if defined(CR_OSX) diff --git a/inc/engine.h b/inc/engine.h index 2254e3a..010f79e 100644 --- a/inc/engine.h +++ b/inc/engine.h @@ -709,7 +709,7 @@ public: } bool isWorkaroundNeeded () { - return !plat.win32 && !Game::instance ().isDedicated (); + return !plat.win && !Game::instance ().isDedicated (); } }; diff --git a/inc/message.h b/inc/message.h index a9711cc..42fc07a 100644 --- a/inc/message.h +++ b/inc/message.h @@ -70,13 +70,13 @@ private: struct Args { union { float float_; - long long_; + int32 long_; const char *chars_; }; public: Args (float value) : float_ (value) { } - Args (int value) : long_ (value) { } + Args (int32 value) : long_ (value) { } Args (const char *value) : chars_ (value) { } }; diff --git a/src/engine.cpp b/src/engine.cpp index 1123e3b..2132130 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -571,7 +571,7 @@ bool Game::isSoftwareRenderer () { } // and on only windows version you can use software-render game. Linux, OSX always defaults to OpenGL - if (plat.win32) { + if (plat.win) { return plat.hasModule ("sw"); } return false; @@ -696,11 +696,11 @@ bool Game::loadCSBinary () { } StringArray libs; - if (plat.win32) { + if (plat.win) { libs.push ("mp.dll"); libs.push ("cs.dll"); } - else if (plat.linux) { + else if (plat.nix) { libs.push ("cs.so"); libs.push ("cs_i386.so"); } diff --git a/src/linkage.cpp b/src/linkage.cpp index 53315f0..9a5fa74 100644 --- a/src/linkage.cpp +++ b/src/linkage.cpp @@ -997,7 +997,7 @@ DLSYM_RETURN EntityLinkage::lookup (SharedLibrary::Handle module, const char *fu } // if requested module is yapb module, put in cache the looked up symbol - if (self != module || (plat.win32 && (static_cast (reinterpret_cast (function) >> 16) & 0xffff) == 0)) { + if (self != module || (plat.win && (static_cast (reinterpret_cast (function) >> 16) & 0xffff) == 0)) { return resolve (module); } diff --git a/src/manager.cpp b/src/manager.cpp index 75b5d93..bdc0b6a 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -770,7 +770,11 @@ float BotManager::getAverageTeamKPD (bool calcForBots) { } auto bot = bots[client.ent]; - if ((calcForBots && bot) || (!calcForBots && !bot)) { + if (calcForBots && bot) { + calc.first += client.ent->v.frags; + calc.second++; + } + else if (!calcForBots && !bot) { calc.first += client.ent->v.frags; calc.second++; } diff --git a/src/support.cpp b/src/support.cpp index 7ce6316..0fb35a6 100644 --- a/src/support.cpp +++ b/src/support.cpp @@ -650,7 +650,7 @@ void BotSupport::installSendTo () { } // enable only on modern games - if (game.is (GameFlags::Modern) && (plat.linux || plat.win32) && !plat.arm && !m_sendToDetour.detoured ()) { + if (game.is (GameFlags::Modern) && (plat.nix || plat.win) && !plat.arm && !m_sendToDetour.detoured ()) { m_sendToDetour.install (reinterpret_cast (BotSupport::sendTo), true); } }