[7162] Converted some uint16 spellid parameteres to uint32. It can provide little speedup.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-01-24 18:41:35 +01:00
parent 475e8cbcf6
commit 302dc70eab
5 changed files with 18 additions and 18 deletions

View file

@ -1087,7 +1087,7 @@ void Pet::_LoadSpells()
{
Field *fields = result->Fetch();
addSpell(fields[0].GetUInt16(), fields[1].GetUInt16(), PETSPELL_UNCHANGED);
addSpell(fields[0].GetUInt32(), fields[1].GetUInt16(), PETSPELL_UNCHANGED);
}
while( result->NextRow() );
@ -1240,7 +1240,7 @@ void Pet::_SaveAuras()
}
}
bool Pet::addSpell(uint16 spell_id, uint16 active, PetSpellState state, PetSpellType type)
bool Pet::addSpell(uint32 spell_id, uint16 active, PetSpellState state, PetSpellType type)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
if (!spellInfo)
@ -1353,7 +1353,7 @@ bool Pet::addSpell(uint16 spell_id, uint16 active, PetSpellState state, PetSpell
return true;
}
bool Pet::learnSpell(uint16 spell_id)
bool Pet::learnSpell(uint32 spell_id)
{
// prevent duplicated entires in spell book
if (!addSpell(spell_id))
@ -1390,7 +1390,7 @@ void Pet::learnLevelupSpells()
}
}
bool Pet::unlearnSpell(uint16 spell_id)
bool Pet::unlearnSpell(uint32 spell_id)
{
if(removeSpell(spell_id))
{
@ -1408,7 +1408,7 @@ bool Pet::unlearnSpell(uint16 spell_id)
return false;
}
bool Pet::removeSpell(uint16 spell_id)
bool Pet::removeSpell(uint32 spell_id)
{
PetSpellMap::iterator itr = m_spells.find(spell_id);
if (itr == m_spells.end())
@ -1442,7 +1442,7 @@ bool Pet::removeSpell(uint16 spell_id)
return true;
}
bool Pet::_removeSpell(uint16 spell_id)
bool Pet::_removeSpell(uint32 spell_id)
{
PetSpellMap::iterator itr = m_spells.find(spell_id);
if (itr != m_spells.end())
@ -1459,7 +1459,7 @@ void Pet::InitPetCreateSpells()
m_charmInfo->InitPetActionBar();
m_spells.clear();
int32 petspellid;
uint32 petspellid;
PetCreateSpellEntry const* CreateSpells = objmgr.GetPetCreateSpellEntry(GetEntry());
if(CreateSpells)
{
@ -1654,7 +1654,7 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply)
if(IsPassiveSpell(spellid))
return;
PetSpellMap::const_iterator itr = m_spells.find((uint16)spellid);
PetSpellMap::const_iterator itr = m_spells.find(spellid);
int i;
@ -1708,7 +1708,7 @@ bool Pet::Create(uint32 guidlow, Map *map, uint32 Entry, uint32 pet_number)
bool Pet::HasSpell(uint32 spell) const
{
PetSpellMap::const_iterator itr = m_spells.find((uint16)spell);
PetSpellMap::const_iterator itr = m_spells.find(spell);
return (itr != m_spells.end() && itr->second->state != PETSPELL_REMOVED );
}

View file

@ -103,7 +103,7 @@ enum PetNameInvalidReason
PET_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 16
};
typedef UNORDERED_MAP<uint16, PetSpell*> PetSpellMap;
typedef UNORDERED_MAP<uint32, PetSpell*> PetSpellMap;
typedef std::map<uint32,uint32> TeachSpellMap;
typedef std::vector<uint32> AutoSpellList;
@ -188,12 +188,12 @@ class Pet : public Creature
void _LoadSpells();
void _SaveSpells();
bool addSpell(uint16 spell_id,uint16 active = ACT_DECIDE, PetSpellState state = PETSPELL_NEW, PetSpellType type = PETSPELL_NORMAL);
bool learnSpell(uint16 spell_id);
bool addSpell(uint32 spell_id,uint16 active = ACT_DECIDE, PetSpellState state = PETSPELL_NEW, PetSpellType type = PETSPELL_NORMAL);
bool learnSpell(uint32 spell_id);
void learnLevelupSpells();
bool unlearnSpell(uint16 spell_id);
bool removeSpell(uint16 spell_id);
bool _removeSpell(uint16 spell_id);
bool unlearnSpell(uint32 spell_id);
bool removeSpell(uint32 spell_id);
bool _removeSpell(uint32 spell_id);
PetSpellMap m_spells;
TeachSpellMap m_teachspells;

View file

@ -3559,7 +3559,7 @@ void Player::DestroyForPlayer( Player *target ) const
bool Player::HasSpell(uint32 spell) const
{
PlayerSpellMap::const_iterator itr = m_spells.find((uint16)spell);
PlayerSpellMap::const_iterator itr = m_spells.find(spell);
return (itr != m_spells.end() && itr->second->state != PLAYERSPELL_REMOVED && !itr->second->disabled);
}

View file

@ -104,7 +104,7 @@ struct SpellModifier
Spell const* lastAffected;
};
typedef UNORDERED_MAP<uint16, PlayerSpell*> PlayerSpellMap;
typedef UNORDERED_MAP<uint32, PlayerSpell*> PlayerSpellMap;
typedef std::list<SpellModifier*> SpellModList;
struct SpellCooldown

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "7161"
#define REVISION_NR "7162"
#endif // __REVISION_NR_H__