mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 00:18:43 +01:00
AI/PlayerAI: Code style cleanup.
(cherry picked from commite3aa19281f) Build fix for horrendous, outdated, non-standards-compliant compilers. Such as the one in VS 2013. I hate VS 2013. Closes #17260. (cherry picked from commit321d35417d)
This commit is contained in:
@@ -451,13 +451,22 @@ PlayerAI::TargetedSpell PlayerAI::VerifySpellCast(uint32 spellId, Unit* target)
|
||||
// Find highest spell rank that we know
|
||||
uint32 knownRank, nextRank;
|
||||
if (me->HasSpell(spellId))
|
||||
{
|
||||
// this will save us some lookups if the player has the highest rank (expected case)
|
||||
nextRank = sSpellMgr->GetNextSpellInChain(knownRank = spellId);
|
||||
knownRank = spellId;
|
||||
nextRank = sSpellMgr->GetNextSpellInChain(spellId);
|
||||
}
|
||||
else
|
||||
knownRank = 0, nextRank = sSpellMgr->GetFirstSpellInChain(spellId);
|
||||
{
|
||||
knownRank = 0;
|
||||
nextRank = sSpellMgr->GetFirstSpellInChain(spellId);
|
||||
}
|
||||
|
||||
while (nextRank && me->HasSpell(nextRank))
|
||||
nextRank = sSpellMgr->GetNextSpellInChain(knownRank = nextRank);
|
||||
{
|
||||
knownRank = nextRank;
|
||||
nextRank = sSpellMgr->GetNextSpellInChain(knownRank);
|
||||
}
|
||||
|
||||
if (!knownRank)
|
||||
return {};
|
||||
|
||||
@@ -40,7 +40,8 @@ class TC_GAME_API PlayerAI : public UnitAI
|
||||
protected:
|
||||
struct TargetedSpell : public std::pair<Spell*, Unit*>
|
||||
{
|
||||
using std::pair<Spell*, Unit*>::pair;
|
||||
TargetedSpell() : pair<Spell*, Unit*>() { }
|
||||
TargetedSpell(Spell* first, Unit* second) : pair<Spell*, Unit*>(first, second) { }
|
||||
explicit operator bool() { return !!first; }
|
||||
};
|
||||
typedef std::pair<TargetedSpell, uint32> PossibleSpell;
|
||||
|
||||
Reference in New Issue
Block a user