Skip to content

Commit

Permalink
Remove unused Player struct variables: _pSBkSpell
Browse files Browse the repository at this point in the history
  • Loading branch information
kphoenix137 committed Jul 27, 2024
1 parent 5ae0e5e commit eca1223
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Source/loadsave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ void LoadPlayer(LoadHelper &file, Player &player)
player._pRSpell = static_cast<SpellID>(file.NextLE<int32_t>());
player._pRSplType = static_cast<SpellType>(file.NextLE<int8_t>());
file.Skip(3); // Alignment
player._pSBkSpell = static_cast<SpellID>(file.NextLE<int32_t>());
file.Skip<int32_t>(); // Skip _pSBkSpell
file.Skip<int8_t>(); // Skip _pSBkSplType

// Only read spell levels for learnable spells
Expand Down Expand Up @@ -1225,7 +1225,7 @@ void SavePlayer(SaveHelper &file, const Player &player)
file.WriteLE<int32_t>(static_cast<int8_t>(player._pRSpell));
file.WriteLE<int8_t>(static_cast<uint8_t>(player._pRSplType));
file.Skip(3); // Alignment
file.WriteLE<int32_t>(static_cast<int8_t>(player._pSBkSpell));
file.Skip<int32_t>(); // Skip _pSBkSpell
file.Skip<int8_t>(); // Skip _pSBkSplType

for (uint8_t spellLevel : player._pSplLvl)
Expand Down
1 change: 0 additions & 1 deletion Source/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2448,7 +2448,6 @@ void InitPlayer(Player &player, bool firstTime)
player._pRSpell = SpellID::Invalid;
if (&player == MyPlayer)
LoadHotkeys();
player._pSBkSpell = SpellID::Invalid;
player.queuedSpell.spellId = player._pRSpell;
player.queuedSpell.spellType = player._pRSplType;
player.pManaShield = false;
Expand Down
1 change: 0 additions & 1 deletion Source/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ struct Player {
int8_t spellFrom;
SpellID _pRSpell;
SpellType _pRSplType;
SpellID _pSBkSpell;
uint8_t _pSplLvl[64];
/** @brief Bitmask of staff spell */
uint64_t _pISpells;
Expand Down
1 change: 0 additions & 1 deletion test/player_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ static void AssertPlayer(Player &player)
ASSERT_EQ(player.inventorySpell, SpellID::Null);
ASSERT_EQ(player._pRSpell, SpellID::TrapDisarm);
ASSERT_EQ(player._pRSplType, SpellType::Skill);
ASSERT_EQ(player._pSBkSpell, SpellID::Null);
ASSERT_EQ(player._pAblSpells, 134217728);
ASSERT_EQ(player._pScrlSpells, 0);
ASSERT_EQ(player._pSpellFlags, SpellFlag::None);
Expand Down
1 change: 0 additions & 1 deletion test/writehero_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ void AssertPlayer(Player &player)
ASSERT_EQ(player.inventorySpell, SpellID::Null);
ASSERT_EQ(player._pRSpell, SpellID::Invalid);
ASSERT_EQ(player._pRSplType, SpellType::Invalid);
ASSERT_EQ(player._pSBkSpell, SpellID::Invalid);
ASSERT_EQ(player._pAblSpells, 134217728);
ASSERT_EQ(player._pScrlSpells, 0);
ASSERT_EQ(player._pSpellFlags, SpellFlag::None);
Expand Down

0 comments on commit eca1223

Please sign in to comment.