mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 10:31:29 +00:00
[Rules] Add World:MaximumQuestErrors Rule (#3349)
* [Rules] Add World:MaximumQuestErrors Rule # Notes - Allows operators to display more than 30 errors with #questerrors if they want. * Update quest_interface.h
This commit is contained in:
parent
21755a9f9e
commit
f0152cef66
@ -297,6 +297,7 @@ RULE_BOOL(World, StartZoneSameAsBindOnCreation, true, "Should the start zone alw
|
||||
RULE_BOOL(World, EnforceCharacterLimitAtLogin, false, "Enforce the limit for characters that are online at login")
|
||||
RULE_BOOL(World, EnableDevTools, true, "Enable or Disable the Developer Tools globally (Most of the time you want this enabled)")
|
||||
RULE_BOOL(World, EnableChecksumVerification, false, "Enable or Disable the Checksum Verification for eqgame.exe and spells_us.txt")
|
||||
RULE_INT(World, MaximumQuestErrors, 30, "Changes the maximum number of quest errors that can be displayed in #questerrors, default is 30")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Zone)
|
||||
|
||||
@ -11,8 +11,15 @@ void command_questerrors(Client *c, const Seperator *sep)
|
||||
|
||||
int error_index = 0;
|
||||
for (auto quest_error : quest_errors) {
|
||||
if (error_index >= 30) {
|
||||
c->Message(Chat::White, "Maximum of 30 errors shown.");
|
||||
if (error_index >= RuleI(World, MaximumQuestErrors)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Maximum of {} error{} shown.",
|
||||
RuleI(World, MaximumQuestErrors),
|
||||
RuleI(World, MaximumQuestErrors) != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -116,7 +116,6 @@ public:
|
||||
virtual uint32 GetIdentifier() = 0;
|
||||
virtual void RemoveEncounter(const std::string &name) { }
|
||||
|
||||
//TODO: Set maximum quest errors instead of hard coding it
|
||||
virtual void GetErrors(std::list<std::string> &quest_errors) {
|
||||
quest_errors.insert(quest_errors.end(), errors_.begin(), errors_.end());
|
||||
}
|
||||
@ -126,7 +125,7 @@ public:
|
||||
LogQuestErrors("{}", Strings::Trim(error));
|
||||
|
||||
errors_.push_back(error);
|
||||
if(errors_.size() > 30) {
|
||||
if (errors_.size() > RuleI(World, MaximumQuestErrors)) {
|
||||
errors_.pop_front();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user