mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[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:
parent
475e8cbcf6
commit
302dc70eab
5 changed files with 18 additions and 18 deletions
|
|
@ -1087,7 +1087,7 @@ void Pet::_LoadSpells()
|
||||||
{
|
{
|
||||||
Field *fields = result->Fetch();
|
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() );
|
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);
|
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
|
||||||
if (!spellInfo)
|
if (!spellInfo)
|
||||||
|
|
@ -1353,7 +1353,7 @@ bool Pet::addSpell(uint16 spell_id, uint16 active, PetSpellState state, PetSpell
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Pet::learnSpell(uint16 spell_id)
|
bool Pet::learnSpell(uint32 spell_id)
|
||||||
{
|
{
|
||||||
// prevent duplicated entires in spell book
|
// prevent duplicated entires in spell book
|
||||||
if (!addSpell(spell_id))
|
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))
|
if(removeSpell(spell_id))
|
||||||
{
|
{
|
||||||
|
|
@ -1408,7 +1408,7 @@ bool Pet::unlearnSpell(uint16 spell_id)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Pet::removeSpell(uint16 spell_id)
|
bool Pet::removeSpell(uint32 spell_id)
|
||||||
{
|
{
|
||||||
PetSpellMap::iterator itr = m_spells.find(spell_id);
|
PetSpellMap::iterator itr = m_spells.find(spell_id);
|
||||||
if (itr == m_spells.end())
|
if (itr == m_spells.end())
|
||||||
|
|
@ -1442,7 +1442,7 @@ bool Pet::removeSpell(uint16 spell_id)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Pet::_removeSpell(uint16 spell_id)
|
bool Pet::_removeSpell(uint32 spell_id)
|
||||||
{
|
{
|
||||||
PetSpellMap::iterator itr = m_spells.find(spell_id);
|
PetSpellMap::iterator itr = m_spells.find(spell_id);
|
||||||
if (itr != m_spells.end())
|
if (itr != m_spells.end())
|
||||||
|
|
@ -1459,7 +1459,7 @@ void Pet::InitPetCreateSpells()
|
||||||
m_charmInfo->InitPetActionBar();
|
m_charmInfo->InitPetActionBar();
|
||||||
|
|
||||||
m_spells.clear();
|
m_spells.clear();
|
||||||
int32 petspellid;
|
uint32 petspellid;
|
||||||
PetCreateSpellEntry const* CreateSpells = objmgr.GetPetCreateSpellEntry(GetEntry());
|
PetCreateSpellEntry const* CreateSpells = objmgr.GetPetCreateSpellEntry(GetEntry());
|
||||||
if(CreateSpells)
|
if(CreateSpells)
|
||||||
{
|
{
|
||||||
|
|
@ -1654,7 +1654,7 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply)
|
||||||
if(IsPassiveSpell(spellid))
|
if(IsPassiveSpell(spellid))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PetSpellMap::const_iterator itr = m_spells.find((uint16)spellid);
|
PetSpellMap::const_iterator itr = m_spells.find(spellid);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
@ -1708,7 +1708,7 @@ bool Pet::Create(uint32 guidlow, Map *map, uint32 Entry, uint32 pet_number)
|
||||||
|
|
||||||
bool Pet::HasSpell(uint32 spell) const
|
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 );
|
return (itr != m_spells.end() && itr->second->state != PETSPELL_REMOVED );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ enum PetNameInvalidReason
|
||||||
PET_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 16
|
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::map<uint32,uint32> TeachSpellMap;
|
||||||
typedef std::vector<uint32> AutoSpellList;
|
typedef std::vector<uint32> AutoSpellList;
|
||||||
|
|
||||||
|
|
@ -188,12 +188,12 @@ class Pet : public Creature
|
||||||
void _LoadSpells();
|
void _LoadSpells();
|
||||||
void _SaveSpells();
|
void _SaveSpells();
|
||||||
|
|
||||||
bool addSpell(uint16 spell_id,uint16 active = ACT_DECIDE, PetSpellState state = PETSPELL_NEW, PetSpellType type = PETSPELL_NORMAL);
|
bool addSpell(uint32 spell_id,uint16 active = ACT_DECIDE, PetSpellState state = PETSPELL_NEW, PetSpellType type = PETSPELL_NORMAL);
|
||||||
bool learnSpell(uint16 spell_id);
|
bool learnSpell(uint32 spell_id);
|
||||||
void learnLevelupSpells();
|
void learnLevelupSpells();
|
||||||
bool unlearnSpell(uint16 spell_id);
|
bool unlearnSpell(uint32 spell_id);
|
||||||
bool removeSpell(uint16 spell_id);
|
bool removeSpell(uint32 spell_id);
|
||||||
bool _removeSpell(uint16 spell_id);
|
bool _removeSpell(uint32 spell_id);
|
||||||
|
|
||||||
PetSpellMap m_spells;
|
PetSpellMap m_spells;
|
||||||
TeachSpellMap m_teachspells;
|
TeachSpellMap m_teachspells;
|
||||||
|
|
|
||||||
|
|
@ -3559,7 +3559,7 @@ void Player::DestroyForPlayer( Player *target ) const
|
||||||
|
|
||||||
bool Player::HasSpell(uint32 spell) 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);
|
return (itr != m_spells.end() && itr->second->state != PLAYERSPELL_REMOVED && !itr->second->disabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ struct SpellModifier
|
||||||
Spell const* lastAffected;
|
Spell const* lastAffected;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef UNORDERED_MAP<uint16, PlayerSpell*> PlayerSpellMap;
|
typedef UNORDERED_MAP<uint32, PlayerSpell*> PlayerSpellMap;
|
||||||
typedef std::list<SpellModifier*> SpellModList;
|
typedef std::list<SpellModifier*> SpellModList;
|
||||||
|
|
||||||
struct SpellCooldown
|
struct SpellCooldown
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7161"
|
#define REVISION_NR "7162"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue