Add an easy way to stop spectating

This commit is contained in:
Aaron Kimbre 2024-06-03 22:44:54 -05:00
parent 9d5d2a68ee
commit 3f22bf5cc0
2 changed files with 2 additions and 1 deletions

View File

@ -931,7 +931,7 @@ void SlashCommandHandler::Startup() {
Command SpectateCommand{ Command SpectateCommand{
.help = "Spectate a player", .help = "Spectate a player",
.info = "Specify a player name to spectate. They must be in the same world as you", .info = "Specify a player name to spectate. They must be in the same world as you. Leave blank to stop spectating",
.aliases = { "spectate", "follow" }, .aliases = { "spectate", "follow" },
.handle = GMGreaterThanZeroCommands::Spectate, .handle = GMGreaterThanZeroCommands::Spectate,
.requiredLevel = eGameMasterLevel::JUNIOR_MODERATOR .requiredLevel = eGameMasterLevel::JUNIOR_MODERATOR

View File

@ -325,6 +325,7 @@ namespace GMGreaterThanZeroCommands {
void Spectate(Entity* entity, const SystemAddress& sysAddr, const std::string args) { void Spectate(Entity* entity, const SystemAddress& sysAddr, const std::string args) {
if (args.empty()) { if (args.empty()) {
GameMessages::SendForceCameraTargetCycle(entity, false, eCameraTargetCyclingMode::DISALLOW_CYCLING, entity->GetObjectID());
GameMessages::SendSlashCommandFeedbackText(entity, u"No player Given"); GameMessages::SendSlashCommandFeedbackText(entity, u"No player Given");
return; return;
} }