Changeset 250 for trunk/src/game/Pet.cpp
- Timestamp:
- 11/19/08 13:50:41 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Pet.cpp
r218 r250 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_CAST 290 // so overwrite old state 291 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; 289 294 } 290 295 … … 1287 1292 Field *fields = result->Fetch(); 1288 1293 1289 addSpell(fields[0].GetUInt16(), fields[2].GetUInt16(), PETSPELL_UNCHANGED, fields[1].GetUInt16());1294 addSpell(fields[0].GetUInt16(), (ActiveStates)fields[2].GetUInt16(), PETSPELL_UNCHANGED, fields[1].GetUInt16()); 1290 1295 } 1291 1296 while( result->NextRow() ); … … 1418 1423 } 1419 1424 1420 bool Pet::addSpell(uint16 spell_id, uint16active, PetSpellState state, uint16 slot_id, PetSpellType type)1425 bool Pet::addSpell(uint16 spell_id, ActiveStates active, PetSpellState state, uint16 slot_id, PetSpellType type) 1421 1426 { 1422 1427 SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id); … … 1434 1439 return false; 1435 1440 } 1441 // same spells don't have autocast option 1442 if (spellInfo->AttributesEx & SPELL_ATTR_EX_PET_NOT_AUTOCAST) 1443 active = ACT_CAST; 1436 1444 1437 1445 PetSpellMap::iterator itr = m_spells.find(spell_id); … … 1509 1517 CastSpell(this, spell_id, true); 1510 1518 else if(state == PETSPELL_NEW) 1511 m_charmInfo->AddSpellToAB(oldspell_id, spell_id );1519 m_charmInfo->AddSpellToAB(oldspell_id, spell_id, active); 1512 1520 1513 1521 if(newspell->active == ACT_ENABLED) … … 1659 1667 return; 1660 1668 1661 if(const SpellEntry *tempSpell = GetSpellStore()->LookupEntry(spellid))1669 /*if(const SpellEntry *tempSpell = GetSpellStore()->LookupEntry(spellid)) 1662 1670 if(tempSpell->EffectImplicitTargetA[0] != TARGET_ALL_AROUND_CASTER 1663 1671 && tempSpell->EffectImplicitTargetA[0] != TARGET_CHAIN_DAMAGE) 1664 return; 1672 return; */ 1665 1673 1666 1674 PetSpellMap::const_iterator itr = m_spells.find((uint16)spellid);