Skip to content

Commit

Permalink
Fix (#186)
Browse files Browse the repository at this point in the history
* Update AutoBalance.cpp

* Update AutoBalance.cpp
  • Loading branch information
Kitzunu authored Jul 18, 2024
1 parent b8de962 commit 94b4b4b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/AutoBalance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2631,14 +2631,14 @@ void UpdateMapPlayerStats(Map* map)

if (thisPlayer && !thisPlayer->IsGameMaster())
{
if (thisPlayer->getLevel() > highestPlayerLevel || highestPlayerLevel == 0)
if (thisPlayer->GetLevel() > highestPlayerLevel || highestPlayerLevel == 0)
{
highestPlayerLevel = thisPlayer->getLevel();
highestPlayerLevel = thisPlayer->GetLevel();
}

if (thisPlayer->getLevel() < lowestPlayerLevel || lowestPlayerLevel == 0)
if (thisPlayer->GetLevel() < lowestPlayerLevel || lowestPlayerLevel == 0)
{
lowestPlayerLevel = thisPlayer->getLevel();
lowestPlayerLevel = thisPlayer->GetLevel();
}
}
}
Expand Down Expand Up @@ -2707,14 +2707,14 @@ void AddPlayerToMap(Map* map, Player* player)
{
LOG_DEBUG("module.AutoBalance", "AutoBalance::AddPlayerToMap: Player {} ({}) | is already in the map's player list.",
player->GetName(),
player->getLevel()
player->GetLevel()
);
return;
}

// add the player to the map's player list
mapABInfo->allMapPlayers.push_back(player);
LOG_DEBUG("module.AutoBalance", "AutoBalance::AddPlayerToMap: Player {} ({}) | added to the map's player list.", player->GetName(), player->getLevel());
LOG_DEBUG("module.AutoBalance", "AutoBalance::AddPlayerToMap: Player {} ({}) | added to the map's player list.", player->GetName(), player->GetLevel());

// update the map's player stats
UpdateMapPlayerStats(map);
Expand Down Expand Up @@ -3489,7 +3489,7 @@ class AutoBalance_PlayerScript : public PlayerScript
{
LOG_DEBUG("module.AutoBalance", "AutoBalance:: {}", SPACER);

LOG_DEBUG("module.AutoBalance", "AutoBalance_PlayerScript::OnLevelChanged: {} has leveled ({}->{})", player->GetName(), oldlevel, player->getLevel());
LOG_DEBUG("module.AutoBalance", "AutoBalance_PlayerScript::OnLevelChanged: {} has leveled ({}->{})", player->GetName(), oldlevel, player->GetLevel());
if (!player || player->IsGameMaster())
{
return;
Expand Down Expand Up @@ -6685,7 +6685,7 @@ class AutoBalance_GlobalScript : public GlobalScript {

for (Map::PlayerList::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
{
if (!itr->GetSource() || itr->GetSource()->IsGameMaster() || itr->GetSource()->getLevel() < DEFAULT_MAX_LEVEL)
if (!itr->GetSource() || itr->GetSource()->IsGameMaster() || itr->GetSource()->GetLevel() < DEFAULT_MAX_LEVEL)
continue;

itr->GetSource()->AddItem(reward, 1 + difficulty); // difficulty boost
Expand Down

0 comments on commit 94b4b4b

Please sign in to comment.