As requested revert for threadfixes last few days (#1552)

* Revert "[Large server fix] #1537 Serialize playerBots/botLoading with a mutex and use snapshot-based loops to fix concurrency crashes (#1540)"

This reverts commit 3fff58df1a.

* Revert "[Fix] teleport to invalid map or invalid coordinates (x , y , z  200000, o ) given when teleporting player (g UI d full type player low , name , map , x , y , z , o )  (#1538)"

This reverts commit ca2e2ef0db.

* Revert "Fix: prevent MoveSplineInitArgs::Validate velocity asserts (velocity > 0.01f) for bots, pets, and charmed units (#1534)"

This reverts commit 4e3ac609bd.

* Revert "[Fix issue #1527] : startup crash in tank target selection — add TOCTOU & null-safety guards (#1532)"

This reverts commit c6b0424c29.

* Revert "[Fix issue #1528] Close small window where the “in a BG/arena” state can change between the check (InBattleground() / InArena()) and grabbing the pointer (GetBattleground()), which leads to a null dereference. (#1530)"

This reverts commit 2e0a161623.

* Revert "Harden playerbot logout & packet dispatch; add null-safety in chat hooks and RPG checks (#1529)"

This reverts commit e4ea8e2694.

* Revert "Dont wait to travel when in combat. (#1524)"

This reverts commit ddfa919154.

* Revert "nullptr fix (#1523)"

This reverts commit 380312ffd2.

* Revert "Playerbots/LFG: fix false not eligible & dungeon 0/type 0, add clear diagnostics (#1521)"

This reverts commit 872e417613.

* Revert "nullptr exception (#1520)"

This reverts commit 3d28a81508.

* Revert "Removed bot freezing at startup and system message, not relevant anymore (#1519)"

This reverts commit bcd6f5bc06.
This commit is contained in:
bash
2025-08-12 22:10:47 +02:00
committed by GitHub
parent 3fff58df1a
commit 8d51092d42
24 changed files with 144 additions and 1274 deletions

View File

@@ -57,7 +57,6 @@
#include "Unit.h"
#include "UpdateTime.h"
#include "Vehicle.h"
#include "BotMovementUtils.h"
const int SPELL_TITAN_GRIP = 49152;
@@ -721,7 +720,6 @@ void PlayerbotAI::HandleTeleportAck()
bot->GetSession()->HandleMoveWorldportAck();
}
// SetNextCheckDelay(urand(2000, 5000));
SetNextCheckDelay(urand(500, 1500)); // short delay to break bursts without hindering gameplay
if (sPlayerbotAIConfig->applyInstanceStrategies)
ApplyInstanceStrategies(bot->GetMapId(), true);
EvaluateHealerDpsStrategy();
@@ -2375,7 +2373,7 @@ std::string PlayerbotAI::GetLocalizedGameObjectName(uint32 entry)
return name;
}
/*std::vector<Player*> PlayerbotAI::GetPlayersInGroup()
std::vector<Player*> PlayerbotAI::GetPlayersInGroup()
{
std::vector<Player*> members;
@@ -2394,34 +2392,6 @@ std::string PlayerbotAI::GetLocalizedGameObjectName(uint32 entry)
members.push_back(ref->GetSource());
}
return members;
}*/
std::vector<Player*> PlayerbotAI::GetPlayersInGroup()
{
std::vector<Player*> members;
Group* group = bot->GetGroup();
if (!group)
return members;
for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next())
{
Player* member = ref->GetSource();
if (!member)
continue;
// Celaning, we don't call 2 times GET_PLAYERBOT_AI and never reference it if nil
if (auto* ai = GET_PLAYERBOT_AI(member))
{
// If it's a bot (not real player) => we ignor it
if (!ai->IsRealPlayer())
continue;
}
members.push_back(member);
}
return members;
}
@@ -4244,6 +4214,19 @@ bool PlayerbotAI::AllowActive(ActivityType activityType)
}
}
// only keep updating till initializing time has completed,
// which prevents unneeded expensive GameTime calls.
if (_isBotInitializing)
{
_isBotInitializing = GameTime::GetUptime().count() < sPlayerbotAIConfig->maxRandomBots * 0.11;
// no activity allowed during bot initialization
if (_isBotInitializing)
{
return false;
}
}
// General exceptions
if (activityType == PACKET_ACTIVITY)
{
@@ -6327,27 +6310,11 @@ void PlayerbotAI::PetFollow()
if (!pet)
return;
pet->AttackStop();
/* pet->InterruptNonMeleeSpells(false);
pet->InterruptNonMeleeSpells(false);
pet->ClearInPetCombat();
pet->GetMotionMaster()->MoveFollow(bot, PET_FOLLOW_DIST, pet->GetFollowAngle());
if (pet->ToPet())
pet->ToPet()->ClearCastWhenWillAvailable();*/
// [Fix: MoveSplineInitArgs::Validate: expression 'velocity > 0.01f' failed for GUID Full:]
pet->InterruptNonMeleeSpells(false);
pet->ClearInPetCombat();
if (CanStartMoveSpline(pet))
{
pet->GetMotionMaster()->MoveFollow(bot, PET_FOLLOW_DIST, pet->GetFollowAngle());
}
else
{
pet->StopMovingOnCurrentPos(); // on nenvoie pas dordre invalide
}
if (pet->ToPet())
pet->ToPet()->ClearCastWhenWillAvailable();
//End Fix
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
return;