mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7751] Use more safe code to prevent DB errors at pet spells save and avoid unneded data save.
This commit is contained in:
parent
56401e1494
commit
4561dec27e
2 changed files with 14 additions and 5 deletions
|
|
@ -1677,10 +1677,15 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply)
|
|||
if (i == m_autospells.size())
|
||||
{
|
||||
m_autospells.push_back(spellid);
|
||||
|
||||
if(itr->second->active != ACT_ENABLED)
|
||||
{
|
||||
itr->second->active = ACT_ENABLED;
|
||||
if(itr->second->state != PETSPELL_NEW)
|
||||
itr->second->state = PETSPELL_CHANGED;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AutoSpellList::iterator itr2 = m_autospells.begin();
|
||||
|
|
@ -1690,11 +1695,15 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply)
|
|||
if (i < m_autospells.size())
|
||||
{
|
||||
m_autospells.erase(itr2);
|
||||
if(itr->second->active != ACT_DISABLED)
|
||||
{
|
||||
itr->second->active = ACT_DISABLED;
|
||||
if(itr->second->state != PETSPELL_NEW)
|
||||
itr->second->state = PETSPELL_CHANGED;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool Pet::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 pet_number)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7750"
|
||||
#define REVISION_NR "7751"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue