Skip to content

Commit

Permalink
Remove CheckCheatStats() (#7461)
Browse files Browse the repository at this point in the history
  • Loading branch information
kphoenix137 authored Oct 7, 2024
1 parent 0fd4a7b commit baaa906
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 33 deletions.
8 changes: 4 additions & 4 deletions Source/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2522,10 +2522,10 @@ void CalcPlrPrimaryStats(Player &player, int strength, int &magic, int dexterity
vitality -= 2 * playerLevel;
}

player._pStrength = std::max(0, strength + player._pBaseStr);
player._pMagic = std::max(0, magic + player._pBaseMag);
player._pDexterity = std::max(0, dexterity + player._pBaseDex);
player._pVitality = std::max(0, vitality + player._pBaseVit);
player._pStrength = std::clamp(strength + player._pBaseStr, 0, 750);
player._pMagic = std::clamp(magic + player._pBaseMag, 0, 750);
player._pDexterity = std::clamp(dexterity + player._pBaseDex, 0, 750);
player._pVitality = std::clamp(vitality + player._pBaseVit, 0, 750);
}

void CalcPlrLightRadius(Player &player, int lrad)
Expand Down
29 changes: 0 additions & 29 deletions Source/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1458,33 +1458,6 @@ void ValidatePlayer()
myPlayer._pInfraFlag = false;
}

void CheckCheatStats(Player &player)
{
if (player._pStrength > 750) {
player._pStrength = 750;
}

if (player._pDexterity > 750) {
player._pDexterity = 750;
}

if (player._pMagic > 750) {
player._pMagic = 750;
}

if (player._pVitality > 750) {
player._pVitality = 750;
}

if (player._pHitPoints > 128000) {
player._pHitPoints = 128000;
}

if (player._pMana > 128000) {
player._pMana = 128000;
}
}

HeroClass GetPlayerSpriteClass(HeroClass cls)
{
if (cls == HeroClass::Bard && !gbBard)
Expand Down Expand Up @@ -2974,8 +2947,6 @@ void ProcessPlayers()
for (size_t pnum = 0; pnum < Players.size(); pnum++) {
Player &player = Players[pnum];
if (player.plractive && player.isOnActiveLevel() && (&player == MyPlayer || !player._pLvlChanging)) {
CheckCheatStats(player);

if (!PlrDeathModeOK(player) && (player._pHitPoints >> 6) <= 0) {
SyncPlrKill(player, DeathReason::Unknown);
}
Expand Down

0 comments on commit baaa906

Please sign in to comment.