mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
[Bots] Fix crash related to GetTempSpellType() (#4649)
_tempSpellType was not getting defined during bot spawn process which could lead to a potential crash in RaidGroupSay. Auto archery toggle was what triggered the crash as it announces their status on spawn. Also moved this toggle for Rangers further down the proccess line.
This commit is contained in:
+6
-4
@@ -106,6 +106,7 @@ Bot::Bot(NPCType *npcTypeData, Client* botOwner) : NPC(npcTypeData, nullptr, glm
|
||||
|
||||
LoadDefaultBotSettings();
|
||||
SetCastedSpellType(UINT16_MAX);
|
||||
SetTempSpellType(UINT16_MAX);
|
||||
SetCommandedSpell(false);
|
||||
SetPullingSpell(false);
|
||||
|
||||
@@ -189,6 +190,7 @@ Bot::Bot(
|
||||
SetSpawnStatus(false);
|
||||
SetBotCharmer(false);
|
||||
SetCastedSpellType(UINT16_MAX);
|
||||
SetTempSpellType(UINT16_MAX);
|
||||
SetCommandedSpell(false);
|
||||
SetPullingSpell(false);
|
||||
|
||||
@@ -3669,10 +3671,6 @@ bool Bot::Spawn(Client* botCharacterOwner) {
|
||||
}
|
||||
}
|
||||
|
||||
if (IsBotRanged()) {
|
||||
ChangeBotRangedWeapons(true);
|
||||
}
|
||||
|
||||
if (auto raid = entity_list.GetRaidByBotName(GetName())) {
|
||||
// Safety Check to confirm we have a valid raid
|
||||
auto owner = GetBotOwner();
|
||||
@@ -3706,6 +3704,10 @@ bool Bot::Spawn(Client* botCharacterOwner) {
|
||||
CheckBotSpells(); //This runs through a serious of checks and outputs any spells that are set to the wrong spell type in the database
|
||||
}
|
||||
|
||||
if (IsBotRanged()) {
|
||||
ChangeBotRangedWeapons(true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1218,7 +1218,7 @@ private:
|
||||
std::vector<Mob*> _group_spell_target_list;
|
||||
Raid* _storedRaid;
|
||||
bool _verifiedRaid;
|
||||
uint16 _tempSpellType;
|
||||
uint16 _tempSpellType; // this is used to check the spell type being cast against ^spellannouncecasts status
|
||||
|
||||
// Private "base stats" Members
|
||||
int32 _baseMR;
|
||||
|
||||
Reference in New Issue
Block a user