fix(Player/Skills): Improve skill validation and logging in Player::_… (#22369)
This commit is contained in:
@@ -13631,7 +13631,11 @@ void Player::_LoadSkills(PreparedQueryResult result)
|
|||||||
SkillRaceClassInfoEntry const* rcEntry = GetSkillRaceClassInfo(skill, getRace(), getClass());
|
SkillRaceClassInfoEntry const* rcEntry = GetSkillRaceClassInfo(skill, getRace(), getClass());
|
||||||
if (!rcEntry)
|
if (!rcEntry)
|
||||||
{
|
{
|
||||||
LOG_ERROR("entities.player", "Character {} has skill {} that does not exist.", GetGUID().ToString(), skill);
|
LOG_ERROR("entities.player", "Player {} (GUID: {}), has skill ({}) that is invalid for the race/class combination (Race: {}, Class: {}). Will be deleted.",
|
||||||
|
GetName(), GetGUID().GetCounter(), skill, getRace(), getClass());
|
||||||
|
|
||||||
|
// Mark skill for deletion in the database
|
||||||
|
mSkillStatus.insert(SkillStatusMap::value_type(skill, SkillStatusData(0, SKILL_DELETED)));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -13652,7 +13656,8 @@ void Player::_LoadSkills(PreparedQueryResult result)
|
|||||||
|
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
{
|
{
|
||||||
LOG_ERROR("entities.player", "Character {} has skill {} with value 0. Will be deleted.", GetGUID().ToString(), skill);
|
LOG_ERROR("entities.player", "Player {} (GUID: {}), has skill ({}) with value 0. Will be deleted.",
|
||||||
|
GetName(), GetGUID().GetCounter(), skill);
|
||||||
|
|
||||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_SKILL);
|
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_SKILL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user