Skip to content

Commit

Permalink
Code format - (Clang-format)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Apr 10, 2024
1 parent 4097edf commit 3720636
Show file tree
Hide file tree
Showing 15 changed files with 612 additions and 614 deletions.
2 changes: 1 addition & 1 deletion src/canary_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ void CanaryServer::loadModules() {
modulesLoadHelper((g_npcs().load(false, true)), "npc");

g_game().loadBoostedCreature();
// TODO g_game().initializeGameWorldHighscores();
// TODO g_game().initializeGameWorldHighscores();
g_ioBosstiary().loadBoostedBoss();
g_ioprey().initializeTaskHuntOptions();
}
Expand Down
4 changes: 2 additions & 2 deletions src/config/config_enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ enum ConfigKey_t : uint16_t {
AUTH_TYPE,
AUTOBANK,
AUTOLOOT,
BADGE_SYSTEM_ENABLED,
BADGE_SYSTEM_ENABLED,
BESTIARY_KILL_MULTIPLIER,
BESTIARY_RATE_CHARM_SHOP_PRICE,
BIND_ONLY_GLOBAL_ADDRESS,
Expand Down Expand Up @@ -278,7 +278,7 @@ enum ConfigKey_t : uint16_t {
TIBIADROME_CONCOCTION_COOLDOWN,
TIBIADROME_CONCOCTION_DURATION,
TIBIADROME_CONCOCTION_TICK_TYPE,
TITLE_SYSTEM_ENABLED,
TITLE_SYSTEM_ENABLED,
TOGGLE_ATTACK_SPEED_ONFIST,
TOGGLE_CHAIN_SYSTEM,
TOGGLE_DOWNLOAD_MAP,
Expand Down
4 changes: 2 additions & 2 deletions src/config/configmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ bool ConfigManager::load() {
loadBoolConfig(L, ALLOW_RELOAD, "allowReload", false);
loadBoolConfig(L, AUTOBANK, "autoBank", false);
loadBoolConfig(L, AUTOLOOT, "autoLoot", false);
loadBoolConfig(L, BADGE_SYSTEM_ENABLED, "badgeSystemEnabled", true);
loadBoolConfig(L, BADGE_SYSTEM_ENABLED, "badgeSystemEnabled", true);
loadBoolConfig(L, BOOSTED_BOSS_SLOT, "boostedBossSlot", true);
loadBoolConfig(L, CLASSIC_ATTACK_SPEED, "classicAttackSpeed", false);
loadBoolConfig(L, CLEAN_PROTECTION_ZONES, "cleanProtectionZones", false);
Expand Down Expand Up @@ -140,7 +140,7 @@ bool ConfigManager::load() {
loadBoolConfig(L, TASK_HUNTING_FREE_THIRD_SLOT, "taskHuntingFreeThirdSlot", false);
loadBoolConfig(L, TELEPORT_PLAYER_TO_VOCATION_ROOM, "teleportPlayerToVocationRoom", true);
loadBoolConfig(L, TELEPORT_SUMMONS, "teleportSummons", false);
loadBoolConfig(L, TITLE_SYSTEM_ENABLED, "titleSystemEnabled", true);
loadBoolConfig(L, TITLE_SYSTEM_ENABLED, "titleSystemEnabled", true);
loadBoolConfig(L, TOGGLE_ATTACK_SPEED_ONFIST, "toggleAttackSpeedOnFist", false);
loadBoolConfig(L, TOGGLE_CHAIN_SYSTEM, "toggleChainSystem", true);
loadBoolConfig(L, TOGGLE_DOWNLOAD_MAP, "toggleDownloadMap", false);
Expand Down
201 changes: 100 additions & 101 deletions src/creatures/players/cyclopedia/player_cyclopedia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,209 +16,208 @@
#include "kv/kv.hpp"

PlayerCyclopedia::PlayerCyclopedia(Player &player) :

Check warning on line 18 in src/creatures/players/cyclopedia/player_cyclopedia.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

[cppcheck] reported by reviewdog 🐶 Member variable 'PlayerCyclopedia::m_currentTitle' is not initialized in the constructor. Raw Output: src/creatures/players/cyclopedia/player_cyclopedia.cpp:18:Member variable 'PlayerCyclopedia::m_currentTitle' is not initialized in the constructor.
m_player(player) {}
m_player(player) { }

// Badge
bool PlayerCyclopedia::hasBadge(uint8_t id) {
if (auto it = std::find_if(badges.begin(), badges.end(), [id](uint8_t it) {
return it == id;
}); it != badges.end()) {
return true;
}

return false;
if (auto it = std::find_if(badges.begin(), badges.end(), [id](uint8_t it) {
return it == id;
});
it != badges.end()) {
return true;
}

return false;
}

void PlayerCyclopedia::addBadge(uint8_t id) {
if (hasBadge(id)) {
return;
}
if (hasBadge(id)) {
return;
}

badges.emplace_back(id);
badges.emplace_back(id);
}

// Title
std::vector<uint8_t> PlayerCyclopedia::getTitles() const {
return titles;
return titles;
}

uint8_t PlayerCyclopedia::getCurrentTitle() const {
return m_currentTitle;
return m_currentTitle;
}

std::string PlayerCyclopedia::getCurrentTitleName() const {
auto currentTitle = getCurrentTitle();
if (currentTitle == 0) {
return "";
}
auto currentTitle = getCurrentTitle();
if (currentTitle == 0) {
return "";
}

auto title = g_game().getTitle(currentTitle);
return (m_player.getSex() == PLAYERSEX_MALE) ? title.maleName : title.femaleName;
auto title = g_game().getTitle(currentTitle);
return (m_player.getSex() == PLAYERSEX_MALE) ? title.maleName : title.femaleName;
}

void PlayerCyclopedia::setCurrentTitle(uint8_t id) {

Check warning on line 60 in src/creatures/players/cyclopedia/player_cyclopedia.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

[cppcheck] reported by reviewdog 🐶 The function 'setCurrentTitle' is never used. Raw Output: src/creatures/players/cyclopedia/player_cyclopedia.cpp:60:The function 'setCurrentTitle' is never used.
if (id != 0 && !isTitleUnlocked(id)) {
return;
}
if (id != 0 && !isTitleUnlocked(id)) {
return;
}

m_currentTitle = id;
m_currentTitle = id;
}

void PlayerCyclopedia::addTitle(uint8_t id) {
if (isTitleUnlocked(id)) {
return;
}
if (isTitleUnlocked(id)) {
return;
}

titles.emplace_back(id);
titles.emplace_back(id);
}



bool PlayerCyclopedia::isTitleUnlocked(uint8_t id) const {
if (auto it = std::find_if(titles.begin(), titles.end(), [id](uint8_t title_it) {
return title_it == id;
}); it != titles.end()) {
return true;
}

return false;
if (auto it = std::find_if(titles.begin(), titles.end(), [id](uint8_t title_it) {
return title_it == id;
});
it != titles.end()) {
return true;
}

return false;
}

// Death History
std::vector<RecentDeathEntry> PlayerCyclopedia::getDeathHistory() const {

Check warning on line 88 in src/creatures/players/cyclopedia/player_cyclopedia.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

[cppcheck] reported by reviewdog 🐶 The function 'getDeathHistory' is never used. Raw Output: src/creatures/players/cyclopedia/player_cyclopedia.cpp:88:The function 'getDeathHistory' is never used.
return m_deathHistory;
return m_deathHistory;
}

void PlayerCyclopedia::insertDeathOnHistory(std::string cause, uint32_t timestamp) {
m_deathHistory.emplace_back(std::move(cause), timestamp);
m_deathHistory.emplace_back(std::move(cause), timestamp);
}

std::vector<RecentPvPKillEntry> PlayerCyclopedia::getPvpKillsHistory() const {

Check warning on line 96 in src/creatures/players/cyclopedia/player_cyclopedia.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

[cppcheck] reported by reviewdog 🐶 The function 'getPvpKillsHistory' is never used. Raw Output: src/creatures/players/cyclopedia/player_cyclopedia.cpp:96:The function 'getPvpKillsHistory' is never used.
return m_pvpKillsHistory;
return m_pvpKillsHistory;
}

void PlayerCyclopedia::insertPvpKillOnHistory(std::string cause, uint32_t timestamp, uint8_t status) {
m_pvpKillsHistory.emplace_back(std::move(cause), timestamp, status);
m_pvpKillsHistory.emplace_back(std::move(cause), timestamp, status);
}

// Player summary region
// Get:
//std::vector<uint16_t> getHirelinsOutfitsObtained() const {
// std::vector<uint16_t> getHirelinsOutfitsObtained() const {
// return m_player.hirelingOutfitsObtained;
//}
//
//std::vector<uint8_t> getHirelinsJobsObtained() const {
// std::vector<uint8_t> getHirelinsJobsObtained() const {
// return hirelingJobsObtained;
//}
//
//std::map<Blessings_t, uint16_t> getBlessingsObtained() const {
// std::map<Blessings_t, uint16_t> getBlessingsObtained() const {
// return blessingsObtained;
//}
//
//StashItemList getHouseItemsObtained() const {
// StashItemList getHouseItemsObtained() const {
// return houseItemsObtained;
//}
//
//uint16_t getXpBoostsObtained() const {
// uint16_t getXpBoostsObtained() const {
// return storeXpBoostsObtained;
//}
//
//uint16_t getRewardCollectionObtained() const {
// uint16_t getRewardCollectionObtained() const {
// return dailyRewardCollectionsObtained;
//}
//
//uint16_t getHirelingsObtained() const {
// uint16_t getHirelingsObtained() const {
// return hirelingsObtained;
//}
//
//uint16_t getPreyCardsObtained() const {
// uint16_t getPreyCardsObtained() const {
// return preyCardsObtained;
//}
//
//uint16_t getCharmsPointsObtained() const {
// uint16_t getCharmsPointsObtained() const {
// return charmsObtained;
//}
//
//uint16_t getGoshnarTaintsObtained() const {
// uint16_t getGoshnarTaintsObtained() const {
// return goshnarObtained;
//}
//
//uint16_t getDromePointsObtained() const {
// uint16_t getDromePointsObtained() const {
// return dromeObtained;
//}
//
//uint16_t getLoginStreak() const {
// uint16_t getLoginStreak() const {
// return loginStreak;
//}
//
//uint16_t getTaskHuntingPointsObtained() const {
// uint16_t getTaskHuntingPointsObtained() const {
// return taskHuntingPointsObtained;
//}
//
//uint16_t getMapAreaDiscoveredPercentage() const {
// uint16_t getMapAreaDiscoveredPercentage() const {
// return mapAreaDiscoveredPercentage;
//}
//
//// Player summary region
//// Set:
//void addHirelingOutfitObtained(uint16_t lookType) {
// hirelingOutfitsObtained.push_back(lookType);
//}
// void addHirelingOutfitObtained(uint16_t lookType) {
// hirelingOutfitsObtained.push_back(lookType);
// }
//
//void addHirelingJobsObtained(uint8_t jobId) {
// hirelingJobsObtained.push_back(jobId);
//}
// void addHirelingJobsObtained(uint8_t jobId) {
// hirelingJobsObtained.push_back(jobId);
// }
//
//void addBlessingsObtained(Blessings_t id, uint16_t amount) {
// blessingsObtained[id] += amount;
//}
// void addBlessingsObtained(Blessings_t id, uint16_t amount) {
// blessingsObtained[id] += amount;
// }
//
//void addHouseItemsObtained(uint16_t itemId, uint32_t amount) {
// houseItemsObtained[itemId] += amount;
//}
// void addHouseItemsObtained(uint16_t itemId, uint32_t amount) {
// houseItemsObtained[itemId] += amount;
// }
//
//void addXpBoostsObtained(uint16_t amount) {
// storeXpBoostsObtained += amount;
//}
// void addXpBoostsObtained(uint16_t amount) {
// storeXpBoostsObtained += amount;
// }
//
//void addRewardCollectionObtained(uint16_t amount) {
// dailyRewardCollectionsObtained += amount;
//}
// void addRewardCollectionObtained(uint16_t amount) {
// dailyRewardCollectionsObtained += amount;
// }
//
//void addHirelingsObtained(uint16_t amount) {
// hirelingsObtained += amount;
//}
// void addHirelingsObtained(uint16_t amount) {
// hirelingsObtained += amount;
// }
//
//void addPreyCardsObtained(uint16_t amount) {
// preyCardsObtained += amount;
//}
// void addPreyCardsObtained(uint16_t amount) {
// preyCardsObtained += amount;
// }
//
//void addCharmsPointsObtained(uint16_t amount) {
// charmsObtained += amount;
//}
// void addCharmsPointsObtained(uint16_t amount) {
// charmsObtained += amount;
// }
//
//void addGoshnarTaintsObtained(uint16_t amount) {
// goshnarObtained += amount;
//}
// void addGoshnarTaintsObtained(uint16_t amount) {
// goshnarObtained += amount;
// }
//
//void addDromePointsObtained(uint16_t amount) {
// dromeObtained += amount;
//}
// void addDromePointsObtained(uint16_t amount) {
// dromeObtained += amount;
// }
//
//void addLoginStreak(uint16_t amount) {
// loginStreak += amount;
//}
// void addLoginStreak(uint16_t amount) {
// loginStreak += amount;
// }
//
//void addTaskHuntingPointsObtained(uint16_t amount) {
// taskHuntingPointsObtained += amount;
//}
// void addTaskHuntingPointsObtained(uint16_t amount) {
// taskHuntingPointsObtained += amount;
// }
//
//void addMapAreaDiscoveredPercentage(uint16_t amount) {
// mapAreaDiscoveredPercentage += amount;
//}
// void addMapAreaDiscoveredPercentage(uint16_t amount) {
// mapAreaDiscoveredPercentage += amount;
// }
//

//std::map<uint8_t, std::vector<uint16_t>> getAccountLevelVocation() const {
// return accountLevelSummary;
//}

// std::map<uint8_t, std::vector<uint16_t>> getAccountLevelVocation() const {
// return accountLevelSummary;
// }
Loading

0 comments on commit 3720636

Please sign in to comment.