mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
[Initialization] Disable init command during combat
This commit is contained in:
@@ -575,6 +575,13 @@ std::string const PlayerbotHolder::ProcessBotCommand(std::string const cmd, Obje
|
||||
return "ERROR: You can not use this command on non-summoned random bot.";
|
||||
}
|
||||
|
||||
if (!admin) {
|
||||
Player* master = ObjectAccessor::FindConnectedPlayer(masterguid);
|
||||
if (master && (master->IsInCombat() || bot->IsInCombat())) {
|
||||
return "ERROR: You can not use this command during combat.";
|
||||
}
|
||||
}
|
||||
|
||||
if (GET_PLAYERBOT_AI(bot)) {
|
||||
if (Player* master = GET_PLAYERBOT_AI(bot)->GetMaster())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user