• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

isWalkable(cid, pos) error while no tile

WarOfTheTitans

Active Member
Joined
Feb 3, 2012
Messages
430
Reaction score
37
My script is checking a position on the map if it is walkable. Sometimes it I remove the tile (there is no tile, a entire black tile) and then I get this error when the script checks the position again:

Code:
[26/05/2012 22:40:16] [Error - TalkAction Interface] 
[26/05/2012 22:40:16] data/talkactions/scripts/Dada.lua:onSay
[26/05/2012 22:40:16] Description: 
[26/05/2012 22:40:16] (luaDoTileQueryAdd) Tile not found

Here is the function (from scarlet(omnislash))
LUA:
function isWalkable(cid,pos)
    local aux = pos
    aux.stackpos = 253
    if doTileQueryAdd(cid, pos) == 1 and getTilePzInfo(pos) == FALSE and getTileHouseInfo(pos) == FALSE and isCreature(getThingFromPos(aux).uid) == FALSE then
        return TRUE
    end
    return FALSE
end
 
Try this one:
LUA:
function isWalkable(pos, creature, proj, pz)-- by Nord
        if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
        if getTopCreature(pos).uid > 0 and creature then return false end
        if getTileInfo(pos).protection and pz then return false, true end
        local n = not proj and 3 or 2
        for i = 0, 255 do
                pos.stackpos = i
                local tile = getTileThingByPos(pos)
                if tile.itemid ~= 0 and not isCreature(tile.uid) then
                        if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
                                return false
                        end
                end
        end
        return true
end
 
Now it does'nt work anymore:
Code:
[28/05/2012 16:38:57] [Error - TalkAction Interface] 
[28/05/2012 16:38:57] data/talkactions/scripts/flash.lua:onSay
[28/05/2012 16:38:57] Description: 
[28/05/2012 16:38:57] data/lib/050-function.lua:667: attempt to index local 'pos' (a number value)
[28/05/2012 16:38:57] stack traceback:
[28/05/2012 16:38:57] 	data/lib/050-function.lua:667: in function 'isWalkable'
[28/05/2012 16:38:57] 	data/talkactions/scripts/flash.lua:22: in function <data/talkactions/scripts/Dada.lua:1>
 
There is nothing wrong in the script. I've seen this error on other scripts like "Bomberman" because they have chosen a wrong directory to the bomberman arena and I get this error because there is nothing on the tile. It's totally black.
 
LUA:
function isWalkable(cid, pos)
	pos.stackpos = 0
	if getTileThingByPos(pos).uid ~= 0 then
		local n = getTileInfo(pos)
		if n.protection == false and n.house == false and getTopCreature(pos).uid == 0 and doTileQueryAdd(cid, pos) == RETURNVALUE_NOERROR then
			return true
		end
	end
end
 
Back
Top