|
Баг-репорты Описываем проблемы и ошибки работы ядра |
|
Опции темы | Поиск в этой теме | Опции просмотра |
11.12.2010, 07:24 | #1 |
Пользователь
Регистрация: 12.03.2010
Сообщений: 85
Сказал(а) спасибо: 5
Поблагодарили 42 раз(а) в 17 сообщениях
|
SPELL_AURA_SCHOOL_IMMUNITY
Собственно заметил такую штуку:
Код:
ID - 642 Divine Shield .... Effect 1: Id 6 (SPELL_EFFECT_APPLY_AURA) BasePoints = 0 Targets (1, 0) (TARGET_SELF, NO_TARGET) Aura Id 39 (SPELL_AURA_SCHOOL_IMMUNITY), value = 0, misc = 127 (127), miscB = 0, periodic = 0 Effect 2: Id 6 (SPELL_EFFECT_APPLY_AURA) BasePoints = 1 Targets (1, 0) (TARGET_SELF, NO_TARGET) Aura Id 39 (SPELL_AURA_SCHOOL_IMMUNITY), value = 1, misc = 126 (126), miscB = 0, periodic = 0 Код:
void Aura::HandleAuraModSchoolImmunity(bool apply, bool Real) { Unit* target = GetTarget(); target->ApplySpellImmune(GetId(), IMMUNITY_SCHOOL, m_modifier.m_miscvalue, apply); .... } Код:
void Unit::ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply) { if (apply) { for (SpellImmuneList::iterator itr = m_spellImmune[op].begin(), next; itr != m_spellImmune[op].end(); itr = next) { next = itr; ++next; if(itr->type == type) { m_spellImmune[op].erase(itr); next = m_spellImmune[op].begin(); } } SpellImmune Immune; Immune.spellId = spellId; Immune.type = type; m_spellImmune[op].push_back(Immune); } else { for (SpellImmuneList::iterator itr = m_spellImmune[op].begin(); itr != m_spellImmune[op].end(); ++itr) { if(itr->spellId == spellId) { m_spellImmune[op].erase(itr); break; } } } } В результате apply у нас будет m_spellImmune[op] c 2 разными type и одинаковыми spellid (если это так то при apply = false будет косяк). 2) теперь посмотрим на часть с apply = false удаляется первое совпадение по spellid и прерывается. Выходит 2ая запись спела остается. Код:
... next = m_spellImmune[op].begin(); собственно предложение удалить её и изменить часть отвечающую за apply = false на Код:
for (SpellImmuneList::iterator itr = m_spellImmune[op].begin(), next; itr != m_spellImmune[op].end(); itr = next) { next = itr; ++next; if (itr->spellId == spellId) m_spellImmune[op].erase(itr); } Последний раз редактировалось zhenya; 11.12.2010 в 07:31. |