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: potions conditions for group ids above senior tutors #2019

Merged
merged 2 commits into from
Dec 11, 2023
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-otservbr-global/scripts/actions/other/potions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function flaskPotion.onUse(player, item, fromPosition, target, toPosition, isHot
end

local potion = potions[item:getId()]
if potion.level and player:getLevel() < potion.level or potion.vocations and not table.contains(potion.vocations, player:getVocation():getBaseId()) and not (player:getGroup():getId() >= 2) then
if potion.level and player:getLevel() < potion.level or potion.vocations and not table.contains(potion.vocations, player:getVocation():getBaseId()) and not (player:getGroup():getId() >= GROUP_TYPE_GAMEMASTER) then
player:say(potion.description, MESSAGE_POTION)
return true
end
Expand Down
2 changes: 1 addition & 1 deletion data/libs/functions/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function Player.feed(self, food)
end

function Player.getClosestFreePosition(self, position, extended)
if self:getGroup():getAccess() and self:getAccountType() >= ACCOUNT_TYPE_GOD then
if self:getGroup():getAccess() and self:getAccountType() == ACCOUNT_TYPE_GOD then
return position
end
return Creature.getClosestFreePosition(self, position, extended)
Expand Down