[API] Fix for SetBuffDuration function to check bard slots. (#2009)

This commit is contained in:
KayenEQ 2022-02-17 12:00:42 -05:00 committed by GitHub
parent 0d02fadb60
commit 56d0478ab1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10234,7 +10234,7 @@ void Mob::SetBuffDuration(int32 spell_id, int32 duration) {
duration = PERMANENT_BUFF_DURATION; duration = PERMANENT_BUFF_DURATION;
} }
int buff_count = GetMaxBuffSlots(); int buff_count = GetMaxTotalSlots();
for (int slot = 0; slot < buff_count; slot++) { for (int slot = 0; slot < buff_count; slot++) {
if (!adjust_all_buffs) { if (!adjust_all_buffs) {
@ -10283,7 +10283,7 @@ int Mob::GetBuffStatValueBySpell(int32 spell_id, const char* stat_identifier)
std::string id = str_tolower(stat_identifier); std::string id = str_tolower(stat_identifier);
int buff_count = GetMaxBuffSlots(); int buff_count = GetMaxTotalSlots();
for (int slot = 0; slot < buff_count; slot++) { for (int slot = 0; slot < buff_count; slot++) {
if (buffs[slot].spellid != SPELL_UNKNOWN && buffs[slot].spellid == spell_id) { if (buffs[slot].spellid != SPELL_UNKNOWN && buffs[slot].spellid == spell_id) {
return GetBuffStatValueBySlot(slot, stat_identifier); return GetBuffStatValueBySlot(slot, stat_identifier);
@ -10294,7 +10294,7 @@ int Mob::GetBuffStatValueBySpell(int32 spell_id, const char* stat_identifier)
int Mob::GetBuffStatValueBySlot(uint8 slot, const char* stat_identifier) int Mob::GetBuffStatValueBySlot(uint8 slot, const char* stat_identifier)
{ {
if (slot > GetMaxBuffSlots()) { if (slot > GetMaxTotalSlots()) {
return 0; return 0;
} }