add returns, lol

This commit is contained in:
Aaron Kimbre 2024-06-03 22:29:21 -05:00
parent 2ef45bd7ee
commit 1a14c29c39

View File

@ -324,9 +324,16 @@ 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()) GameMessages::SendSlashCommandFeedbackText(entity, u"No player Given"); if (args.empty()) {
GameMessages::SendSlashCommandFeedbackText(entity, u"No player Given");
return;
}
auto player = PlayerManager::GetPlayer(args); auto player = PlayerManager::GetPlayer(args);
if (!player) GameMessages::SendSlashCommandFeedbackText(entity, u"Player not found"); if (!player) {
GameMessages::SendSlashCommandFeedbackText(entity, u"Player not found");
return;
}
GameMessages::SendSlashCommandFeedbackText(entity, u"Spectating Player"); GameMessages::SendSlashCommandFeedbackText(entity, u"Spectating Player");
GameMessages::SendForceCameraTargetCycle(entity, false, eCameraTargetCyclingMode::DISALLOW_CYCLING, player->GetObjectID()); GameMessages::SendForceCameraTargetCycle(entity, false, eCameraTargetCyclingMode::DISALLOW_CYCLING, player->GetObjectID());
} }