diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 777d2ef..fed78d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,61 +44,61 @@ jobs: ./authserver --version ./worldserver --version - AC-Eluna: - strategy: - fail-fast: false - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - repository: azerothcore/azerothcore-wotlk - ref: 'master' - - uses: actions/checkout@v2 - with: - submodules: false - repository: azerothcore/mod-eluna-lua-engine - path: modules/mod-eluna-lua-engine - - uses: actions/checkout@v2 - with: - path: modules/mod-eluna-lua-engine/LuaEngine - - name: Configure OS - run: | - # Copy paste of https://github.com/azerothcore/azerothcore-wotlk/blob/master/apps/ci/ci-install.sh - - cat >>conf/config.sh <> ./conf/config.sh - echo "CCOMPILERCXX=\"clang++-11\"" >> ./conf/config.sh - - name: Import db - run: source ./apps/ci/ci-import-db.sh - - name: Build - run: source ./apps/ci/ci-compile.sh - - name: Dry run - run: source ./apps/ci/ci-worldserver-dry-run.sh - - name: Check startup errors - run: source ./apps/ci/ci-error-check.sh +# AC-Eluna: +# strategy: +# fail-fast: false +# runs-on: ubuntu-20.04 +# steps: +# - uses: actions/checkout@v2 +# with: +# submodules: recursive +# repository: azerothcore/azerothcore-wotlk +# ref: 'master' +# - uses: actions/checkout@v2 +# with: +# submodules: false +# repository: azerothcore/mod-eluna-lua-engine +# path: modules/mod-eluna-lua-engine +# - uses: actions/checkout@v2 +# with: +# path: modules/mod-eluna-lua-engine/LuaEngine +# - name: Configure OS +# run: | +# # Copy paste of https://github.com/azerothcore/azerothcore-wotlk/blob/master/apps/ci/ci-install.sh +# +# cat >>conf/config.sh <> ./conf/config.sh +# echo "CCOMPILERCXX=\"clang++-11\"" >> ./conf/config.sh +# - name: Import db +# run: source ./apps/ci/ci-import-db.sh +# - name: Build +# run: source ./apps/ci/ci-compile.sh +# - name: Dry run +# run: source ./apps/ci/ci-worldserver-dry-run.sh +# - name: Check startup errors +# run: source ./apps/ci/ci-error-check.sh mangos-Eluna: strategy: diff --git a/CreatureMethods.h b/CreatureMethods.h index 8d2e7ae..3e578f0 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -858,19 +858,28 @@ namespace LuaCreature int GetAITargets(lua_State* L, Creature* creature) { #if defined(TRINITY) - auto const& threatlist = creature->GetThreatManager().GetThreatenedByMeList(); + auto const& threatlist = creature->GetThreatManager().GetSortedThreatList(); #elif defined(AZEROTHCORE) -auto const& threatlist = creature->getThreatMgr().getThreatList(); + auto const& threatlist = creature->getThreatMgr().getThreatList(); #else ThreatList const& threatlist = creature->GetThreatManager().getThreatList(); #endif + +#if defined(TRINITY) + lua_createtable(L, creature->GetThreatManager().GetThreatListSize(), 0); +#else lua_createtable(L, threatlist.size(), 0); +#endif int tbl = lua_gettop(L); uint32 i = 0; +#if defined(TRINITY) + for (ThreatReference const* itr : threatlist) +#else for (auto itr = threatlist.begin(); itr != threatlist.end(); ++itr) +#endif { #if defined(TRINITY) - Unit* target = itr->second->GetOwner(); + Unit* target = itr->GetVictim(); #else Unit* target = (*itr)->getTarget(); #endif @@ -892,7 +901,7 @@ auto const& threatlist = creature->getThreatMgr().getThreatList(); int GetAITargetsCount(lua_State* L, Creature* creature) { #if defined(TRINITY) - Eluna::Push(L, creature->GetThreatManager().GetThreatenedByMeList().size()); + Eluna::Push(L, creature->GetThreatManager().GetThreatListSize()); #elif defined(AZEROTHCORE) Eluna::Push(L, creature->getThreatMgr().getThreatList().size()); #else