Skip to content

Commit

Permalink
fix: kick yourself from house (#1906)
Browse files Browse the repository at this point in the history
Resolves #1891
  • Loading branch information
dudantas authored Nov 25, 2023
1 parent 63de456 commit 1a8e295
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions data-otservbr-global/scripts/spells/house/kick.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ function spell.onCastSpell(player, variant)
local targetPlayer = Player(variant:getString()) or player
local guest = targetPlayer:getTile():getHouse()
local owner = player:getTile():getHouse()
-- Owner kick yourself from house
if targetPlayer == player then
player:getPosition():sendMagicEffect(CONST_ME_POFF)
player:teleportTo(owner:getExitPosition())
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end
if not owner or not guest or not guest:kickPlayer(player, targetPlayer) then
player:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
player:getPosition():sendMagicEffect(CONST_ME_POFF)
Expand Down

0 comments on commit 1a8e295

Please sign in to comment.