mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 05:27:19 +00:00
simplify if checks
This commit is contained in:
parent
02847c6849
commit
6c2f113604
@ -123,17 +123,13 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& chat, Entity*
|
||||
if (entity->GetGMLevel() >= commandHandle.requiredLevel) {
|
||||
if (commandHandle.requiredLevel > eGameMasterLevel::CIVILIAN) Database::Get()->InsertSlashCommandUsage(entity->GetObjectID(), input);
|
||||
commandHandle.handle(entity, sysAddr, args);
|
||||
} else {
|
||||
} else if (entity->GetGMLevel() != eGameMasterLevel::CIVILIAN) {
|
||||
// We don't need to tell civilians they aren't high enough level
|
||||
if (entity->GetGMLevel() != eGameMasterLevel::CIVILIAN) {
|
||||
error = "You are not high enough GM level to use \"" + command + "\"";
|
||||
}
|
||||
error = "You are not high enough GM level to use \"" + command + "\"";
|
||||
}
|
||||
} else {
|
||||
} else if (entity->GetGMLevel() == eGameMasterLevel::CIVILIAN) {
|
||||
// We don't need to tell civilians commands don't exist
|
||||
if (entity->GetGMLevel() == eGameMasterLevel::CIVILIAN) {
|
||||
error = "Command " + command + " does not exist!";
|
||||
}
|
||||
error = "Command " + command + " does not exist!";
|
||||
}
|
||||
|
||||
if (!error.empty()) {
|
||||
|
Loading…
Reference in New Issue
Block a user