Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused Player struct variables: _pSBkSpell #7284

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading