mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Bug Fix] SendSpellBarEnable sends correct slotid to fix spellbar on RoF2 (#1848)
* SendSpellBarEnable sends correct slotid to fix spellbar on RoF2 * Send correct data when using StopCasting() to re-enable spellbar
This commit is contained in:
+16
-2
@@ -995,13 +995,18 @@ void Mob::StopCasting()
|
||||
c->ResetAlternateAdvancementTimer(casting_spell_aa_id);
|
||||
}
|
||||
|
||||
int casting_slot = -1;
|
||||
if (casting_spell_slot < CastingSlot::MaxGems) {
|
||||
casting_slot = static_cast<int>(casting_spell_slot);
|
||||
}
|
||||
|
||||
auto outapp = new EQApplicationPacket(OP_ManaChange, sizeof(ManaChange_Struct));
|
||||
auto mc = (ManaChange_Struct *)outapp->pBuffer;
|
||||
mc->new_mana = GetMana();
|
||||
mc->stamina = GetEndurance();
|
||||
mc->spell_id = casting_spell_id;
|
||||
mc->keepcasting = 0;
|
||||
mc->slot = -1;
|
||||
mc->slot = casting_slot;
|
||||
c->FastQueuePacket(&outapp);
|
||||
}
|
||||
ZeroCastingVars();
|
||||
@@ -5219,7 +5224,7 @@ void Mob::SendSpellBarEnable(uint16 spell_id)
|
||||
manachange->spell_id = spell_id;
|
||||
manachange->stamina = CastToClient()->GetEndurance();
|
||||
manachange->keepcasting = 0;
|
||||
manachange->slot = -1;
|
||||
manachange->slot = CastToClient()->FindMemmedSpellByID(spell_id);
|
||||
outapp->priority = 6;
|
||||
CastToClient()->QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
@@ -5428,6 +5433,15 @@ int Client::MemmedCount() {
|
||||
return memmed_count;
|
||||
}
|
||||
|
||||
int Client::FindMemmedSpellByID(uint16 spell_id) {
|
||||
for (int i = 0; i < EQ::spells::SPELL_GEM_COUNT; i++) {
|
||||
if (m_pp.mem_spells[i] == spell_id) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
void Client::ScribeSpell(uint16 spell_id, int slot, bool update_client, bool defer_save)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user