Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: boss lever check god access #3141

Merged
merged 3 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/libs/functions/boss_lever.lua
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function BossLever:onUse(player)
return true
end

local isAccountNormal = creature:getAccountType() == ACCOUNT_TYPE_NORMAL
local isAccountNormal = creature:getAccountType() < ACCOUNT_TYPE_GAMEMASTER
if isAccountNormal and creature:getLevel() < self.requiredLevel then
local message = "All players need to be level " .. self.requiredLevel .. " or higher."
creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, message)
Expand Down
6 changes: 2 additions & 4 deletions src/utils/pugicast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ namespace pugi {
// If the string could not be parsed as the specified type
if (errorCode == std::errc::invalid_argument) {
// Throw an exception indicating that the argument is invalid
logError(fmt::format("Invalid argument {}", str));
throw std::invalid_argument("Invalid argument: " + std::string(str));
logError(fmt::format("[{}] Invalid argument {}", __FUNCTION__, str));
}
// If the parsed value is out of range for the specified type
else if (errorCode == std::errc::result_out_of_range) {
// Throw an exception indicating that the result is out of range
logError(fmt::format("Result out of range: {}", str));
throw std::out_of_range("Result out of range: " + std::string(str));
logError(fmt::format("[{}] Result out of range: {}", __FUNCTION__, str));
}

// Return a default value if no exception is thrown
Expand Down
Loading