Fix for random SoF client crashes (possibly Titanium too)

This commit is contained in:
Uleat 2018-07-14 18:41:47 -04:00
parent 37ff8c830d
commit 18005ac7a9
3 changed files with 14 additions and 6 deletions

View File

@ -1862,6 +1862,9 @@ void Client::CheckManaEndUpdate() {
mana_change->stamina = current_endurance;
mana_change->spell_id = casting_spell_id;
mana_change->keepcasting = 1;
mana_change->padding[0] = 0;
mana_change->padding[1] = 0;
mana_change->padding[2] = 0;
outapp->priority = 6;
QueuePacket(outapp);
safe_delete(outapp);
@ -1883,8 +1886,9 @@ void Client::CheckManaEndUpdate() {
mana_update->cur_mana = GetMana();
mana_update->max_mana = GetMaxMana();
mana_update->spawn_id = GetID();
QueuePacket(mana_packet);
entity_list.QueueClientsByXTarget(this, mana_packet, false);
if ((ClientVersionBit() & EQEmu::versions::ClientVersionBit::bit_SoDAndLater) != 0)
QueuePacket(mana_packet); // do we need this with the OP_ManaChange packet above?
entity_list.QueueClientsByXTarget(this, mana_packet, false, EQEmu::versions::ClientVersionBit::bit_SoDAndLater);
safe_delete(mana_packet);
last_reported_mana_percent = this->GetManaPercent();
@ -1907,8 +1911,9 @@ void Client::CheckManaEndUpdate() {
endurance_update->cur_end = GetEndurance();
endurance_update->max_end = GetMaxEndurance();
endurance_update->spawn_id = GetID();
QueuePacket(endurance_packet);
entity_list.QueueClientsByXTarget(this, endurance_packet, false);
if ((ClientVersionBit() & EQEmu::versions::ClientVersionBit::bit_SoDAndLater) != 0)
QueuePacket(endurance_packet); // do we need this with the OP_ManaChange packet above?
entity_list.QueueClientsByXTarget(this, endurance_packet, false, EQEmu::versions::ClientVersionBit::bit_SoDAndLater);
safe_delete(endurance_packet);
last_reported_endurance_percent = this->GetEndurancePercent();

View File

@ -1546,7 +1546,7 @@ void EntityList::QueueClientsByTarget(Mob *sender, const EQApplicationPacket *ap
}
}
void EntityList::QueueClientsByXTarget(Mob *sender, const EQApplicationPacket *app, bool iSendToSender)
void EntityList::QueueClientsByXTarget(Mob *sender, const EQApplicationPacket *app, bool iSendToSender, EQEmu::versions::ClientVersionBit client_version_bits)
{
auto it = client_list.begin();
while (it != client_list.end()) {
@ -1556,6 +1556,9 @@ void EntityList::QueueClientsByXTarget(Mob *sender, const EQApplicationPacket *a
if (!c || ((c == sender) && !iSendToSender))
continue;
if ((c->ClientVersionBit() & client_version_bits) == 0)
continue;
if (!c->IsXTarget(sender))
continue;

View File

@ -353,7 +353,7 @@ public:
void QueueClientsByTarget(Mob* sender, const EQApplicationPacket* app, bool iSendToSender = true, Mob* SkipThisMob = 0, bool ackreq = true,
bool HoTT = true, uint32 ClientVersionBits = 0xFFFFFFFF, bool inspect_buffs = false);
void QueueClientsByXTarget(Mob* sender, const EQApplicationPacket* app, bool iSendToSender = true);
void QueueClientsByXTarget(Mob* sender, const EQApplicationPacket* app, bool iSendToSender = true, EQEmu::versions::ClientVersionBit client_version_bits = EQEmu::versions::ClientVersionBit::bit_AllClients);
void QueueToGroupsForNPCHealthAA(Mob* sender, const EQApplicationPacket* app);
void QueueManaged(Mob* sender, const EQApplicationPacket* app, bool ignore_sender=false, bool ackreq = true);