From bcb5b954cb25b63536facd60e1c2cec2b04e8011 Mon Sep 17 00:00:00 2001 From: jeefo Date: Mon, 22 Jan 2024 08:50:03 +0300 Subject: [PATCH] ci: enable continuous builds for repository aim: do not add aim errors if too close to enemy conf: do not spam with unknown custom variables if config doesn't define one --- .github/workflows/build.yml | 58 +++++++++++++++++++++++++++++++++++-- src/combat.cpp | 2 +- src/config.cpp | 12 ++++++-- 3 files changed, 66 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2fe04ae..c7e4b9f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -97,6 +97,60 @@ jobs: path: | ${{matrix.arch}}/yapb.dll ${{matrix.arch}}/yapb.pdb + + bot-continuous-release: + if: github.event_name == 'push' + + name: bot-continuous-release + runs-on: ubuntu-latest + needs: [bot-build, bot-msvc] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: true + - name: Install signing tools + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends osslsigncode + - name: Get artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts + - name: Setup python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Configure meson + run: | + python -m pip install --upgrade meson ninja requests + - name: Create packages + run: | + meson setup dist + ninja -C dist package + env: + CS_CERTIFICATE: ${{secrets.CS_CERTIFICATE}} + CS_CERTIFICATE_PASSWORD: ${{secrets.CS_CERTIFICATE_PASSWORD}} + - name: Purge old build + uses: dev-drprasad/delete-tag-and-release@v1.0 + with: + tag_name: continuous + delete_release: true + github_token: ${{ secrets.GITHUB_TOKEN }} + repo: ${{ env.GITHUB_REPOSITORY }} + - name: Push new build + uses: svenstaro/upload-release-action@v2 + with: + repo_name: ${{ env.GITHUB_REPOSITORY }} + repo_token: ${{ secrets.GITHUB_TOKEN }} + file_glob: true + file: pkg/* + tag: continuous + overwrite: true + prerelease: true + release_name: Continuous Build bot-release: if: | @@ -108,7 +162,7 @@ jobs: needs: [bot-build, bot-msvc] steps: - - name: Checkout Repository + - name: Checkout repository uses: actions/checkout@v3 with: fetch-depth: 0 @@ -117,7 +171,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y --no-install-recommends osslsigncode - - name: Get Artifacts + - name: Get artifacts uses: actions/download-artifact@v3 with: path: artifacts diff --git a/src/combat.cpp b/src/combat.cpp index 883efb9..5cb1c04 100644 --- a/src/combat.cpp +++ b/src/combat.cpp @@ -470,7 +470,7 @@ bool Bot::lookupEnemies () { } Vector Bot::getBodyOffsetError (float distance) { - if (game.isNullEntity (m_enemy) || distance < kSprayDistance) { + if (game.isNullEntity (m_enemy) || distance < kDoubleSprayDistance) { return nullptr; } diff --git a/src/config.cpp b/src/config.cpp index 2b0b32b..2b2347d 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -649,14 +649,20 @@ void BotConfig::loadCustomConfig () { String line; MemFile file; - m_custom["C4ModelName"] = "c4.mdl"; - m_custom["AMXParachuteCvar"] = "sv_parachute"; - m_custom["CustomCSDMSpawnPoint"] = "view_spawn"; + auto setDefaults = [&] () { + m_custom["C4ModelName"] = "c4.mdl"; + m_custom["AMXParachuteCvar"] = "sv_parachute"; + m_custom["CustomCSDMSpawnPoint"] = "view_spawn"; + }; + setDefaults (); // custom initialization if (openConfig ("custom", "Custom config file not found. Loading defaults.", &file)) { m_custom.clear (); + // set defaults anyway + setDefaults (); + while (file.getLine (line)) { line.trim ();