Skip to content

Commit

Permalink
fix: everything related to magicLevel changed to u16
Browse files Browse the repository at this point in the history
  • Loading branch information
kokekanon authored Dec 14, 2024
1 parent 241d91b commit ffc02cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/client/localplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,26 +349,26 @@ void LocalPlayer::setMana(const uint32_t mana, const uint32_t maxMana)
callLuaField("onManaChange", mana, maxMana, oldMana, oldMaxMana);
}

void LocalPlayer::setMagicLevel(const uint8_t magicLevel, const uint8_t magicLevelPercent)
void LocalPlayer::setMagicLevel(const uint16_t magicLevel, const uint16_t magicLevelPercent)
{
if (m_magicLevel == magicLevel && m_magicLevelPercent == magicLevelPercent)
return;

const uint8_t oldMagicLevel = m_magicLevel;
const uint8_t oldMagicLevelPercent = m_magicLevelPercent;
const uint16_t oldMagicLevel = m_magicLevel;
const uint16_t oldMagicLevelPercent = m_magicLevelPercent;

m_magicLevel = magicLevel;
m_magicLevelPercent = magicLevelPercent;

callLuaField("onMagicLevelChange", magicLevel, magicLevelPercent, oldMagicLevel, oldMagicLevelPercent);
}

void LocalPlayer::setBaseMagicLevel(const uint8_t baseMagicLevel)
void LocalPlayer::setBaseMagicLevel(const uint16_t baseMagicLevel)
{
if (m_baseMagicLevel == baseMagicLevel)
return;

const uint8_t oldBaseMagicLevel = m_baseMagicLevel;
const uint16_t oldBaseMagicLevel = m_baseMagicLevel;
m_baseMagicLevel = baseMagicLevel;

callLuaField("onBaseMagicLevelChange", baseMagicLevel, oldBaseMagicLevel);
Expand Down
16 changes: 8 additions & 8 deletions src/client/localplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class LocalPlayer final : public Player
void setExperience(uint64_t experience);
void setLevel(uint16_t level, uint8_t levelPercent);
void setMana(uint32_t mana, uint32_t maxMana);
void setMagicLevel(uint8_t magicLevel, uint8_t magicLevelPercent);
void setBaseMagicLevel(uint8_t baseMagicLevel);
void setMagicLevel(uint16_t magicLevel, uint16_t magicLevelPercent);
void setBaseMagicLevel(uint16_t baseMagicLevel);
void setSoul(uint8_t soul);
void setStamina(uint16_t stamina);
void setKnown(const bool known) { m_known = known; }
Expand All @@ -65,9 +65,9 @@ class LocalPlayer final : public Player
uint32_t getTotalCapacity() { return m_totalCapacity; }

uint8_t getVocation() { return m_vocation; }
uint8_t getMagicLevel() { return m_magicLevel; }
uint8_t getMagicLevelPercent() { return m_magicLevelPercent; }
uint8_t getBaseMagicLevel() { return m_baseMagicLevel; }
uint16_t getMagicLevel() { return m_magicLevel; }
uint16_t getMagicLevelPercent() { return m_magicLevelPercent; }
uint16_t getBaseMagicLevel() { return m_baseMagicLevel; }
uint8_t getSoul() { return m_soul; }
uint8_t getLevelPercent() { return m_levelPercent; }

Expand Down Expand Up @@ -175,9 +175,9 @@ class LocalPlayer final : public Player
uint8_t m_levelPercent{ 0 };
uint32_t m_mana{ 0 };
uint32_t m_maxMana{ 0 };
uint8_t m_magicLevel{ 0 };
uint8_t m_magicLevelPercent{ 0 };
uint8_t m_baseMagicLevel{ 0 };
uint16_t m_magicLevel{ 0 };
uint16_t m_magicLevelPercent{ 0 };
uint16_t m_baseMagicLevel{ 0 };
uint8_t m_soul{ 0 };
uint16_t m_stamina{ 0 };
uint16_t m_regenerationTime{ 0 };
Expand Down

0 comments on commit ffc02cc

Please sign in to comment.