mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +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,8 +1677,13 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply)
|
||||||
if (i == m_autospells.size())
|
if (i == m_autospells.size())
|
||||||
{
|
{
|
||||||
m_autospells.push_back(spellid);
|
m_autospells.push_back(spellid);
|
||||||
itr->second->active = ACT_ENABLED;
|
|
||||||
itr->second->state = PETSPELL_CHANGED;
|
if(itr->second->active != ACT_ENABLED)
|
||||||
|
{
|
||||||
|
itr->second->active = ACT_ENABLED;
|
||||||
|
if(itr->second->state != PETSPELL_NEW)
|
||||||
|
itr->second->state = PETSPELL_CHANGED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1690,8 +1695,12 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply)
|
||||||
if (i < m_autospells.size())
|
if (i < m_autospells.size())
|
||||||
{
|
{
|
||||||
m_autospells.erase(itr2);
|
m_autospells.erase(itr2);
|
||||||
itr->second->active = ACT_DISABLED;
|
if(itr->second->active != ACT_DISABLED)
|
||||||
itr->second->state = PETSPELL_CHANGED;
|
{
|
||||||
|
itr->second->active = ACT_DISABLED;
|
||||||
|
if(itr->second->state != PETSPELL_NEW)
|
||||||
|
itr->second->state = PETSPELL_CHANGED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7750"
|
#define REVISION_NR "7751"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue