mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-25 21:02:26 +00:00
[Cleanup] Use .empty() in Client::ScribeSpells() and Client::LearnDisciplines() (#3259)
* [Cleanup] Use .empty() in Client::ScribeSpells() and Client::LearnDisciplines() # Notes - Use `.empty()` instead of using a variable storing size in condition. * Update client.cpp
This commit is contained in:
parent
ea3a7cae0b
commit
b08975aefb
@ -11092,12 +11092,12 @@ void Client::SaveDisciplines()
|
|||||||
|
|
||||||
uint16 Client::ScribeSpells(uint8 min_level, uint8 max_level)
|
uint16 Client::ScribeSpells(uint8 min_level, uint8 max_level)
|
||||||
{
|
{
|
||||||
int available_book_slot = GetNextAvailableSpellBookSlot();
|
auto available_book_slot = GetNextAvailableSpellBookSlot();
|
||||||
std::vector<int> spell_ids = GetScribeableSpells(min_level, max_level);
|
std::vector<int> spell_ids = GetScribeableSpells(min_level, max_level);
|
||||||
uint16 spell_count = spell_ids.size();
|
uint16 scribed_spells = 0;
|
||||||
uint16 scribed_spells = 0;
|
|
||||||
if (spell_count > 0) {
|
if (!spell_ids.empty()) {
|
||||||
for (auto spell_id : spell_ids) {
|
for (const auto& spell_id : spell_ids) {
|
||||||
if (available_book_slot == -1) {
|
if (available_book_slot == -1) {
|
||||||
Message(
|
Message(
|
||||||
Chat::Red,
|
Chat::Red,
|
||||||
@ -11137,13 +11137,13 @@ uint16 Client::ScribeSpells(uint8 min_level, uint8 max_level)
|
|||||||
|
|
||||||
uint16 Client::LearnDisciplines(uint8 min_level, uint8 max_level)
|
uint16 Client::LearnDisciplines(uint8 min_level, uint8 max_level)
|
||||||
{
|
{
|
||||||
int available_discipline_slot = GetNextAvailableDisciplineSlot();
|
auto available_discipline_slot = GetNextAvailableDisciplineSlot();
|
||||||
int character_id = CharacterID();
|
auto character_id = CharacterID();
|
||||||
std::vector<int> spell_ids = GetLearnableDisciplines(min_level, max_level);
|
std::vector<int> spell_ids = GetLearnableDisciplines(min_level, max_level);
|
||||||
uint16 discipline_count = spell_ids.size();
|
uint16 learned_disciplines = 0;
|
||||||
uint16 learned_disciplines = 0;
|
|
||||||
if (discipline_count > 0) {
|
if (!spell_ids.empty()) {
|
||||||
for (auto spell_id : spell_ids) {
|
for (const auto& spell_id : spell_ids) {
|
||||||
if (available_discipline_slot == -1) {
|
if (available_discipline_slot == -1) {
|
||||||
Message(
|
Message(
|
||||||
Chat::Red,
|
Chat::Red,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user