diff --git a/data-otservbr-global/scripts/actions/other/potions.lua b/data-otservbr-global/scripts/actions/other/potions.lua index ab5b97c8ff6..38c323e978e 100644 --- a/data-otservbr-global/scripts/actions/other/potions.lua +++ b/data-otservbr-global/scripts/actions/other/potions.lua @@ -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 diff --git a/data/events/scripts/player.lua b/data/events/scripts/player.lua index 6ff45d87d65..0a78d96c40d 100644 --- a/data/events/scripts/player.lua +++ b/data/events/scripts/player.lua @@ -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