Cleaner way to handle out of range and swaps

This commit is contained in:
Akkadius
2014-11-02 22:30:29 -06:00
parent 771279128d
commit 51958b991c
3 changed files with 13 additions and 6 deletions
+7 -2
View File
@@ -12928,8 +12928,13 @@ void Client::Handle_OP_SwapSpell(const EQApplicationPacket *app)
m_pp.spell_book[swapspell->from_slot] = m_pp.spell_book[swapspell->to_slot];
m_pp.spell_book[swapspell->to_slot] = swapspelltemp;
database.SaveCharacterSpell(this->CharacterID(), m_pp.spell_book[swapspell->from_slot], swapspell->from_slot);
database.SaveCharacterSpell(this->CharacterID(), swapspelltemp, swapspell->to_slot);
/* Save Spell Swaps */
if (!database.SaveCharacterSpell(this->CharacterID(), m_pp.spell_book[swapspell->from_slot], swapspell->from_slot)){
database.DeleteCharacterSpell(this->CharacterID(), m_pp.spell_book[swapspell->from_slot], swapspell->from_slot);
}
if (!database.SaveCharacterSpell(this->CharacterID(), swapspelltemp, swapspell->to_slot)){
database.DeleteCharacterSpell(this->CharacterID(), swapspelltemp, swapspell->to_slot);
}
QueuePacket(app);
return;