Skip to content

Commit

Permalink
creating checks and validations (causing errors).
Browse files Browse the repository at this point in the history
  • Loading branch information
elsongabriel committed Oct 25, 2023
1 parent 042c35b commit 6138206
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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 @@ -262,7 +262,7 @@ function flaskPotion.onUse(player, item, fromPosition, target, toPosition, isHot
potion.combat:execute(target, Variant(target:getId()))
end

if not potion.effect then
if not potion.effect and target:getPosition() ~= nil then
target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
end

Expand Down
4 changes: 2 additions & 2 deletions data/events/scripts/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder,
-- SSA exhaust
local exhaust = {}
if toPosition.x == CONTAINER_POSITION and toPosition.y == CONST_SLOT_NECKLACE and item:getId() == ITEM_STONE_SKIN_AMULET then
local pid = self:getId()
if exhaust[pid] then
local playerId = self:getId()
if exhaust[playerId] then
self:sendCancelMessage(RETURNVALUE_YOUAREEXHAUSTED)
return false
end
Expand Down

0 comments on commit 6138206

Please sign in to comment.