mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
Memory corruption found - sending packets to BoTs using Client class
This commit is contained in:
+2
-2
@@ -3839,7 +3839,7 @@ void Mob::CommonDamage(Mob* attacker, int& damage, const uint16 spell_id, const
|
||||
if (!FromDamageShield) {
|
||||
#ifdef BOTS
|
||||
// If a bot is the attacker, send a damage message ot the Bot Owner
|
||||
if (spell_id != SPELL_UNKNOWN && damage > 0 && !Critical && attacker && attacker != this && attacker->IsBot() && RuleB(Bots, DisplaySpellDamage)) {
|
||||
if (attacker->GetTarget() && spell_id != SPELL_UNKNOWN && damage > 0 && !Critical && attacker && attacker != this && attacker->IsBot() && RuleB(Bots, DisplaySpellDamage)) {
|
||||
attacker->CastToBot()->GetBotOwner()->FilteredMessageString(
|
||||
attacker->CastToBot()->GetBotOwner(),
|
||||
Chat::DotDamage,
|
||||
@@ -3894,7 +3894,7 @@ void Mob::CommonDamage(Mob* attacker, int& damage, const uint16 spell_id, const
|
||||
}
|
||||
#ifdef BOTS
|
||||
// If a bot is the attacker, send a damage message ot the Bot Owner
|
||||
else if (spell_id != SPELL_UNKNOWN && attacker->IsBot() && damage > 0 && !Critical && attacker && attacker != this && RuleB(Bots, DisplaySpellDamage)) {
|
||||
else if (attacker->GetTarget() && spell_id != SPELL_UNKNOWN && attacker->IsBot() && damage > 0 && !Critical && attacker && attacker != this && RuleB(Bots, DisplaySpellDamage)) {
|
||||
attacker->CastToBot()->GetBotOwner()->FilteredMessageString(
|
||||
attacker->CastToBot()->GetBotOwner(),
|
||||
Chat::DotDamage,
|
||||
|
||||
+2
-1
@@ -387,7 +387,6 @@ public:
|
||||
static void ProcessRaidInvite(Bot* invitee, Client* invitor); //Mitch
|
||||
static void ProcessRaidInvite(Client* invitee, Client* invitor); //Mitch
|
||||
uint8 GetNumberNeedingHealedInRaidGroup(uint8 hpr, bool includePets); //Mitch
|
||||
bool m_dirtyautohaters;
|
||||
inline void SetDirtyAutoHaters() { m_dirtyautohaters = true; }
|
||||
|
||||
static std::list<BotSpell> GetBotSpellsForSpellEffect(Bot* botCaster, int spellEffect);
|
||||
@@ -677,6 +676,7 @@ private:
|
||||
Timer m_auto_defend_timer;
|
||||
//Timer m_combat_jitter_timer;
|
||||
//bool m_combat_jitter_flag;
|
||||
bool m_dirtyautohaters;
|
||||
bool m_guard_flag;
|
||||
bool m_hold_flag;
|
||||
bool m_attack_flag;
|
||||
@@ -743,6 +743,7 @@ private:
|
||||
|
||||
public:
|
||||
static uint8 spell_casting_chances[SPELL_TYPE_COUNT][PLAYER_CLASS_COUNT][EQ::constants::STANCE_TYPE_COUNT][cntHSND];
|
||||
|
||||
};
|
||||
|
||||
#endif // BOTS
|
||||
|
||||
+1
-1
@@ -1089,7 +1089,7 @@ void Raid::SplitExp(uint32 exp, Mob* other) {
|
||||
return;
|
||||
|
||||
for (unsigned int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
||||
if (members[x].member != nullptr) // If Group Member is Client
|
||||
if (members[x].member != nullptr && members[x].member->CastToBot()->GetBotID() == 0) // If Group Member is Client
|
||||
{
|
||||
Client *cmember = members[x].member;
|
||||
// add exp + exp cap
|
||||
|
||||
+1
-2
@@ -3033,8 +3033,7 @@ void Mob::QuestJournalledSay(Client *QuestInitiator, const char *str, Journal::O
|
||||
const char *Mob::GetCleanName()
|
||||
{
|
||||
if (clean_name != NULL && !strlen(clean_name)) { //extra check added for crash condition. Mitch
|
||||
if (this)
|
||||
CleanMobName(GetName(), clean_name);
|
||||
CleanMobName(GetName(), clean_name);
|
||||
}
|
||||
|
||||
return clean_name;
|
||||
|
||||
+3
-3
@@ -1750,7 +1750,7 @@ void Raid::SendHPManaEndPacketsFrom(Mob *mob)
|
||||
mob->CreateHPPacket(&hpapp);
|
||||
|
||||
for(int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
||||
if(members[x].member) {
|
||||
if(members[x].member && members[x].member->CastToBot()->GetBotID() == 0 ) {
|
||||
if(!mob->IsClient() || ((members[x].member != mob->CastToClient()) && (members[x].GroupNumber == group_id))) {
|
||||
members[x].member->QueuePacket(&hpapp, false);
|
||||
if (members[x].member->IsClient() && members[x].member->ClientVersion() >= EQ::versions::ClientVersion::SoD) { //Mitch
|
||||
@@ -1810,7 +1810,7 @@ void Raid::SendEndurancePacketFrom(Mob *mob)
|
||||
EQApplicationPacket outapp(OP_MobManaUpdate, sizeof(MobManaUpdate_Struct));
|
||||
|
||||
for (int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
||||
if (members[x].member) {
|
||||
if (members[x].member && members[x].member->CastToBot()->GetBotID() == 0) {
|
||||
if (!mob->IsClient() || ((members[x].member != mob->CastToClient()) && (members[x].GroupNumber == group_id))) {
|
||||
if (members[x].member->ClientVersion() >= EQ::versions::ClientVersion::SoD) {
|
||||
outapp.SetOpcode(OP_MobEnduranceUpdate);
|
||||
@@ -1917,7 +1917,7 @@ void Raid::CheckGroupMentor(uint32 group_id, Client *c)
|
||||
void Raid::SetDirtyAutoHaters()
|
||||
{
|
||||
for (int i = 0; i < MAX_RAID_MEMBERS; ++i)
|
||||
if (members[i].member)
|
||||
if (members[i].member && members[i].member->CastToBot()->GetBotID() == 0)
|
||||
members[i].member->SetDirtyAutoHaters();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user