Skip to content

Commit

Permalink
feat(Core/Game): add option for skip check talents count
Browse files Browse the repository at this point in the history
  • Loading branch information
Winfidonarleyan committed Oct 7, 2023
1 parent 319e1af commit b6dfe12
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
12 changes: 11 additions & 1 deletion src/server/apps/worldserver/worldserver.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4914,4 +4914,14 @@ Discord.GameLoginLogs.Enable = 0
#

Discord.BanLogs.Enable = 0
###################################################################################################
###################################################################################################

###################################################################################################
# WARHEAD SETTINGS
#
# Warhead.CheckTalents.Enable
# Description: Enable check talents count. If a player has more talents than needed, they will be reset
# Default: 1 - (Disabled)
#

Warhead.CheckTalents.Enable = 1
5 changes: 2 additions & 3 deletions src/server/game/Entities/Player/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2534,10 +2534,9 @@ void Player::InitTalentForLevel()
uint32 talentPointsForLevel = CalculateTalentsPoints();

// xinef: more talent points that we have are used, reset
if (m_usedTalentCount > talentPointsForLevel)
if (CONF_GET_BOOL("Warhead.CheckTalents.Enable") && m_usedTalentCount > talentPointsForLevel)
resetTalents(true);
// xinef: else, recalculate free talent points count
else
else // xinef: else, recalculate free talent points count
SetFreeTalentPoints(talentPointsForLevel - m_usedTalentCount);

if (!GetSession()->PlayerLoading())
Expand Down

0 comments on commit b6dfe12

Please sign in to comment.