mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 07:38:36 +00:00
[Bug Fix] checking casting_spell_slot before its defined is bad (#2013)
This commit is contained in:
+4
-5
@@ -179,7 +179,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!DoCastingChecksOnCaster(spell_id) ||
|
||||
if (!DoCastingChecksOnCaster(spell_id, slot) ||
|
||||
!DoCastingChecksZoneRestrictions(true, spell_id) ||
|
||||
!DoCastingChecksOnTarget(true, spell_id, entity_list.GetMobID(target_id))) {
|
||||
StopCastSpell(spell_id, send_spellbar_enable);
|
||||
@@ -477,7 +477,7 @@ void Mob::SendBeginCast(uint16 spell_id, uint32 casttime)
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
bool Mob::DoCastingChecksOnCaster(int32 spell_id) {
|
||||
bool Mob::DoCastingChecksOnCaster(int32 spell_id, CastingSlot slot) {
|
||||
|
||||
/*
|
||||
These are casting requirements on the CASTER that will cancel a spell before spell finishes casting or prevent spell from casting.
|
||||
@@ -531,7 +531,7 @@ bool Mob::DoCastingChecksOnCaster(int32 spell_id) {
|
||||
/*
|
||||
Linked Reused Timers that are not ready
|
||||
*/
|
||||
if (IsClient() && spells[spell_id].timer_id > 0 && casting_spell_slot < CastingSlot::MaxGems) {
|
||||
if (IsClient() && spells[spell_id].timer_id > 0 && slot < CastingSlot::MaxGems) {
|
||||
if (!CastToClient()->IsLinkedSpellReuseTimerReady(spells[spell_id].timer_id)) {
|
||||
LogSpells("Spell casting canceled [{}] : linked reuse timer not ready.", spell_id);
|
||||
return false;
|
||||
@@ -1602,7 +1602,6 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
|
||||
{
|
||||
DeleteChargeFromSlot = GetItemSlotToConsumeCharge(spell_id, inventory_slot);
|
||||
}
|
||||
|
||||
// we're done casting, now try to apply the spell
|
||||
if(!SpellFinished(spell_id, spell_target, slot, mana_used, inventory_slot, resist_adjust, false,-1, 0xFFFFFFFF, 0, true))
|
||||
{
|
||||
@@ -6532,7 +6531,7 @@ void Mob::DoBardCastingFromItemClick(bool is_casting_bard_song, uint32 cast_time
|
||||
CastSpell(spell_id, target_id, CastingSlot::Item, cast_time, 0, 0, item_slot);
|
||||
}
|
||||
//Instant cast items do not stop bard songs or interrupt casting.
|
||||
else if (CheckItemRaceClassDietyRestrictionsOnCast(item_slot) && DoCastingChecksOnCaster(spell_id)) {
|
||||
else if (CheckItemRaceClassDietyRestrictionsOnCast(item_slot) && DoCastingChecksOnCaster(spell_id, CastingSlot::Item)) {
|
||||
int16 DeleteChargeFromSlot = GetItemSlotToConsumeCharge(spell_id, item_slot);
|
||||
if (SpellFinished(spell_id, entity_list.GetMob(target_id), CastingSlot::Item, 0, item_slot)) {
|
||||
if (IsClient() && DeleteChargeFromSlot >= 0) {
|
||||
|
||||
Reference in New Issue
Block a user