From 8e7c29ecd32482e59f93fce5507acbb3128b7554 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Wed, 28 Jun 2023 22:34:20 +0200 Subject: [PATCH] Remove unused player property _pISplDur --- Source/loadsave.cpp | 8 ++++---- Source/missiles.cpp | 5 ----- Source/player.h | 1 - test/player_test.cpp | 1 - test/writehero_test.cpp | 1 - 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Source/loadsave.cpp b/Source/loadsave.cpp index bbdcbb284..ff13e1b44 100644 --- a/Source/loadsave.cpp +++ b/Source/loadsave.cpp @@ -516,9 +516,9 @@ void LoadPlayer(LoadHelper &file, Player &player) player._pIFlags = static_cast(file.NextLE()); player._pIGetHit = file.NextLE(); player._pISplLvlAdd = file.NextLE(); - file.Skip(1); // Unused - file.Skip(2); // Alignment - player._pISplDur = file.NextLE(); + file.Skip(1); // Unused + file.Skip(2); // Alignment + file.Skip(); // _pISplDur player._pIEnAc = file.NextLE(); player._pIFMinDam = file.NextLE(); player._pIFMaxDam = file.NextLE(); @@ -1330,7 +1330,7 @@ void SavePlayer(SaveHelper &file, const Player &player) file.WriteLE(player._pISplLvlAdd); file.Skip(); // Skip _pISplCost file.Skip(2); // Alignment - file.WriteLE(player._pISplDur); + file.Skip(); // _pISplDur file.WriteLE(player._pIEnAc); file.WriteLE(player._pIFMinDam); file.WriteLE(player._pIFMaxDam); diff --git a/Source/missiles.cpp b/Source/missiles.cpp index 2949e3bf1..bb6e201bd 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -1869,8 +1869,6 @@ void AddFireWall(Missile &missile, AddMissileParameter ¶meter) missile._mirange *= i + 1; if (missile._micaster == TARGET_PLAYERS || missile._misource < 0) missile._mirange += currlevel; - else - missile._mirange += (Players[missile._misource]._pISplDur * missile._mirange) / 128; missile._mirange *= 16; missile.var1 = missile._mirange - missile._miAnimLen; } @@ -2122,7 +2120,6 @@ void AddGuardian(Missile &missile, AddMissileParameter ¶meter) missile._mlid = AddLight(missile.position.tile, 1); missile._mirange = missile._mispllvl + (player._pLevel / 2); - missile._mirange += (missile._mirange * player._pISplDur) / 128; if (missile._mirange > 30) missile._mirange = 30; @@ -2313,7 +2310,6 @@ void AddStoneCurse(Missile &missile, AddMissileParameter ¶meter) missile.position.tile = *targetMonsterPosition; missile.position.start = missile.position.tile; missile._mirange = missile._mispllvl + 6; - missile._mirange += (missile._mirange * player._pISplDur) / 128; if (missile._mirange > 15) missile._mirange = 15; @@ -2455,7 +2451,6 @@ void AddInfravision(Missile &missile, AddMissileParameter & /*parameter*/) Player &player = Players[missile._misource]; missile._mirange = ScaleSpellEffect(1584, missile._mispllvl); - missile._mirange += missile._mirange * player._pISplDur / 128; } void AddFlameWaveControl(Missile &missile, AddMissileParameter ¶meter) diff --git a/Source/player.h b/Source/player.h index d374ad253..36fc4c0b1 100644 --- a/Source/player.h +++ b/Source/player.h @@ -268,7 +268,6 @@ struct Player { int _pIBonusAC; int _pIBonusDamMod; int _pIGetHit; - int _pISplDur; int _pIEnAc; int _pIFMinDam; int _pIFMaxDam; diff --git a/test/player_test.cpp b/test/player_test.cpp index 9bd161084..a92baa729 100644 --- a/test/player_test.cpp +++ b/test/player_test.cpp @@ -165,7 +165,6 @@ static void AssertPlayer(Player &player) ASSERT_EQ(player._pIFlags, ItemSpecialEffect::None); ASSERT_EQ(player._pIGetHit, 0); ASSERT_EQ(player._pISplLvlAdd, 0); - ASSERT_EQ(player._pISplDur, 0); ASSERT_EQ(player._pIEnAc, 0); ASSERT_EQ(player._pIFMinDam, 0); ASSERT_EQ(player._pIFMaxDam, 0); diff --git a/test/writehero_test.cpp b/test/writehero_test.cpp index 747ece815..1fc7368a1 100644 --- a/test/writehero_test.cpp +++ b/test/writehero_test.cpp @@ -349,7 +349,6 @@ void AssertPlayer(Player &player) ASSERT_EQ(player._pIFlags, ItemSpecialEffect::None); ASSERT_EQ(player._pIGetHit, 0); ASSERT_EQ(player._pISplLvlAdd, 0); - ASSERT_EQ(player._pISplDur, 0); ASSERT_EQ(player._pIEnAc, 0); ASSERT_EQ(player._pIFMinDam, 0); ASSERT_EQ(player._pIFMaxDam, 0);