Core/Players: Fix logic regarding HandleCharEnum and DHs (#17660)

* If CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_DEMON_HUNTER was set to 0 (disable in the config), it would still not allow you to create a DH in case there were no prior characters.
* If RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_DEMON_HUNTER was true (AKA allow DH creation always) it would not allow DH creation regardless of existing characters or not considering canAlwaysCreateDemonHunter was not checked for validity on charEnum.IsDemonHunterCreationAllowed.
This commit is contained in:
DJScias
2016-07-25 08:57:10 +02:00
committed by Shauren
parent 766afbeacd
commit bc467bb261

View File

@@ -266,6 +266,8 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result)
{
uint8 demonHunterCount = 0; // We use this counter to allow multiple demon hunter creations when allowed in config
bool canAlwaysCreateDemonHunter = HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_DEMON_HUNTER);
if (sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_DEMON_HUNTER) == 0) // char level = 0 means this check is disabled, so always true
canAlwaysCreateDemonHunter = true;
WorldPackets::Character::EnumCharactersResult charEnum;
charEnum.Success = true;
charEnum.IsDeletedCharacters = false;
@@ -319,7 +321,7 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result)
while (result->NextRow());
}
charEnum.IsDemonHunterCreationAllowed = (!charEnum.HasDemonHunterOnRealm && charEnum.HasLevel70OnRealm);
charEnum.IsDemonHunterCreationAllowed = (!charEnum.HasDemonHunterOnRealm && charEnum.HasLevel70OnRealm) || canAlwaysCreateDemonHunter;
SendPacket(charEnum.Write());
}