Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
beats-dh committed Sep 28, 2024
1 parent 67575ab commit 03dca05
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/creatures/players/vocations/vocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include "utils/pugicast.hpp"
#include "utils/tools.hpp"

#include <creatures/players/wheel/wheel_gems.hpp>

Vocations &Vocations::getInstance() {
return inject<Vocations>();
}
Expand Down Expand Up @@ -292,6 +294,12 @@ uint64_t Vocation::getReqMana(uint32_t magLevel) {
return reqMana;
}

template <>
struct magic_enum::customize::enum_range<WheelGemSupremeModifier_t> {
static constexpr int min = 0;
static constexpr int max = static_cast<int>(WheelGemSupremeModifier_t::Druid_RevelationMastery_TwinBursts);
};

std::vector<WheelGemSupremeModifier_t> Vocation::getSupremeGemModifiers() {
if (!m_supremeGemModifiers.empty()) {
return m_supremeGemModifiers;
Expand All @@ -300,6 +308,7 @@ std::vector<WheelGemSupremeModifier_t> Vocation::getSupremeGemModifiers() {
auto vocationName = asLowerCaseString(baseVocation->getVocName());
auto allModifiers = magic_enum::enum_entries<WheelGemSupremeModifier_t>();
g_logger().debug("Loading supreme gem modifiers for vocation: {}", vocationName);

for (const auto &[value, modifierName] : allModifiers) {
std::string targetVocation(modifierName.substr(0, modifierName.find('_')));
toLowerCaseString(targetVocation);
Expand Down
7 changes: 4 additions & 3 deletions src/pch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@
#include <fmt/core.h>
#include <fmt/format.h>
#include <fmt/args.h>
#include <fmt/ranges.h>

// FMT Custom Formatter for Enums
template <typename E>
struct fmt::formatter<E, std::enable_if_t<std::is_enum_v<E>, char>> : formatter<std::underlying_type_t<E>> {
struct fmt::formatter<E, std::enable_if_t<std::is_enum_v<E>, char>> : fmt::formatter<std::underlying_type_t<E>> {
template <typename FormatContext>
auto format(E e, FormatContext &ctx) {
return formatter<std::underlying_type_t<E>>::format(
auto format(E e, FormatContext &ctx) const {
return fmt::formatter<std::underlying_type_t<E>>::format(
static_cast<std::underlying_type_t<E>>(e), ctx
);
}
Expand Down

0 comments on commit 03dca05

Please sign in to comment.