Code: Select all
-- Can an NPC shove or swap positions with a space occupied by another NPC?
function _M:canBumpDisplace(target)
if target == game.player then return end
if target.rank >= self.rank then return false end
if not target.x then return end
if self.never_move or target.never_move or target.cant_be_moved then return false end
if not self.move_others then return false end
return true
end

Fortunately, Entity:attr() is designed to handle that sort of thing, and it's how those fields are accessed everywhere else in the code. In particular, modifying the relevant line as follows appears to fix the bug:
Code: Select all
if self:attr('never_move') or target:attr('never_move') or target:attr('cant_be_moved') then return false end
