diff --git a/buildSrc/src/main/groovy/gradlecpp/RegameDLLPlayTestPlugin.groovy b/buildSrc/src/main/groovy/gradlecpp/RegameDLLPlayTestPlugin.groovy index 09a0236c..2247822d 100644 --- a/buildSrc/src/main/groovy/gradlecpp/RegameDLLPlayTestPlugin.groovy +++ b/buildSrc/src/main/groovy/gradlecpp/RegameDLLPlayTestPlugin.groovy @@ -11,7 +11,7 @@ class RegamedllPlayTestPlugin implements Plugin { } project.dependencies { - regamedll_playtest_image 'regamedll.testimg:testimg:1.0' + regamedll_playtest_image 'regamedll.testimg:testimg:2.0' } } } diff --git a/buildSrc/src/main/groovy/regamedll/testdemo/RegameDLLDemoRunner.groovy b/buildSrc/src/main/groovy/regamedll/testdemo/RegameDLLDemoRunner.groovy index 47e214fe..11b2b42e 100644 --- a/buildSrc/src/main/groovy/regamedll/testdemo/RegameDLLDemoRunner.groovy +++ b/buildSrc/src/main/groovy/regamedll/testdemo/RegameDLLDemoRunner.groovy @@ -75,12 +75,11 @@ class RegamedllDemoRunner { def cmdParams = [] cmdParams << new File(rootDir, 'hlds.exe').absolutePath - cmdParams.addAll(info.hldsArgs) if (info.regamedllExtraArgs) { cmdParams.addAll(info.regamedllExtraArgs) } - cmdParams << '--regamedll-test-play' << info.testBinFile.absolutePath + cmdParams << '--rehlds-test-play' << info.testBinFile.absolutePath def pb = new ProcessBuilder(cmdParams).redirectErrorStream(true).directory(rootDir) def sout = new StringBuffer() diff --git a/regamedll/build.gradle b/regamedll/build.gradle index 91bf9673..21e112ff 100644 --- a/regamedll/build.gradle +++ b/regamedll/build.gradle @@ -37,23 +37,19 @@ configurations { } dependencies { - //regamedll_tests 'regamedll.testdemos:cstrike-fulltests-2:2.0' - //regamedll_tests 'regamedll.testdemos:czero-ladder_hard:2.0' - //regamedll_tests 'regamedll.testdemos:cstrike-multiplayer-2:2.0' - //regamedll_tests 'regamedll.testdemos:cstrike-hostage-2:2.0' - //regamedll_tests 'regamedll.testdemos:cstrike-weapon-1:1.0' - //regamedll_tests 'regamedll.testdemos:czero-czbot_game-2:2.0' - + regamedll_tests 'regamedll.testdemos:cstrike-basic:1.0' } project.ext.dep_cppunitlite = project(':dep/cppunitlite') void createIntergrationTestTask(NativeBinarySpec b) { boolean regamedllFixes = b.flavor.name.contains('regamedllFixes') + boolean mpLib = b.name.toLowerCase().contains('mp') if (!(b instanceof SharedLibraryBinarySpec)) return if (!GradleCppUtils.windows) return if (regamedllFixes) return + if (!mpLib) return String unitTestTask = b.hasProperty('cppUnitTestTask') ? b.cppUnitTestTask : null @@ -64,18 +60,19 @@ void createIntergrationTestTask(NativeBinarySpec b) { testDemos = project.configurations.regamedll_tests testFor = b - //inputs/outputs for up-to-date check - inputs.files testDemos.files - outputs.dir regamedllTestLogs + //inputs/outputs for up-to-date check + inputs.files testDemos.files + outputs.dir regamedllTestLogs - //dependencies on test executable - if (unitTestTask) { - dependsOn unitTestTask - } + //dependencies on test executable + if (unitTestTask) { + dependsOn unitTestTask + } - postExtractAction { - def binaryOutFile = GradleCppUtils.getBinaryOutputFile(b) - GradleCppUtils.copyFile(binaryOutFile, new File(regamedllImageRoot, binaryOutFile.name), true) + postExtractAction { + def binaryOutFile = GradleCppUtils.getBinaryOutputFile(b) + def binaryOutDir = new File(project.projectDir, '/_regamedllTestImg/cstrike/dlls') + GradleCppUtils.copyFile(binaryOutFile, new File(binaryOutDir, binaryOutFile.name), true) } } @@ -154,26 +151,20 @@ void setupToolchain(NativeBinarySpec b) cfg.extraLibs 'dl', 'm', 'stdc++' } - if (mpLib && GradleCppUtils.windows && !unitTestExecutable) - { + if (mpLib && GradleCppUtils.windows && !unitTestExecutable) { cfg.linkerOptions.definitionFile = "${projectDir}\\msvc\\mp.def"; } - if (!unitTestExecutable) - { - if (!mpLib) - { - cfg.singleDefines 'HOOK_GAMEDLL' - } - } - else - { + if (unitTestExecutable) { cfg.singleDefines 'REGAMEDLL_UNIT_TESTS' + } else if (!mpLib) { + cfg.singleDefines 'HOOK_GAMEDLL' } - if (regamedllFixes) - { + if (regamedllFixes) { cfg.singleDefines 'REGAMEDLL_FIXES', 'REGAMEDLL_CHECKS', 'REGAMEDLL_ADD', 'NDEBUG' + } else { + cfg.singleDefines 'PLAY_GAMEDLL' } ToolchainConfigUtils.apply(project, cfg, b) @@ -243,7 +234,6 @@ class RegamedllSrc { } } - model { buildTypes { debug diff --git a/regamedll/dlls/bot/cs_bot_manager.cpp b/regamedll/dlls/bot/cs_bot_manager.cpp index 647d9889..03fd0a3e 100644 --- a/regamedll/dlls/bot/cs_bot_manager.cpp +++ b/regamedll/dlls/bot/cs_bot_manager.cpp @@ -646,7 +646,7 @@ void CCSBotManager::__MAKE_VHOOK(ServerCommand)(const char *pcmd) else { CONSOLE_ECHO("Current place set to '%s'\n", found->GetName()); - m_navPlace = found->GetID(); + SetNavPlace(found->GetID()); } } } diff --git a/regamedll/extra/Test Maps/regamedll_test_map_v1.bsp b/regamedll/extra/Test Maps/regamedll_test_map_v5.bsp similarity index 63% rename from regamedll/extra/Test Maps/regamedll_test_map_v1.bsp rename to regamedll/extra/Test Maps/regamedll_test_map_v5.bsp index 2460d847..74f05874 100644 Binary files a/regamedll/extra/Test Maps/regamedll_test_map_v1.bsp and b/regamedll/extra/Test Maps/regamedll_test_map_v5.bsp differ diff --git a/regamedll/extra/Test Maps/src/regamedll_test_map_v1.rmf b/regamedll/extra/Test Maps/src/regamedll_test_map_v5.rmf similarity index 89% rename from regamedll/extra/Test Maps/src/regamedll_test_map_v1.rmf rename to regamedll/extra/Test Maps/src/regamedll_test_map_v5.rmf index 01f12edc..b14d7117 100644 Binary files a/regamedll/extra/Test Maps/src/regamedll_test_map_v1.rmf and b/regamedll/extra/Test Maps/src/regamedll_test_map_v5.rmf differ diff --git a/regamedll/game_shared/bot/nav_area.cpp b/regamedll/game_shared/bot/nav_area.cpp index a6dc6931..9b6439e9 100644 --- a/regamedll/game_shared/bot/nav_area.cpp +++ b/regamedll/game_shared/bot/nav_area.cpp @@ -3669,7 +3669,6 @@ class PlaceFloodFillFunctor return false; area->SetPlace(TheCSBots()->GetNavPlace()); - return true; } diff --git a/regamedll/hookers/hooker_impl.h b/regamedll/hookers/hooker_impl.h index 9f48735d..4888438c 100644 --- a/regamedll/hookers/hooker_impl.h +++ b/regamedll/hookers/hooker_impl.h @@ -66,12 +66,10 @@ class CSaveRestoreBuffer; #define __MAKE_VHOOK(fname)\ fname##_ -#define IMPL IMPLEMENT_ARRAY -#define IMPLEMENT_ARRAY(var)\ +#define IMPL(var)\ (*p##var) -#define IMPL_CLASS IMPLEMENT_ARRAY_CLASS -#define IMPLEMENT_ARRAY_CLASS(baseClass,var)\ +#define IMPL_CLASS(baseClass,var)\ (*baseClass::p##var) // refs