fix(Scripts/Commands): cs_character - Restore character rename reserved_name functionality (#9195)
This commit is contained in:
committed by
GitHub
parent
70fbaefa8e
commit
91eb17f888
@@ -0,0 +1,5 @@
|
|||||||
|
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1636956243535419760');
|
||||||
|
|
||||||
|
DELETE FROM `command` WHERE `name` = 'character rename';
|
||||||
|
INSERT INTO `command` (`name`, `security`, `help`) VALUES
|
||||||
|
('character rename', 2, 'Syntax: .character rename [$name] [reserveName] [$newName]\r\n\r\nMark selected in game or by $name in command character for rename at next login.\r\n\r\nIf [reserveName] is 1 then the player\'s current name is added to the list of reserved names.\r\nIf [newName] then the player will be forced rename.');
|
||||||
@@ -322,7 +322,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//rename characters
|
//rename characters
|
||||||
static bool HandleCharacterRenameCommand(ChatHandler* handler, Optional<PlayerIdentifier> player, Optional<std::string_view> newNameV)
|
static bool HandleCharacterRenameCommand(ChatHandler* handler, Optional<PlayerIdentifier> player, Optional<bool> reserveName, Optional<std::string_view> newNameV)
|
||||||
{
|
{
|
||||||
if (!player && newNameV)
|
if (!player && newNameV)
|
||||||
return false;
|
return false;
|
||||||
@@ -417,6 +417,11 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (reserveName)
|
||||||
|
{
|
||||||
|
sObjectMgr->AddReservedPlayerName(player->GetName());
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user