Skip to content
Snippets Groups Projects
Commit 84e7ba31 authored by Alex Ksandra's avatar Alex Ksandra
Browse files

Fixed mage apprentice being squashed by chronomancers and archmages beaming down.

parent 15c7e0ae
No related branches found
No related tags found
No related merge requests found
......@@ -85,8 +85,11 @@ end
function _M:findSpot(who, what)
if not who then return end
what = what or "block_move"
-- check the original spot first, dammit, the world map does a lot to ensure apprentice is in the right place
local check_spots = {{who.x, who.y}}
table.append(check_spots, table.values(util.adjacentCoords(who.x, who.y)))
local spots = {}
for _, coord in pairs(util.adjacentCoords(who.x, who.y)) do if game.level.map:isBound(coord[1], coord[2]) then
for _, coord in ipairs(check_spots) do if game.level.map:isBound(coord[1], coord[2]) then
if not game.level.map:checkAllEntities(coord[1], coord[2], what, who) and game.level.map:checkAllEntities(coord[1], coord[2], "can_encounter", who) and not game.level.map:checkAllEntities(coord[1], coord[2], "change_level") then
spots[#spots+1] = {coord[1], coord[2]}
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment