Skip to content

Commit

Permalink
Fix #194
Browse files Browse the repository at this point in the history
  • Loading branch information
joerod1 committed Mar 11, 2017
1 parent 0ebcc26 commit 3178651
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions path_7_x/data/creaturescripts/scripts/houseprotect.lua
@@ -1,3 +1,14 @@
local function isPathable(pos)
if getTileThingByPos(pos).itemid ~= 0 then
local tile = getThingfromPos(pos).uid
if hasProperty(tile, CONST_PROP_BLOCKSOLID) then
return false
end
return true
end
return false
end

local function isInvited(houseId, playerName)
if(string.find(string.lower(getHouseAccessList(houseId, 0x100)), playerName) or string.find(string.lower(getHouseAccessList(houseId, 0x101)), playerName)) then
return true
Expand All @@ -7,6 +18,10 @@ local function isInvited(houseId, playerName)
end

function onMoveItem(moveItem, frompos, position, cid)
if (not isPathable(position)) then
return false
end

if((getPlayerGroupId(cid) < 6) and (getTileInfo(position).house) and (getHouseOwner(getHouseFromPos(position)) ~= getPlayerGUID(cid)) and (not isInvited(getHouseFromPos(position), string.lower(getCreatureName(cid))))) then
doPlayerSendCancel(cid, "You cannot throw there.")
else
Expand Down

0 comments on commit 3178651

Please sign in to comment.