Changeset 253 for trunk/src/game/Pet.cpp
- Timestamp:
- 11/19/08 13:51:05 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Pet.cpp
r250 r253 287 287 ++iter; 288 288 m_charmInfo->GetActionBarEntry(index)->SpellOrAction = atol((*iter).c_str()); 289 // patch for old data where some spells have ACT_DECIDE but should have ACT_CAST290 // so overwrite old state291 SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_charmInfo->GetActionBarEntry(index)->SpellOrAction);292 if (spellInfo && spellInfo->AttributesEx & SPELL_ATTR_EX_PET_NOT_AUTOCAST)293 m_charmInfo->GetActionBarEntry(index)->Type = ACT_CAST;294 289 } 295 290 … … 1292 1287 Field *fields = result->Fetch(); 1293 1288 1294 addSpell(fields[0].GetUInt16(), (ActiveStates)fields[2].GetUInt16(), PETSPELL_UNCHANGED, fields[1].GetUInt16());1289 addSpell(fields[0].GetUInt16(), fields[2].GetUInt16(), PETSPELL_UNCHANGED, fields[1].GetUInt16()); 1295 1290 } 1296 1291 while( result->NextRow() ); … … 1423 1418 } 1424 1419 1425 bool Pet::addSpell(uint16 spell_id, ActiveStatesactive, PetSpellState state, uint16 slot_id, PetSpellType type)1420 bool Pet::addSpell(uint16 spell_id, uint16 active, PetSpellState state, uint16 slot_id, PetSpellType type) 1426 1421 { 1427 1422 SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id); … … 1439 1434 return false; 1440 1435 } 1441 // same spells don't have autocast option1442 if (spellInfo->AttributesEx & SPELL_ATTR_EX_PET_NOT_AUTOCAST)1443 active = ACT_CAST;1444 1436 1445 1437 PetSpellMap::iterator itr = m_spells.find(spell_id); … … 1517 1509 CastSpell(this, spell_id, true); 1518 1510 else if(state == PETSPELL_NEW) 1519 m_charmInfo->AddSpellToAB(oldspell_id, spell_id , active);1511 m_charmInfo->AddSpellToAB(oldspell_id, spell_id); 1520 1512 1521 1513 if(newspell->active == ACT_ENABLED) … … 1667 1659 return; 1668 1660 1669 /*if(const SpellEntry *tempSpell = GetSpellStore()->LookupEntry(spellid))1661 if(const SpellEntry *tempSpell = GetSpellStore()->LookupEntry(spellid)) 1670 1662 if(tempSpell->EffectImplicitTargetA[0] != TARGET_ALL_AROUND_CASTER 1671 1663 && tempSpell->EffectImplicitTargetA[0] != TARGET_CHAIN_DAMAGE) 1672 return; */1664 return; 1673 1665 1674 1666 PetSpellMap::const_iterator itr = m_spells.find((uint16)spellid);