mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Commands: Correct some unexpected behavior in .level
(cherry picked from commit d2f51569d1)
This commit is contained in:
@@ -729,7 +729,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleLevelUpCommand(ChatHandler* handler, Optional<PlayerIdentifier> player, Optional<int16> level)
|
||||
static bool HandleLevelUpCommand(ChatHandler* handler, Optional<PlayerIdentifier> player, int16 level)
|
||||
{
|
||||
if (!player)
|
||||
player = PlayerIdentifier::FromTargetOrSelf(handler);
|
||||
@@ -737,7 +737,7 @@ public:
|
||||
return false;
|
||||
|
||||
uint8 oldlevel = static_cast<uint8>(player->IsConnected() ? player->GetConnectedPlayer()->GetLevel() : sCharacterCache->GetCharacterLevelByGuid(*player));
|
||||
int16 newlevel = static_cast<int16>(oldlevel) + level.value_or(1);
|
||||
int16 newlevel = static_cast<int16>(oldlevel) + level;
|
||||
|
||||
if (newlevel < 1)
|
||||
newlevel = 1;
|
||||
|
||||
Reference in New Issue
Block a user