mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-20 18:44:34 +00:00
Compare commits
4 Commits
00d19dbf9c
...
test-prod-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86904ed068 | ||
|
|
8529654f8f | ||
|
|
6ee1684e9b | ||
|
|
9546363d41 |
19
check_pr_source.yml
Normal file
19
check_pr_source.yml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Enforce test-staging → main
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
require-test-staging:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: Ensure PR source is test-staging
|
||||||
|
run: |
|
||||||
|
echo "Base: ${{ github.event.pull_request.base.ref }}"
|
||||||
|
echo "Head: ${{ github.event.pull_request.head.ref }}"
|
||||||
|
if [ "${{ github.event.pull_request.head.ref }}" != "test-staging" ]; then
|
||||||
|
echo "✖ Pull request must come from test-staging"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -2227,8 +2227,8 @@ bool BGTactics::selectObjective(bool reset)
|
|||||||
}
|
}
|
||||||
// Graveyard Camping if in lead
|
// Graveyard Camping if in lead
|
||||||
else if (!hasFlag && role < 8 &&
|
else if (!hasFlag && role < 8 &&
|
||||||
(team == TEAM_ALLIANCE && allianceScore == 2 && hordeScore == 0) ||
|
((team == TEAM_ALLIANCE && allianceScore == 2 && hordeScore == 0) ||
|
||||||
(team == TEAM_HORDE && hordeScore == 2 && allianceScore == 0))
|
(team == TEAM_HORDE && hordeScore == 2 && allianceScore == 0)))
|
||||||
{
|
{
|
||||||
if (team == TEAM_ALLIANCE)
|
if (team == TEAM_ALLIANCE)
|
||||||
SetSafePos(WS_GY_CAMPING_HORDE, 10.0f);
|
SetSafePos(WS_GY_CAMPING_HORDE, 10.0f);
|
||||||
|
|||||||
@@ -124,6 +124,52 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OnPlayerBeforeTeleport(Player* /*player*/, uint32 /*mapid*/, float /*x*/, float /*y*/, float /*z*/,
|
||||||
|
float /*orientation*/, uint32 /*options*/, Unit* /*target*/) override
|
||||||
|
{
|
||||||
|
/* for now commmented out until proven its actually required
|
||||||
|
* havent seen any proof CleanVisibilityReferences() is needed
|
||||||
|
|
||||||
|
// If the player is not safe to touch, do nothing
|
||||||
|
if (!player)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// If same map or not in world do nothing
|
||||||
|
if (!player->IsInWorld() || player->GetMapId() == mapid)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// If real player do nothing
|
||||||
|
PlayerbotAI* ai = GET_PLAYERBOT_AI(player);
|
||||||
|
if (!ai || ai->IsRealPlayer())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Cross-map bot teleport: defer visibility reference cleanup.
|
||||||
|
// CleanVisibilityReferences() erases this bot's GUID from other objects' visibility containers.
|
||||||
|
// This is intentionally done via the event queue (instead of directly here) because erasing
|
||||||
|
// from other players' visibility maps inside the teleport call stack can hit unsafe re-entrancy
|
||||||
|
// or iterator invalidation while visibility updates are in progress
|
||||||
|
ObjectGuid guid = player->GetGUID();
|
||||||
|
player->m_Events.AddEventAtOffset(
|
||||||
|
[guid, mapid]()
|
||||||
|
{
|
||||||
|
// do nothing, if the player is not safe to touch
|
||||||
|
Player* p = ObjectAccessor::FindPlayer(guid);
|
||||||
|
if (!p || !p->IsInWorld() || p->IsDuringRemoveFromWorld())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// do nothing if we are already on the target map
|
||||||
|
if (p->GetMapId() == mapid)
|
||||||
|
return;
|
||||||
|
|
||||||
|
p->GetObjectVisibilityContainer().CleanVisibilityReferences();
|
||||||
|
},
|
||||||
|
Milliseconds(0));
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void OnPlayerAfterUpdate(Player* player, uint32 diff) override
|
void OnPlayerAfterUpdate(Player* player, uint32 diff) override
|
||||||
{
|
{
|
||||||
PlayerbotAI* const botAI = PlayerbotsMgr::instance().GetPlayerbotAI(player);
|
PlayerbotAI* const botAI = PlayerbotsMgr::instance().GetPlayerbotAI(player);
|
||||||
|
|||||||
@@ -479,33 +479,23 @@ public:
|
|||||||
bool Execute() override
|
bool Execute() override
|
||||||
{
|
{
|
||||||
// find and verify bot still exists
|
// find and verify bot still exists
|
||||||
Player* bot = ObjectAccessor::FindConnectedPlayer(this->m_botGuid);
|
Player* bot = ObjectAccessor::FindConnectedPlayer(m_botGuid);
|
||||||
|
|
||||||
if (!bot)
|
if (!bot)
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
if (this->m_masterAccountId)
|
PlayerbotHolder* holder = &RandomPlayerbotMgr::instance();
|
||||||
|
if (m_masterAccountId)
|
||||||
{
|
{
|
||||||
WorldSession* masterSession = sWorldSessionMgr->FindSession(this->m_masterAccountId);
|
WorldSession* masterSession = sWorldSessionMgr->FindSession(m_masterAccountId);
|
||||||
Player* masterPlayer = masterSession ? masterSession->GetPlayer() : nullptr;
|
Player* masterPlayer = masterSession ? masterSession->GetPlayer() : nullptr;
|
||||||
|
if (masterPlayer)
|
||||||
if (masterPlayer != nullptr)
|
holder = PlayerbotsMgr::instance().GetPlayerbotMgr(masterPlayer);
|
||||||
{
|
|
||||||
PlayerbotMgr* manager = PlayerbotsMgr::instance().GetPlayerbotMgr(masterPlayer);
|
|
||||||
|
|
||||||
if (manager == nullptr)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
manager->OnBotLogin(bot);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sRandomPlayerbotMgr.OnBotLogin(bot);
|
if (!holder)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
holder->OnBotLogin(bot);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user