Skip to content

Commit

Permalink
fix: wheel spells bonuses (#3122)
Browse files Browse the repository at this point in the history
This fixes the issue that some spells was sharing bonuses between all
other spells
  • Loading branch information
phacUFPE authored Nov 18, 2024
1 parent 4ee11d6 commit ba6ad33
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 0 additions & 3 deletions src/creatures/combat/spells.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
#include "lua/scripts/scripts.hpp"
#include "lib/di/container.hpp"

std::array<int32_t, static_cast<uint8_t>(WheelSpellBoost_t::TOTAL_COUNT)> wheelOfDestinyRegularBoost = { 0 };
std::array<int32_t, static_cast<uint8_t>(WheelSpellBoost_t::TOTAL_COUNT)> wheelOfDestinyUpgradedBoost = { 0 };

Spells::Spells() = default;
Spells::~Spells() = default;

Expand Down
6 changes: 3 additions & 3 deletions src/creatures/combat/spells.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
#pragma once

#include "lua/creature/actions.hpp"

enum class WheelSpellBoost_t : uint8_t;
enum class WheelSpellGrade_t : uint8_t;
#include "creatures/players/wheel/wheel_definitions.hpp"

class InstantSpell;
class RuneSpell;
Expand Down Expand Up @@ -256,6 +254,8 @@ class Spell : public BaseSpell {
bool pzLocked = false;

bool whellOfDestinyUpgraded = false;
std::array<int32_t, static_cast<uint8_t>(WheelSpellBoost_t::TOTAL_COUNT)> wheelOfDestinyRegularBoost = { 0 };
std::array<int32_t, static_cast<uint8_t>(WheelSpellBoost_t::TOTAL_COUNT)> wheelOfDestinyUpgradedBoost = { 0 };

private:
uint32_t mana = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/io/io_wheel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace InternalPlayerWheel {
return;
}

auto spell = g_spells().getInstantSpellByName(name);
const auto &spell = g_spells().getInstantSpellByName(name);
if (spell) {
g_logger().trace("[{}] registering instant spell with name {}", __FUNCTION__, spell->getName());
// Increase data
Expand Down Expand Up @@ -127,7 +127,7 @@ bool IOWheel::initializeGlobalData(bool reload /* = false*/) {
// Register spells for druid
for (const auto &data : getWheelBonusData().spells.druid) {
for (size_t i = 1; i < 3; ++i) {
const auto grade = data.grade[i];
const auto &grade = data.grade[i];
InternalPlayerWheel::registerWheelSpellTable(grade, data.name, static_cast<WheelSpellGrade_t>(i));
}
}
Expand Down

0 comments on commit ba6ad33

Please sign in to comment.