fix: Resolved an issue where the open spell was being cast by bots on despawned game objects. (#1842)

# Description

This addresses the infamous "Possible hacking attempt" error when bots
were furiously trying to interact with despawned game objects.
The problem was that the game objects were not being as spawned when
evaluating what the bot should do. It was only done when spells were
being cast on entities.
This commit is contained in:
Nicolas Lebacq 2025-11-15 09:27:33 +00:00 committed by GitHub
parent 08c739f918
commit cadbcbd447
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,6 +14,7 @@
#include "BudgetValues.h"
#include "ChannelMgr.h"
#include "CharacterPackets.h"
#include "ChatHelper.h"
#include "Common.h"
#include "CreatureAIImpl.h"
#include "CreatureData.h"
@ -283,6 +284,15 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
return;
}
GameObject* goSpellTarget = currentSpell->m_targets.GetGOTarget();
if (goSpellTarget && !goSpellTarget->isSpawned())
{
InterruptSpell();
YieldThread(GetReactDelay());
return;
}
bool isHeal = false;
bool isSingleTarget = true;