refactor(Scripts/Commands): code cleanup (part 4) (#6921)

This commit is contained in:
Francesco Borzì
2021-07-18 13:25:44 +02:00
committed by GitHub
parent a57c4fd3b8
commit fab0fc421b
9 changed files with 53 additions and 53 deletions

View File

@@ -34,15 +34,20 @@ public:
return false;
char* playerName = strtok((char*)args, " ");
char* spellid = strtok(nullptr, " ");
char* spellId = strtok(nullptr, " ");
char const* all = strtok(nullptr, " ");
Player* targetPlayer = FindPlayer(handler, playerName);
if (!spellid || !targetPlayer)
if (!spellId || !targetPlayer)
{
return false;
}
uint32 spell = handler->extractSpellIdFromLink(spellId);
uint32 spell = handler->extractSpellIdFromLink(spellid);
if (!spell)
{
return false;
}
return Learn(handler, targetPlayer, spell, all);
}
@@ -53,15 +58,21 @@ public:
return false;
char* playerName = strtok((char*)args, " ");
char* spellid = strtok(nullptr, " ");
char* spellId = strtok(nullptr, " ");
char const* all = strtok(nullptr, " ");
Player* targetPlayer = FindPlayer(handler, playerName);
if (!spellid || !targetPlayer)
return false;
uint32 spell = handler->extractSpellIdFromLink(spellid);
if (!spell)
if (!spellId || !targetPlayer)
{
return false;
}
uint32 spell = handler->extractSpellIdFromLink(spellId);
if (!spell)
{
return false;
}
return UnLearn(handler, targetPlayer, spell, all);
}